4 ms·
I've used both for a couple of projects, but my primary language of choice for most things nowadays is Rust so this will be a bit biased. However, Go is a fun l
by sondr3 4y ago
I've used both for a couple of projects, but my primary language of choice for most things nowadays is Rust so this will be a bit biased. However, Go is a fun language to use, it is incredibly easy to get up and running, it provides most of the tooling you need in a language (formatting, testing, linting etc) and compiles very fast (especially compared to Rust). It is a simpler language than Rust, and is missing a fair bit of more advanced features that other new languages has. Coming from TypeScript, I suspect Go will feel like a simpler version of it, the generic programming and type level magic you can do in TypeScript is far more advanced than the generics that Go (finally) has.
Comparing this to Rust however is a different ball game, where Go is straight forward and fairly easy to use, with Rust it can feel like the compiler is your enemy. Learning how the borrow checker works, why there are a whole bunch of string types, how mutability and references work when passing them around and so on is a serious undertaking. But once you get somewhat comfortable with it Rust is great. The compiler will guide you along with very helpful error messages, you can use pattern matching, traits and a advanced type system to your advantage to build very performant and easy to maintain programs.
In terms of getting "to the next level", I would highly recommend trying out Rust. Go is not a language that will challenge you the same way learning Rust will, the concepts and patterns from other languages map over fairly well to it (though the concurrency story in Go is really cool, definitely give it a good look!) whereas Rust will be more foreign.
I had used Rust for a few years when I worked on a couple of programs written in Go and it took me a week or two before I felt mostly comfortable with it. With Rust however it took me a few months to stop getting compiler errors every time I saved, and a few more months to internalize why the borrow checker complains. But working on the projects using Go felt like a downgrade from Rust, I gotta be honest. So many times I sat there thinking about how features from Rust would've made things so much neater... though now I feel the same with Haskell and Rust.
- LecroJS 4y agoThanks! This helps and gives some great perspective. Given your thoughts on this, would you recommend I start with Go and transition to Rust, or dive right into Rust with the goal of looking back on Go and seeing the difference after 6+ months of Rust?
- sondr3 4y agoI don't really think you can go wrong starting with either, I personally would obviously recommend Rust over Go since it is my language of choice and I think it will let you grow more as a developer than Go.