Hacker News new | ask | show | jobs
by pkulak 841 days ago
> Golang is an absolutely ideal language for writing REST API microservices

Those are strong words for a language with all the flaws I just mentioned. :D Yes, green threads are great for network programming, but it's not the only language with them, and one feature does not make it "ideal". If I had to pick the best networking language... I'd probably say Elixir.

But even if we agree that it's ideal, it doesn't change my point.

3 comments

I find go distasteful, but are there really many other languages with an m:n threading model? Only other popular one I can think of is Erlang/Elixir.
Java 21, and I assume like every scripting language (Ruby, Python, etc). Though I guess with scripting you can't use more than one OS thread (not totally sure). Rust started off with it, and C# tried it too, but there are huge downsides to the model, so it's not like it's perfection incarnate and every other language just can't pull it off.
Does 21 actually automatically schedule fibers? to open cores?
Yup. It's all 100% automatic. Just use a different name for the thread pool and you're done, I believe.
Elixir performance is pretty average and it's not a statically typed language, things will blow up at runtime.
The better language at this to both Java, Go and, god forbid, Elixir is C#. It properly implements generics, pattern matching and task-based asynchronous model which allows to trivially interleave or dispatch all kinds of method calls in ways which require extremely verbose and bulky code in Go.
completely agree Elixir is a much better language all around for this type of work