r/programming • • 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

475 comments sorted by

View all comments

-12

u/SadieWopen Feb 20 '25

Can someone explain to me why we can't just do this in C? I understand that Rust is a "Safe" language, but why can't we just code in "Safe" C? I can't understand how adding more complexity results in faster execution.

3

u/Grounds4TheSubstain Feb 20 '25

Because Rust as a language has features to prevent memory safety issues, where C does not have the same features. So in the case of Rust, if you trust the implementation of the language, and use the safety features, then you inherit the safety properties. Because C lacks those features, you have to count on programmers not making mistakes, not rely on the language to prevent certain categories of mistakes.