this post was submitted on 08 Oct 2023
66 points (92.3% liked)
Rust
5959 readers
6 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Right, the whole point of Go is to be concurrency friendly, as in, the main reason you'd use it is to do multi-threaded concurrency. That's the #1 selling point and it's why goroutines and channels are a thing. Yet there are so many little things you need to keep in mind, such as:
Copy
andSend
traits, which can only work if everything you depend on implements theCopy
orSend
traitdefer
for unlocking; in Rust, you get this for free, as soon as you lock something, it'll unlock once your scope exitsnil
channel blocks instead of panicing (ideally it would fail to compile) - that's a pretty easy mistake to makeUnfortunately, you hit a lot of these cases in production instead of at compile time. In Rust, many of these types of issues are caught before you even get to testing your code, much less actually trying to ship something.
That's why my decision process is something like this:
Go isn't easy enough to just throw a junior developer on a project, and it's not robust enough to catch a senior developer when they make mistakes. I thought it would've been good enough, but it's just not as productive for me as Python (generally you hand-wave away the concurrency by using separate processes), and the compiler doesn't catch nearly enough to rival Rust, so I'm happy to pay the productivity penalty to shift from Python to Rust once I know I need something a bit more serious. And once you're experienced, the compiler doesn't really get in the way anymore.
Go is interesting I guess as a microservice tool where you're making things that are small enough, but imo it really doesn't scale all that well in terms of reducing bugs as the project gets larger.