Most active commenters
  • pjmlp(5)
  • gf000(3)

←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 21 comments | | HN request time: 0.002s | 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 #
xtracto ◴[] No.44983872[source]
I recently started writing Go for a new job, after 20 years of not touching a compiled language for something serious (I've done DevKitArm dev. as a hobby).

I know it's mostly a matter of tastes, but darn, it feels horrible. And there are no default parameter values, and the error hanling smells bad, and no real stack trace in production. And the "object orientation" syntax, adding some ugly reference to each function. And the pointers...

It took me back to my C/C++ days. Like programming with 25 year old technology from back when I was in university in 1999.

replies(3): >>44983908 #>>44989320 #>>44992569 #
1. pjmlp ◴[] No.44983908[source]
And then people are amazed for it to achieve compile times, compiled languages were already doing on PCs running at 10 MHz within the constraints of 640 KB (TB, TP, Modula-2, Clipper, QB).
replies(2): >>44983996 #>>44987458 #
2. remus ◴[] No.44983996[source]
> [some] compiled languages were already doing on PCs running at 10 MHz within the constraints of 640 KB

Many compiled languages are very slow to compile however, especially for large projects, C++ and rust being the usual examples.

replies(3): >>44984117 #>>44984834 #>>44986664 #
3. gf000 ◴[] No.44984117[source]
Well, spewing out barely-optimized machine code and having an ultra-weak type system certainly helps with speed - a la Go!
replies(1): >>44984661 #
4. remus ◴[] No.44984661{3}[source]
That's a reasonable trade-off to make for some people, no? There's plenty of work to be done where you can cope with the occasional runtime error and less then bleeding edge performance, especially if that then means wins in other areas (compile speeds, tooling). Having a variety of languages available feels like a pretty good thing to me.
replies(3): >>44984936 #>>44985777 #>>44986534 #
5. pjmlp ◴[] No.44984834[source]
True, however there are more programming languages than only C++ and Rust.
6. gf000 ◴[] No.44984936{4}[source]
Well, I personally would be happier with a stronger type system (e.g. java can compile just as fast, and it has a less anemic type system), but sure.

And sure, it is welcome from a dev POV on one hand, though from an ecosystem perspective, more languages are not necessarily good as it multiplies the effort required.

replies(2): >>44985955 #>>44989265 #
7. Filligree ◴[] No.44985777{4}[source]
Unfortunately the lack of abstraction and simple type system in Go makes it far _slower_ for me to code than e.g. Rust.
8. pjmlp ◴[] No.44985955{5}[source]
It is kind of ironic that from Go's point of view, Java's type system is PhD level of language knowledge.

Especially given how the language was criticised back in 1996.

9. const_cast ◴[] No.44986534{4}[source]
But go tooling is bad. Like, really really bad.

Sure it's good compared to like... C++. Is go actually competing with C++? From where I'm standing, no.

But compared to what you might actually use Go for... The tooling is bad. PHP has better tooling, dotnet has better tooling, Java has better tooling.

replies(3): >>44988158 #>>44992904 #>>44997224 #
10. adastra22 ◴[] No.44986664[source]
It is weird to lump C++ and Rust together. I have used Rust code bases that compile in 2-3 minutes what a C++ compiler would take literally hours to compile.

I feel people who complain about rustc compile times must be new to using compiled languages…

replies(2): >>44987076 #>>45001881 #
11. pjmlp ◴[] No.44987076{3}[source]
There is a way to make C++ beat Rust though.

Make use of binary libraries, export templates, incremental compilation and linking with multiple cores, and if using VC++ or clang vLatest, modules.

It still isn't Delphi fast, but becomes more manageable.

12. rollcat ◴[] No.44987458[source]
That's a bit unfair to the modern compilers - there's a lot more standards to adhere to, more (micro)architectures, frontends need to plug into IRs into optimisers into codegen, etc. Some of it is self-inflicted: do you need yet-another 0.01% optimisation? At the cost of maintainability, or even correctness? (Hello, UB.) But most of it is just computers evolving.

But those are not rules. If you're doing stuff for fun, check out QBE <https://c9x.me/compile/> or Plan 9 C <https://plan9.io/sys/doc/comp.html> (which Go was derived from!)

replies(2): >>44990568 #>>44995016 #
13. ponow ◴[] No.44988158{5}[source]
Go was a response, in part, to C++, if I recall how it was described when it was introduced. That doesn't seem to be how it ended it out. Maybe it was that "systems programming language" means something different for different people.
14. Mawr ◴[] No.44989265{5}[source]
What do you mean by saying Java compiles just as fast? Do you mean to say that the Java->bytecode conversion is fast? Duh, it barely does anything. Go compilation generates machine code, you can't compare it to bytecode generation.

Are Java AOT compilation times just as fast as Go?

replies(1): >>44989955 #
15. gf000 ◴[] No.44989955{6}[source]
> Duh, it barely does anything. Go compilation generates machine code, you can't compare it to bytecode generation

Why not? Machine code is not all that special - C++ and Rust is slow due to optimizations, not for machine code as target itself. Go "barely does anything", just spits out machine code almost as is.

Java AOT via GraalVM's native image is quite slow, but it has a different way of working (doing all the Java class loading and initialization and "baking" that into the native image).

16. bsder ◴[] No.44990568[source]
> That's a bit unfair to the modern compilers

It's really not. Proebsting's Law applies.

Given that, compilers/languages should be optimized for programmer productivity first and code speed second.

17. tom_m ◴[] No.44992904{5}[source]
Go tooling is among the best out there. You ever see npm?
18. pjmlp ◴[] No.44995016[source]
Indeed, and thankfully there exist languages like D and Delphi to prove as being a modern compiler and fast compilation times are still possible 40 years later.
19. melodyogonna ◴[] No.44997224{5}[source]
Go tooling is fine.
replies(1): >>45009891 #
20. surajrmal ◴[] No.45001881{3}[source]
If you use lto, rust compilation is far worse for comparable c++ code.
21. const_cast ◴[] No.45009891{6}[source]
Again, compared to languages that you probably shouldn't be contorting to make a web backend in, sure. Its better than C++ and JS (npm).

Compared to incumbents like dotnet and PHP? Uhh, no. The tooling is very far behind and cumbersome in comparison.