logoalt Hacker News

aero-glide2yesterday at 11:57 AM1 replyview on HN

Quite impressive, I did not know so many bugs were due to memory access.


Replies

IshKebabyesterday at 1:53 PM

To be fair the increased reliability of Rust code over C++ isn't just because of memory errors (out-of-bounds accesses, use-after-free, type confusion, etc). You also get:

* No undefined behaviour (outside `unsafe`, which is quite easy to avoid). In C++ there are many many sources of UB that aren't really memory errors directly, e.g. signed integer overflow or forgetting to `return` from a function.

* A much stronger type system.

Those two things have a really significant impact on reliability.

show 1 reply