Understand the design decision of ownership in Rust [closed]Why doesn't println! work in Rust unit tests?Rust calling C, static const in C codeConvert a String to int in Rust?Ownership and conditionally executed codeImplementation of AnyMap and runtime overhead of `struct Port(u32);`How to enable Rust Ownership paradigm in C++Idiomatic ownership management of mutating state during arbitrary recursion in RustHow to transfer ownership of a value to C code from Rust?How can deserialization of polymorphic trait objects be added in Rust if at all?Rust borrowing/ownership

What does the integral of a function times a function of a random variable represent, conceptually?

How to denote matrix elements succinctly?

bldc motor, esc and battery draw, nominal vs peak

Like totally amazing interchangeable sister outfits II: The Revenge

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

a sore throat vs a strep throat vs strep throat

Multiple options vs single option UI

Are there physical dangers to preparing a prepared piano?

Is there any official lore on the Far Realm?

Can SQL Server create collisions in system generated constraint names?

Who was the lone kid in the line of people at the lake at the end of Avengers: Endgame?

What are the steps to solving this definite integral?

A ​Note ​on ​N!

Implications of cigar-shaped bodies having rings?

How come there are so many candidates for the 2020 Democratic party presidential nomination?

How can I get this effect? Please see the attached image

Do I have an "anti-research" personality?

Retract an already submitted recommendation letter (written for an undergrad student)

What happens in the secondary winding if there's no spark plug connected?

Why does Mind Blank stop the Feeblemind spell?

Don’t seats that recline flat defeat the purpose of having seatbelts?

As an international instructor, should I openly talk about my accent?

Which big number is bigger?

Is Diceware more secure than a long passphrase?



Understand the design decision of ownership in Rust [closed]


Why doesn't println! work in Rust unit tests?Rust calling C, static const in C codeConvert a String to int in Rust?Ownership and conditionally executed codeImplementation of AnyMap and runtime overhead of `struct Port(u32);`How to enable Rust Ownership paradigm in C++Idiomatic ownership management of mutating state during arbitrary recursion in RustHow to transfer ownership of a value to C code from Rust?How can deserialization of polymorphic trait objects be added in Rust if at all?Rust borrowing/ownership






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















I am trying to understand the usage of ownership in Rust.



So from what I can understand, ownership is a runtime mechanism which enforces the programmers to think further and prevent some unexpected and unnoticed read-write hazards or so.



But my question is that, this seems could be figured out by static analysis during compilation, why leave it to the runtime?



Also, could anyone share some experiences on using it during more real-world programming? I am a bit hesitant about using this, largely.










share|improve this question















closed as too broad by E_net4, Frxstrem, zrzka, trentcl, Stargateur Mar 16 at 23:34


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 2





    Rust ownership works at compile time

    – Grzegorz Piwowarek
    Mar 9 at 8:54






  • 1





    As the answer below suggests, the book covers this particular subject pretty well. It is done at compile time, although it can be made into a run-time construct with some smart pointer types such (e.g. Rc). Your second question is too broad and not appropriate for the site. The official website contains a few experiences from companies who started using Rust. You can also find so many others around the web in the form of blog posts.

    – E_net4
    Mar 9 at 11:00

















-1















I am trying to understand the usage of ownership in Rust.



So from what I can understand, ownership is a runtime mechanism which enforces the programmers to think further and prevent some unexpected and unnoticed read-write hazards or so.



But my question is that, this seems could be figured out by static analysis during compilation, why leave it to the runtime?



Also, could anyone share some experiences on using it during more real-world programming? I am a bit hesitant about using this, largely.










share|improve this question















closed as too broad by E_net4, Frxstrem, zrzka, trentcl, Stargateur Mar 16 at 23:34


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 2





    Rust ownership works at compile time

    – Grzegorz Piwowarek
    Mar 9 at 8:54






  • 1





    As the answer below suggests, the book covers this particular subject pretty well. It is done at compile time, although it can be made into a run-time construct with some smart pointer types such (e.g. Rc). Your second question is too broad and not appropriate for the site. The official website contains a few experiences from companies who started using Rust. You can also find so many others around the web in the form of blog posts.

    – E_net4
    Mar 9 at 11:00













-1












-1








-1








I am trying to understand the usage of ownership in Rust.



So from what I can understand, ownership is a runtime mechanism which enforces the programmers to think further and prevent some unexpected and unnoticed read-write hazards or so.



But my question is that, this seems could be figured out by static analysis during compilation, why leave it to the runtime?



