← Back to context

Comment by cowlevel

11 days ago

And in absolute terms?

All memory safety on von Neumann architectures is specified with respect to a TCB. For Rust, the TCB includes the compiler. The TCB can have bugs. This doesn't invalidate the memory safety promise, given that it is made with respect to the TCB.

In contrast, memory-unsafe languages don't even try to have a TCB relative to which memory safety is specified. That's the main difference.

Literally nothing can be anything in absolute terms, what's your point? The fact is that Rust is miles better than any other language in terms of memory safety & performance ratio. That's all that matters.

  • Java, surprisingly, is not that much slower than Rust - but given these bugs, Java blows Rust away in memory safety. So I'd say it is the language you are looking for. Presumably any other JVM language also passes the test and maybe also CLR languages.

    • > but given these bugs, Java blows Rust away in memory safety.

      It's not like Java is immune to memory safety-related implementation bugs either (e.g., [0]):

      > A resource area allocated object is probably passed/used outside of the scope of the corresponding ResourceMark (similar to JDK-8325672).

      So "blows Rust away in memory safety" doesn't seem quite supported enough?

      [0]: https://bugs.openjdk.org/browse/JDK-8336095