3 ms·
If the overhead of automatic GC doesn't fit your project you only have two choices: a) Keep all the ownership and lifetime information in your head and make su
by fauigerzigerk 7y ago
If the overhead of automatic GC doesn't fit your project you only have two choices:
a) Keep all the ownership and lifetime information in your head and make sure it gets communicated to other team members. Then write tests to make sure nothing was missed.
b) Formally specify ownership and lifetime so it can be checked by the compiler.
I'm not sure (a) is any less dehumanizing than (b)
- blub 7y agoBetween A and B there's quite a few type system tricks & tools that one can use which bring many benefits without incurring the costs of fully verified memory ownership. I stand by my original statement though: a) in a language like C and C++ one has to use their knowledge to come up with a solution and verify it. Pretty human. b) in a GC language, one mostly does not care. When they do, they do a). c) in Rust one does their best at a) and then does what the robot tells them to, even if the code is correct but the robot can't yet figure it out.