Why not use Go? They have one of the best networking stacks among language standard libraries, excellent support for low latency soft real-time concurrent operations, and single binary deployment is trivial.
For me personally (not OP): I find Elixir more ergonomic, the networking stuff is very solid, soft realtime is the whole reason it exists, and I don't need single binary deployment because everything is going to be running in a container in AWS anyway. Elixir also has Releases, which let you deploy a self-contained application more easily. But I think Go might let you cross-compile out of the box, which you can't do with Releases out of the box as far as I know.
go is great at a lot of things but if you want a multi clustered websocket solution, elixir is the absolute best in this category.
go has go threads. elixir has the actors, futures, message passing, immutable data structures and the OTP platform. OTP is killer and gives you genservers with pubsub and the ability to have thousands of tiny stateful processors PER machine.
Its all battle tested too.
comparing go to elixir in this particular case is like comparing a piper cub to a jet liner
source: 5 years of experience building an elixir startup with realtime sync between devices over websockets as a killer feature.
> the ability to have thousands of tiny stateful processors PER machine
Go has this too. It also has message passing (via channels). That's not to deny that Elixir/Erlang have a more developed story for IPC, process supervision and clustering.
Go is an ugly language and I don't enjoy working in it for that reason alone.
Outside of that, I also don't like the language design for a lot of its features.
Though, admittedly, the goroutines part is not one of those choices I dislike. But the error handling pattern, generics and a few other things are super meh to me.
And everything Go does with networking and concurrency, Elixir does better.
Elixir just doesn't have the backing of a big name like Google so it doesn't have the same popularity.
Elixir has releases, so deployment is not really that hard whether or not you use containers.
And the beam networking stack is quite good, which is unsurprising given it's been in slowly evolving use for 30 years now.
In go you just don't get stuff like "trivially cleaning up associated resources with zero lines of code when your socket gets early terminated by the client or a backhoe cuts the network in to the data center"
The best language for the task at hand, when presented with time constraints, is the one that you already know well. OP said in the article that they authored Papercups [1]. Adopting Elixir for a websocket-push service makes a lot of sense, then. However, why don't you learn Elixir, some OTP, and then reconsider that question? You could be missing out.
golang is pretty rudimentary versus the BEAM and OTP. It is hard to compare erlang/elixir to a traditional language. They benefit from the fact that you can run literally hundreds of thousands of processes on a single node all doing their own independent thing and managing their own state.
fndex|2 years ago
Not to mention how good Phoenix and Ecto are. I would never think about using Go if Elixir is a suitable option.
jolux|2 years ago
throwawaymaths|2 years ago
cultofmetatron|2 years ago
go has go threads. elixir has the actors, futures, message passing, immutable data structures and the OTP platform. OTP is killer and gives you genservers with pubsub and the ability to have thousands of tiny stateful processors PER machine.
Its all battle tested too.
comparing go to elixir in this particular case is like comparing a piper cub to a jet liner
source: 5 years of experience building an elixir startup with realtime sync between devices over websockets as a killer feature.
foldr|2 years ago
Go has this too. It also has message passing (via channels). That's not to deny that Elixir/Erlang have a more developed story for IPC, process supervision and clustering.
ianbutler|2 years ago
Very personal opinion:
Go is an ugly language and I don't enjoy working in it for that reason alone.
Outside of that, I also don't like the language design for a lot of its features.
Though, admittedly, the goroutines part is not one of those choices I dislike. But the error handling pattern, generics and a few other things are super meh to me.
And everything Go does with networking and concurrency, Elixir does better.
Elixir just doesn't have the backing of a big name like Google so it doesn't have the same popularity.
cdelsolar|2 years ago
cheeseblubber|2 years ago
throwawaymaths|2 years ago
And the beam networking stack is quite good, which is unsurprising given it's been in slowly evolving use for 30 years now.
In go you just don't get stuff like "trivially cleaning up associated resources with zero lines of code when your socket gets early terminated by the client or a backhoe cuts the network in to the data center"
rco8786|2 years ago
Dowwie|2 years ago
[1] https://github.com/papercups-io/papercups
whalesalad|2 years ago
reeaper|2 years ago
adregan|2 years ago