Remix.run Logo
whytevuhuni 3 days ago

The idea of Rust is not that it is 100% safe, but rather that it is able to encapsulate unsafety and divide the program in two parts:

- unsafe code plus modules that support it (the "trusted base")

- all the rest

Rust's promise is that there is no way to trigger any undefined behavior from bugs happening in "all the rest" of the code. If that code makes for more than 95% of the total, then that's a huge win compared to a completely unsafe language.

Also, Rust's support for inline assembly is in my opinion better than C's, it's much easier to specify and figure out the constraints on the boundary between Rust/assembly.