4 ms·
It didn't figure them out at all, the programmer had to figure them out the hard way and then code them in so that the compiler understands them. GC is figurin
by blub 6y ago
It didn't figure them out at all, the programmer had to figure them out the hard way and then code them in so that the compiler understands them.
GC is figuring out things mostly correctly and the programmer can focus on other things, at least until they hit a performance problem :)
- Lorkki 6y agoFor the most part, lifetime is inferred from scope, so there isn't anything special to figure out; objects live exactly for as long as you can see and use them. This also includes such things as lock handles, or references to refcounted objects.
- jashmatthews 6y agoOnly in the most trivial cases. Tons of real Rust uses copying or RC/ARC or even unsafe to avoid dealing with complex lifetimes because it's... complex.
- Lorkki 6y agoCopying, refcounting and locking work within the exact same semantics. They're among the most typical tools that are used to transmit or share data, so I'm not sure why it should be strange to see them used in most real programs?