Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there anything special about Rust that distinguishes it from, say, c++?


Proper algebraic typing, a package manager (that's actually quite good), guaranteed memory safety, good LSP support, good performance, a not-nightmarish grammar... the list goes on and on. It's worth giving it a shot, honestly.


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.


This 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.


This 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.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: