3 ms·
When you write Rust normally (without unsafe) you can mechanically verify it to be memory safe, whereas C++ is... well who knows really it's a 80s language, but
by pshc 5y ago
When you write Rust normally (without unsafe) you can mechanically verify it to be memory safe, whereas C++ is... well who knows really it's a 80s language, but if you follow <guidelines> maybe you're OK?
Add any number of safe Rust commits? Still memory safe.
Add any number of C++ commits? Who knows. Every change has to be checked.
- nyanpasu64 5y agoThis is true for the most part, as long as the safe Rust commits are not in the same module as unsafe code, and the unsafe code is built to prevent code in other modules from causing UB. See https://doc.rust-lang.org/nomicon/working-with-unsafe.html https://doc.rust-lang.org/nomicon/working-with-unsafe.html.
- pshc 5y agoThis is true if you have unsafe in your code, but I’m talking about Rust codebases with no unsafe blocks. (Which really any normal Rust app should adhere to, exactly for this sort of reason.)