this post was submitted on 14 Nov 2025
55 points (100.0% liked)

Rust

7497 readers
57 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
 

We adopted Rust for its security and are seeing a 1000x reduction in memory safety vulnerability density compared to Android’s C and C++ code. But the biggest surprise was Rust's impact on software delivery. With Rust changes having a 4x lower rollback rate and spending 25% less time in code review, the safer path is now also the faster one.

(Emphasis in original.)

Of course, we should probably take the numbers with a grain of salt here; it's not a controlled scientific experiment, and the estimated vulnerability density for Rust in particular was calculated with a numerator of 1, so it could be way off.

Still, I think it's a good reminder that advocacy for using Rust over C and C++ isn't purely out of some irrational fanboy-ism for the language. The numbers here would have to be extremely off for there not to be a major effect.

Further down in the article:

This near-miss inevitably raises the question: "If Rust can have memory safety vulnerabilities, then what’s the point?"

The point is that the density is drastically lower. So much lower that it represents a major shift in security posture. Based on our near-miss, we can make a conservative estimate. With roughly 5 million lines of Rust in the Android platform and one potential memory safety vulnerability found (and fixed pre-release), our estimated vulnerability density for Rust is 0.2 vuln per 1 million lines (MLOC).

Our historical data for C and C++ shows a density of closer to 1,000 memory safety vulnerabilities per MLOC. Our Rust code is currently tracking at a density orders of magnitude lower: a more than 1000x reduction.

you are viewing a single comment's thread
view the rest of the comments
[–] onlinepersona@programming.dev 27 points 3 days ago (5 children)

On the phoronix forums there are people seething about Rust nonstop. Rust in the linux kernel is their favorite enemy and they will have very strong opinions about it without ever having written rust nor a line of code in the kernel.

Rust won't 100% replace C++ code in old code bases but I'm convinced that in 5-10 years the amount of new C++ code will fall behind Rust code.

[–] nous@programming.dev 14 points 3 days ago (4 children)

5 years is optimistic. More likely 10-20 years at least. Established languages have a lot of inertia and it takes a very long time for that to change.

[–] buddascrayon@lemmy.world 5 points 2 days ago

Considering the fact that there are crucial programs all across platforms that are written in Assembly and are still very relevant. This couldn't be more true.

load more comments (3 replies)
load more comments (3 replies)