Also, could anyone share some experiences on using it during more real-world programming? I am a bit hesitant about using this, largely.










share|improve this question
















I am trying to understand the usage of ownership in Rust.



So from what I can understand, ownership is a runtime mechanism which enforces the programmers to think further and prevent some unexpected and unnoticed read-write hazards or so.



But my question is that, this seems could be figured out by static analysis during compilation, why leave it to the runtime?



Also, could anyone share some experiences on using it during more real-world programming? I am a bit hesitant about using this, largely.







rust ownership






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 8:56









jonrsharpe

79.4k11113227




79.4k11113227










asked Mar 9 at 8:51









llllllllllllllllllllllllll

3,64242243




3,64242243




closed as too broad by E_net4, Frxstrem, zrzka, trentcl, Stargateur Mar 16 at 23:34


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as too broad by E_net4, Frxstrem, zrzka, trentcl, Stargateur Mar 16 at 23:34


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2





    Rust ownership works at compile time

    – Grzegorz Piwowarek
    Mar 9 at 8:54






  • 1





    As the answer below suggests, the book covers this particular subject pretty well. It is done at compile time, although it can be made into a run-time construct with some smart pointer types such (e.g. Rc). Your second question is too broad and not appropriate for the site. The official website contains a few experiences from companies who started using Rust. You can also find so many others around the web in the form of blog posts.

    – E_net4
    Mar 9 at 11:00












  • 2





    Rust ownership works at compile time

    – Grzegorz Piwowarek
    Mar 9 at 8:54






  • 1





    As the answer below suggests, the book covers this particular subject pretty well. It is done at compile time, although it can be made into a run-time construct with some smart pointer types such (e.g. Rc). Your second question is too broad and not appropriate for the site. The official website contains a few experiences from companies who started using Rust. You can also find so many others around the web in the form of blog posts.

    – E_net4
    Mar 9 at 11:00







2




2





Rust ownership works at compile time

– Grzegorz Piwowarek
Mar 9 at 8:54





Rust ownership works at compile time

– Grzegorz Piwowarek
Mar 9 at 8:54




1




1





As the answer below suggests, the book covers this particular subject pretty well. It is done at compile time, although it can be made into a run-time construct with some smart pointer types such (e.g. Rc). Your second question is too broad and not appropriate for the site. The official website contains a few experiences from companies who started using Rust. You can also find so many others around the web in the form of blog posts.

– E_net4
Mar 9 at 11:00





As the answer below suggests, the book covers this particular subject pretty well. It is done at compile time, although it can be made into a run-time construct with some smart pointer types such (e.g. Rc). Your second question is too broad and not appropriate for the site. The official website contains a few experiences from companies who started using Rust. You can also find so many others around the web in the form of blog posts.

– E_net4
Mar 9 at 11:00












1 Answer
1






active

oldest

votes


















2














Ownership in Rust is done at compile-time. You can see this as static analyzing at compile-time. It can be your best friend, but also your worst enemy. To develop with Rust, one needs patience. But you are also going to become a better programmer, because you are going to start thinking about dangling references, scopes, and memory allocations in general.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Ownership in Rust is done at compile-time. You can see this as static analyzing at compile-time. It can be your best friend, but also your worst enemy. To develop with Rust, one needs patience. But you are also going to become a better programmer, because you are going to start thinking about dangling references, scopes, and memory allocations in general.






    share|improve this answer



























      2














      Ownership in Rust is done at compile-time. You can see this as static analyzing at compile-time. It can be your best friend, but also your worst enemy. To develop with Rust, one needs patience. But you are also going to become a better programmer, because you are going to start thinking about dangling references, scopes, and memory allocations in general.






      share|improve this answer

























        2












        2








        2







        Ownership in Rust is done at compile-time. You can see this as static analyzing at compile-time. It can be your best friend, but also your worst enemy. To develop with Rust, one needs patience. But you are also going to become a better programmer, because you are going to start thinking about dangling references, scopes, and memory allocations in general.






        share|improve this answer













        Ownership in Rust is done at compile-time. You can see this as static analyzing at compile-time. It can be your best friend, but also your worst enemy. To develop with Rust, one needs patience. But you are also going to become a better programmer, because you are going to start thinking about dangling references, scopes, and memory allocations in general.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 9 at 9:07









        Alexander FalkAlexander Falk

        155415




        155415















            Popular posts from this blog

            AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

            Алба-Юлія

            Захаров Федір Захарович