Skip to main content

Go vs Rust: Why I chose Go... for now

·661 words·4 mins
Author
Jesse Molina
Engineer. Developer. Researcher.

Introduction

In late 2022, I put together my roadmap for projects to tackle in 2023, many of which revolved around Go and high performance development. I had spent a good part of the year in tutorial hell, teaching myself how to build distributed systems in Go. After much toil, I finally felt ready to start building complex projects of my own.

At the end of the year, curiosity got the best of me and I started to look into Rust. What I learned not only put my 2023 goals into question, but my career goals as well.

Should I drop Go and shift my focus to Rust?

In this blog, I’d like to share my thoughts on Go vs Rust and how I came to decide on what programming language to prioritize next.

Pros and Cons

The languages can be summed up as follows.

Go

Go was built with simplicity in mind, with a goal of enabling developers to write more high performance code with lower complexity. While Go is easier to learn and use, it omits features commonly found in other popular languages. As a result, it contradicts many well established programming paradigms - a point of controversy amongst programmers. Furthermore, Go uses a garbage collector, which hinders the developers control over a system’s CPU and memory usage.

Rust

Rust is a general purpose language that rivals the performance of C/C++. Above all, Rust prioritizes memory safety and containment, eliminating the risk of memory bugs. It uses the concepts of variable scopes, borrowing, and lifetimes - all of which contribute to Rust’s steep learning curve. The safety features are a tradeoff for fast development due to its intricacy, which may increase amongst larger collaborative teams.

Verdict

So, between Go and Rust, which of the two would I rather master?

Rust.

Consider the fact that 70% of bugs at Microsoft are due to memory safety - an example that is indicative of how prevalent memory bugs can be. Because of how Rust was designed to be written, programs won’t compile if there is an error with memory handling. A prospect of no memory bugs in a code base is game changing - think of all of the time and effort towards debugging that can be avoided! Rust is also blazingly fast; another bonus for those who are persistent enough to become proficient with the language.

So then, why am I prioritizing Go?

Solving Problems

During my dilemma in trying to decide between Go and Rust, I stumbled on a blog post "Teach Yourself Programming in 10 years". In essence, the argument made is that programming expertise isn't gained over night, but over the span of several years. It suggests that one should try many languages, understand their implementation and the primary problems that those languages were built to solve.

Reflecting on this idea, I pondered over where I currently stood in my own journey: What problems do I care to solve at this point in time in my career?

I want to design and build enterprise level distributed systems; scalability implied.

Rust is a great general-purpose language, one that especially excels in systems programming. The enforcement of memory safety and the means by which it accomplishes it are already changing the paradigm of how we think of programming as a whole. Not to mention, Rust is the preferred language for Web Assembly, a standardized binary format set to change the future of cloud native.

Still, Go is a complementary language for the problems I am trying to solve now. It has its fair share of deserved criticism, but it is the most prevelant language used for cloud native computing. Go enables fast development without comprimising high performance or type safety, features that are hard to beat when I want to do more to learn more.

For those reasons, I've decided to priortize Go over Rust… for now. Rest assured, Rust is gaining far too much traction to be ignored for long.