C cannot protect a programmer from making certain mistakes whereas Rust does. Yes all such languages work at an unsafe level under the hood where machine instructions are used but Rust can and does strictly and explicitly isolate unsafe code.I'm saying that these class of memory safety bugs are the ones a language like Rust tries to prevent in compile-time instead of run-time.
https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
Both Rust and C are "unsafe" in the same mine field (dealing with real world hardware will always be unsafe in the programming sense) of those types of bugs and equivalently 'safe' elsewhere.
The difference is a electronic mine detector with Rust or a knife and hands probing the soil ahead with C.
View attachment 279022View attachment 279023
People with experience tend not to put full trust in the detector to make it 'safe'.
Have a read of this: Computer Scientist proves safety claims of the programming language Rust
That's proof in the mathematical sense, as in we can prove the square root of two is irrational, that kind of proof.
So if the team are all writing safe Rust code these kinds of errors simply cannot happen, ever, ever, ever - that is a huge improvement in quality."We were able to verify the safety of Rust's type system and thus show how Rust automatically and reliably prevents entire classes of programming errors," says Ralf Jung. In doing so, he also successfully addressed a special aspect of the programming language: "The so-called 'type safety' goes hand in hand with the fact that Rust imposes restrictions on the programmer and does not allow everything that the programmer wants to do.