DEV Community

Discussion on: Go vs Rust for web dev

Collapse
 
preslavrachev profile image
Preslav Rachev • Edited

I am biased towards Go. It's a much simpler language to start with. It also has a batteries-included standard library, having all that you need for setting up a Web service. Writing and maintaining small HTTP services in Go is simpler, because of the small overhead of having to deal with memory management.

Bear in mind that since Go bears a significant runtime, this will get reflected in the size of the wasm file one would have to fetch. If you do Electron apps, this won't matter, of course. If you want to distribute a tinier wasm file, you can check an alternative Go compiler called TinyGo which strips out some language features (from what I know), but offers a much smaller and thinner wasm output.

Of course, when memory safety is mission-critical (not the case for the vast majority of Web services, IMO), you can check out Rust. Be prepared for a lot of battles with the compiler though. Once you star getting a feel for Rust, you see how things start "clicking", but it's a very steep curve. I can suggest following this tutorial form start to end, and see for yourself if you like the experience or not.

Collapse
 
glebirovich profile image
Gleb Irovich

That was very insightful! Thanks 🙏