5 ms·
* is the peace of mind it gives about safety, * How is that different than a garbage collected language?
by The_rationalist 7y ago
* is the peace of mind it gives about safety, *
How is that different than a garbage collected language?
- stuxnet79 7y agoNot different, if "safety" is your only criteria. GC languages provide memory safety at a cost (performance). C, C++ and Rust are preferred in settings where you don't want the GC to capriciously affect performance (e.g. HFT). However, out of the 3, Rust is the only one that is provably "memory safe" at compile time because it provides constructs (ownership, borrowing) that force you to write safe code. If your Rust code can compile it's more than likely safe. You can write equally performant code in C / C++ but both languages have a lot of foot guns.