3 ms·
> Additionally, we've been able to use the more expressive type system to encode the ownership semantics of the various structs and pointers, which takes the co
by vitiral 3y ago
> Additionally, we've been able to use the more expressive type system to encode the
ownership semantics of the various structs and pointers, which takes the
complexity of managing object lifetimes out of the hands of the
programmer, reducing the risk of use-after-frees and similar problems.
I find statements like this humorous. Who is "the programmer" in the above sentence, is it the "it" in "it is raining"?
It doesn't take it out of the hands of the programmer, it separates/delegates it to the programmer creating the types vs the programmer creating the implementation. They might be the same programmer and that programmer might be very happy they could separately encode such checks, but it doesn't take it out of anyone's hands.
- dralley 3y agoIt takes the burden of remembering the interactions between lifetimes across the entire system out of the programmer's hands. Sure, they still have to write the code that denotes the lifetimes, and they have to make sure the code continues to compile. But they don't have to remember that an object passed into some function call might be free'd inside a conditional 3 function calls deep
- vitiral 3y agoI don't believe the source was talking about lifetimes but rather creating clever types regarding ownership. Some "programmer" must still construct said types. I would agree that lifetimes are taken out of "the programmer's" hands in Rust for all "programmers" who are not working on the Rust lifetime compiler :D