upvote
A language is only as memory safe as its runtime and external library interop calls. There are many more lines of code written in C executing when running a Python, Ruby, or PHP program than an equivalent Rust program.

Obviously Rust still makes plenty of calls to code that was written in C like libc or the operating system hosting it. But the other 3 do that and have tons of C in their runtime and stdlib on top of it.

reply
Memory safety is just the start.

For instance, it's much harder to end up with a SQL injection in Rust than in PHP. Similarly, the Rust type system is pretty good at modelling advanced protocols, so it's also harder to attack the lower layers.

reply
The large C dependencies of those other languages is a big reason, as someone already mentioned.

But Rust is also type-safe, with an extremely strong type system by mainstream standards. Used well, that’s an enormous benefit for robust and secure systems.

reply
The power of Option<T> and Result<T, E>
reply
I think closed enums might be equally important.

Also I don't understand how better type systems causing fewer CVEs is surprising to anyone.

reply