> Traditionally, you either have to manage the memory yourself (à la C), or pass the burden down to a run-time feature of the language – heroically called “the garbage collector“.
I think it's worth mentioning that C++ manages heap memory the same way Rust does, with destructors (Drop, in Rust). The story is a bit complicated with the new/delete operators only being deprecated recently and lots of legacy code sitting around, but vector and string work the same way, and those have been in common use for decades. The difference isn't the memory management strategy itself, but rather that Rust catches all our mistakes when we retain pointers to destroyed values. (Move semantics are also quite different, but that's a separate idea I think.)
I think it's worth mentioning that C++ manages heap memory the same way Rust does, with destructors (Drop, in Rust). The story is a bit complicated with the new/delete operators only being deprecated recently and lots of legacy code sitting around, but vector and string work the same way, and those have been in common use for decades. The difference isn't the memory management strategy itself, but rather that Rust catches all our mistakes when we retain pointers to destroyed values. (Move semantics are also quite different, but that's a separate idea I think.)