Go is great for building commands. Commands, not only in the CLI meaning of the word, but in general - tools with limited scope that do one thing well. This includes small Web services (I will avoid the term “microservices” here) and all kinds of recurring and one-off tooling. Basically, anything that you can afford to lose, because it is easy to spawn it up again. Thanks to Kubernetes, Docker, or even good old systemd or nohup, one can afford to just “let it crash” and start on a clean slate mere seconds afterward.
That is not to say that Go is not suitable for long-running operations. I am maintaining a few Go apps that have undergone months without a restart. It is definitely possible. However, when I think about what DHH calls “majestic monoliths,” building a Go application beyond a particular scale starts requiring thorough checking and guarding every possible place that can crash the app. And it will still crash regardless.
That is what rekindled my interest in Elixir and the BEAM in late 2019. If any system could be prepared to handle crashes gracefully, that would be the BEAM. This time, I was prepared with a lot more patience and a couple of great books (like
this one). Starting with a fresh Phoenix app, I quickly re-built
PodRadio’s user-facing part in Elixir in only about a couple of weeks. A few months later, I dug into LiveView too, which resulted in
AROUNDAWORLD - a fun little project with which I set out to beat the lockdown desperation of 2020 by giving people a compelling but straightforward challenge.
The more I worked with Elixir, the more I liked its syntax and the abstractions it adds on top of Erlang’s OTP (the core of what makes Erlang so famous) library. I am possibly one of the few people still set firm in Go-land who honestly find Erlang’s process/actor model easier to wrap their head around than orchestrating coroutines with channels. I instantly fell in love with the actor model, supervision trees, pipes, and pattern matching. I understand that neither of these concepts is unique to Elixir (or the BEAM), but for someone who has not dabbled deep into functional programming, this was the first stack where everything made sense to me.