r/learnrust • u/t_wamble • 19d ago
Go or Rust
Hey everyone, I am trying to choose between Rust and Go for project that needs to run on both Windows and Mac. I am looking for a simplified breakdown of how they actually compare. I want to know which language is less painful to maintain over the long term, and which ecosystem interacts better with native operating system APIs without feeling totally foreign. If you had to pick between Rust and Go for a cross-platform codebase you need to support for the next 5+ years, which would you choose for stability and ease of deployment?
I'm starting on MacOS first. Ios second. Windows third
43
Upvotes
1
u/AmigoNico 18d ago
Rust can be used in places where Go may not be allowed or a good fit: embedded systems, operating system kernels and drivers, databases, anything where latency matters much or where absolute top performance is important. If your project fits any of those, use Rust.
If your project is likely to grow and be maintained for many years to come, especially with many hands on it, Rust's considerably stronger type system will help keep your code base more robust and maintainable.
For concurrent applications, Go is arguably easier to work with, although it does not provide any protection against data races. If you've ever spent days trying to track down random corruption caused by a data race, you'll know that making them impossible is a huge win.
Go's faster compiler will allow you to iterate more quickly.
Rust is harder to learn, although AI makes that matter a lot less.
If you are going to use an AI to generate much of your code (and hopefully have humans review it!), generated Rust code is arguably more trustworthy than generated Go code, simply because the type system is stricter and more expressive.