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

Elements that can bond to themselves?

Is Diceware more secure than a long passphrase?

Was there a shared-world project before "Thieves World"?

Function pointer with named arguments?

How can I print the prosodic symbols in LaTeX?

What happened to Captain America in Endgame?

Dynamic SOQL query relationship with field visibility for Users

Rivers without rain

Did the BCPL programming language support floats?

How to stop co-workers from teasing me because I know Russian?

Was there a Viking Exchange as well as a Columbian one?

What causes platform events to fail to be published and should I cater for failed platform event creations?

a sore throat vs a strep throat vs strep throat

Multiple options vs single option UI

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

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

Mistake in years of experience in resume?

What's the polite way to say "I need to urinate"?

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

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

How would 10 generations of living underground change the human body?

Like totally amazing interchangeable sister outfits II: The Revenge

Pulling the rope with one hand is as heavy as with two hands?

'It addicted me, with one taste.' Can 'addict' be used transitively?



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?

            Алба-Юлія

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