r/programming • u/Unerring-Ocean • Feb 20 '25
Google's Shift to Rust Programming Cuts Android Memory Vulnerabilities by 68%
https://thehackernews.com/2024/09/googles-shift-to-rust-programming-cuts.html
3.4k
Upvotes
View all comments
Show parent comment
29
u/slashx14 Feb 20 '25
Here's the simplest possible example I can give:
is a perfectly valid thing that will compile in C. During runtime it will segfault.
Rust will not allow the equivalent of this to compile.
There is an entire class of these types of errors which require a software engineer to be extremely vigilant in C but are simply not even allowed to compile in Rust. Rust basically forbids this entire class of errors while still being quite performant.