Most active commenters
  • Jtsummers(3)

←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 11 comments | | HN request time: 1.331s | source | bottom
Show context
blixt ◴[] No.44983245[source]
I've been using Go more or less in every full-time job I've had since pre-1.0. It's simple for people on the team to pick up the basics, it generally chugs along (I'm rarely worried about updating to latest version of Go), it has most useful things built in, it compiles fast. Concurrency is tricky but if you spend some time with it, it's nice to express data flow in Go. The type system is most of the time very convenient, if sometimes a bit verbose. Just all-around a trusty tool in the belt.

But I can't help but agree with a lot of points in this article. Go was designed by some old-school folks that maybe stuck a bit too hard to their principles, losing sight of the practical conveniences. That said, it's a _feeling_ I have, and maybe Go would be much worse if it had solved all these quirks. To be fair, I see more leniency in fixing quirks in the last few years, like at some point I didn't think we'd ever see generics, or custom iterators, etc.

The points about RAM and portability seem mostly like personal grievances though. If it was better, that would be nice, of course. But the GC in Go is very unlikely to cause issues in most programs even at very large scale, and it's not that hard to debug. And Go runs on most platforms anyone could ever wish to ship their software on.

But yeah the whole error / nil situation still bothers me. I find myself wishing for Result[Ok, Err] and Optional[T] quite often.

replies(18): >>44983384 #>>44983427 #>>44983465 #>>44983479 #>>44983531 #>>44983616 #>>44983802 #>>44983872 #>>44984433 #>>44985251 #>>44985721 #>>44985839 #>>44986166 #>>44987302 #>>44987396 #>>45002271 #>>45002492 #>>45018751 #
bwfan123 ◴[] No.44986166[source]
> Concurrency is tricky

The go language and its runtime is the only system I know that is able to handle concurrency with multicore cpus seamlessly within the language, using the CSP-like (goroutine/channel) formalism which is easy to reason with.

Python is a mess with the gil and async libraries that are hard to reason with. C,C++,Java etc need external libraries to implement threading which cant be reasoned with in the context of the language itself.

So, go is a perfect fit for the http server (or service) usecase and in my experience there is no parallel.

replies(12): >>44986226 #>>44986281 #>>44986466 #>>44986582 #>>44986586 #>>44986595 #>>44986635 #>>44986765 #>>44986909 #>>44987112 #>>44987797 #>>45002426 #
1. stouset ◴[] No.44986226[source]
With all due respect, there are many languages in popular use that can do this, in many cases better than golang.

I believe it’s the only system you know. But it’s far from the only one.

replies(3): >>44986379 #>>44986393 #>>44986538 #
2. ibic ◴[] No.44986379[source]
Please elaborate or give some examples to back your claim?
3. antonchekhov ◴[] No.44986393[source]
> there are many languages in popular use that can do this, in many cases better than golang

I'd love to see a list of these, with any references you can provide.

replies(2): >>44986442 #>>44989091 #
4. Jtsummers ◴[] No.44986442[source]
Erlang, Elixir, Ada, plenty of others. Erlang and Ada predate Go by several decades, too.

You wanted sources, here's the chapter on tasks and synchronization in the Ada LRM: http://www.ada-auth.org/standards/22rm/html/RM-9.html

For Erlang and Elixir, concurrent programming is pretty much their thing so grab any book or tutorial on them and you'll be introduced to how they handle it.

5. dismalaf ◴[] No.44986538[source]
There's not that many. C/C++ and Rust all map to OS threads and don't have CSP type concurrency built in.

In Go's category, there's Java, Haskell, OCaml, Julia, Nim, Crystal, Pony...

Dynamic languages are more likely to have green threads but aren't Go replacements.

replies(2): >>44986571 #>>44986641 #
6. Jtsummers ◴[] No.44986571[source]
> There's not that many.

You list three that don't, and then you go on to list seven languages that do.

Yes, not many languages support concurrency like Go does...

replies(1): >>44986743 #
7. jen20 ◴[] No.44986641[source]
Erlang (or Elixir) are absolutely Go replacements for the types of software where CSP is likely important.

Source: spent the last few weeks at work replacing a Go program with an Elixir one instead.

I'd use Go again (without question) but it is not a panacea. It should be the default choice for CLI utilities and many servers, but the notion that it is the only usable language with something approximating CSP is idiotic.

8. dismalaf ◴[] No.44986743{3}[source]
And of those seven, how many are mainstream? A single one...

So it's really Go vs. Java, or you can take a performance hit and use Erlang (valid choice for some tasks but not all), or take a chance on a novel paradigm/unsupported language.

replies(2): >>44986790 #>>44987106 #
9. ◴[] No.44986790{4}[source]
10. Jtsummers ◴[] No.44987106{4}[source]
If you want mainstream, Java and C# are mainstream and both are used much more than Go. Clojure isn't too niche, though not as popular as Go, and supports concurrency out of the box at least as well as Go. Ada is still used widely within its niches and has better concurrency than Go baked in since 1983. And then, yes, Erlang and Elixir to add to that list.

That's 6 languages, a non-exhaustive list of them, that are either properly mainstream and more popular than Go or at least well-known and easy to obtain and get started with. All of which have concurrency baked in and well-supported (unlike, say, C).

EDIT: And one more thing, all but Elixir are older than Go, though Clojure only slightly. So prior art was there to learn from.

11. jose_zap ◴[] No.44989091[source]
Haskell would be one of them. It features transactional memory, which frees the programmer from having to think about explicitly locking.