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

Unsafe Rust is much safer than C


> Unsafe Rust is much safer than C

That is not at all an obvious axiom.

I am willing to concede that "Rust" is safer than "C".

However, in "unsafe Rust" it is super easy to violate a Rust API precondition that the compiler takes advantage of. Even the Rust intelligentsia have pointed out that writing correct "unsafe Rust" is significantly harder than writing correct C.


Do you have source on that? I would like to know more. Not disputing this, just curious.



Thank you, appreciated!


To add on, unsafe Rust's main strength is the tools and the culture of encapsulating it well. It's probably the case that "well designed code that uses unsafe" is much safer overall, as you would expect for a memory-safe language. But it doesn't just come about from using unsafe.




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

Search: