As noted elsewhere (e.g., Why is my Rust program slower than the equivalent Java program?), if you compile Rust code in debug mode, it tends to be slow. If you turn on optimization, it tends to be much faster.
It's worth mentioning here that Rust compilers will do a great deal of optimization if you let them (or tell them). The cargo build system will do this when run in release mode. This optimization can make debugging very hard! So if you're trying to get code working, you probably don't want to do this yet.
Go compilers traditionally just do relatively simple optimization.1 So go build currently doesn't have an optimization level or flag, except for -N to disable optimization and -l to disable inlining.
1This optimization is not useless, but it's not the kind of super-fancy makes-following-your-code-in-the-debugger-impossible optimization that rustc does at high optimization levels.
This isn't meant to be a "Go vs Rust!!" post, just looking to get some opinions on the market share based on the recent survey.
In the 2023 StackOverflow Dev survey it showed that even though Go jumped up a couple of points, Rust had a bigger jump in comparison with last year and some people are speculating that Rust might overtake Go by next year.
This doesn't match my experience however, I see a lot of postings for Go jobs but barely any for Rust. This is of course, anecdotal but wanted to hear your folks' thoughts on this.
I do feel Rust is way more niche whereas Go already has robust tooling in a lot of the areas where more popular tech (like Node.js) is used so I expected a significant gap between Go and Rust on the "leaderboard".
Edit: I am specifically talking about the most popular technologies question
Videos
I've been trying to decide whether I should go with Rust from Mozilla Research or Go from Google. I've done both the tutorials and think both languages are fantastic. I just can't decide which one I want to stick with. At least for a little while anyway. Is there anything one language does better than the other? I'm tempted to stick with Go until Rust hits 1.0, but what do you guys think?
// EDIT //
I guess I should have elaborated a bit further without making it seem like a "this vs this" post. I do agree with the general consensus. Use what's best for what you're trying to do. What I was after was what each language is REALLY good at. From what everyone was saying is that Rust is good at the low-level stuff and Go is good for the higher-level stuff. Oh, and the decision to go with Go BEFORE Rust was due to the fact that Rust hasn't reached a "1.0". Every release had broken all kinds of stuff so I really don't want to learn a language until at least the syntax solidifies. For my goals however, it looks like I'll be learning both. :P I have a few Web Application ideas that I'll do in Go, and I want to experiment with making a Wayland Compositor in Rust.
Learning about Go can feel like Formula 1 racing, while Rust resembles a marathon. So, what's the catch? I believe anyone eager to learn should not limit themselves to one language, but rather explore both. Here’s why.
Let's assume you are learning Rust. In the initial days, you might feel that the learning curve is very steep, which can be daunting. The Rust compiler acts like a strict father who wants to make you responsible for every step you take, while still providing a layer of safety. This rigorous approach means that for building fast backends, microservices, or any networking application, Rust might seem like overkill due to the verbosity of the code. Meanwhile, Go offers the ability to achieve these tasks with sheer speed, thanks to a robust ecosystem designed for rapid development.
When examining the job market, you'll find that the overall demand for Rust, even in freelancing, is less compared to Go. What's more, there are scarcely any positions for junior or entry-level Rust developers; you're expected to have substantial experience and several Rust projects under your belt before you can secure a job.
On the other hand, let's consider learning Go. What’s the problem with focusing solely on Go? It's straightforward – "easy peasy lemon squeezy." The Go compiler acts as a loving and humble mother, encouraging you to focus solely on your goals while it handles the rest. Go boasts a higher demand than Rust, and you can become proficient and delve deep into it within a few days. However, by not learning Rust, you’re missing out on its burgeoning ecosystem, which is predicted to flourish in the future. Knowing Rust is always a plus point, as it deepens your understanding of how modern software works.
Each language caters to different preferences. If you love building products quickly, choose Go. It's ideal for those who want to develop swiftly and see immediate results. If, on the other hand, you're passionate about constructing products you can swear by, can afford to invest more time, or simply want to appear cool, choose Rust. It offers a sense of mastery and depth, appealing to those who value robustness and detail in their work.
Both technologies have their pros and cons. If you want to move fast, choose Go. If you prefer to prioritize safety, depth, and responsibility, opt for Rust.
I'm a full-stack web developer, mainly working with TypeScript. I'm also familiar with Python and Dart, and I’ve worked a bit with Go and Rust.
Recently I decided to invest serious time into a high-performance language — but I’m stuck between Go and Rust.
On one hand, I already know some Go and really like its simplicity. I enjoy how I can just focus on implementing features without constantly thinking about the language itself.
On the other hand, I’m also familiar with Rust’s borrowing/ownership concepts, but Rust still feels a bit too low-level for me. I don’t always enjoy thinking about lifetimes, borrowing rules, variable scopes, etc., instead of building stuff.
But everywhere I look, people are talking about Rust — its safety, performance, lack of GC overhead, how many governments and organizations are recommending it, and how tons of tooling (especially in the TypeScript ecosystem) is being rewritten in Rust.
So I’m torn:
Go feels more productive and comfortable
Rust feels safer, more performant, and more future-proof
For someone with my background, which language would be a better long-term investment?
Would love to hear your thoughts.