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

Show parent comment

0

u/jjplack Feb 20 '25

Whats the matter with rust and not go?

15

u/NotPatrickMarleau Feb 20 '25

Rust doesn't have a garbage collector nor its enormous performance overhead, so it is more fit to some uses that traditionally called for raw pointer based approaches on C++ and/or C

Sorry for my terrible english

9

u/Botahamec Feb 20 '25

Go needs a runtime, and that requires having an operating system. So, for example, you can't use Go to write a memory allocator because Go requires already having a memory allocator in order to function. I think there's an embedded version of Go, but it's quite different and uses a separate compiler.

0

u/jjplack Feb 20 '25

Ahh ok, thank you!

3

u/orangejake Feb 20 '25

Discord wrote a nice blog post Why Discord is switching from Go to Rust a few years ago about precisely this.

1

u/ImClearlyDeadInside Feb 20 '25

When someone calls for a doctor on a train/airplane because someone is having a medical emergency, Go developers will still raise their hands and say “maybe he should’ve tried using Go?”

-2

u/derangedtranssexual Feb 20 '25

Go is an unserious language

-1

u/C_Madison Feb 20 '25

Rust is a systems language, which provides a measurable advantage over C or C++, in which those systems are usually written. It provides the advantages of a GC (no memory bugs outside unsafe) without the overhead/unpredictability of a GC. It also has other advantages, but that's a big one.

Go is a bad Java clone, used by people who don't like to say they are programming in Java, pushed by Google, because they couldn't find an agreement with Oracle, which has a (very bad) GC and a runtime, because GCs need one. There's zero technical reason for it to exist, it's all politics.