4 ms·
Manual resource management in Rust is about as convenient as manual resource management in modern C++. That is, you don't really do any "manual" memory manageme
by adrianN 10y ago
Manual resource management in Rust is about as convenient as manual resource management in modern C++. That is, you don't really do any "manual" memory management at all in >90% of your code, it's all taken care of by RAII.
- pjmlp 10y agoYes, but with the added benefit not requiring external tooling to validate those RAII pattern are used correctly and forcing not so security savvy developers to actually use them.
- kazagistar 10y agoSo it's better, safer, but still manual memory management.
- pjmlp 10y agoNot quite, because the rules are enforced by the compiler. In C++ the rules are enforced by optional tooling that most developers don't use. At CppCon 2015, only 1% of the audience acknowledged using such tools at Herb's talk about the core guidelines.
- Manishearth 10y agoIt's still automatic. You don't need to call free. The only difference is that you need to deal with whether or not things go on the heap, are refcounted, etc (but this decision is in the types, so you make it once and are done). Whether or not that's "manual" depends on your point of view. I consider it to be more along the lines of choosing guarantees.