3 ms·
While the concurrency model is nice (especially waiting on multiple channels - I haven't found a way to do that nicely in C++), I think there are other bigger a
by IshKebab 11y ago
While the concurrency model is nice (especially waiting on multiple channels - I haven't found a way to do that nicely in C++), I think there are other bigger advantages to Go:
* The standard library is really nice. It has almost everything you want and it's written in a clean non-enterprisey way
* It generates a single statically linked binary. Doing this is very difficult in most other languages.
* It's really really easy to cross-compile. Again, often very difficult in other languages (you might even have to compile your own compiler).
* It comes with a built in battle tested HTTP2 server, and a sane TLS library.
* It's a very simple language so it is easy for beginners to pick up, and also easy to read other people's code. Don't underestimate the importance of this - there's nothing worse than writing something awesome in a language that your coworkers find difficult, and then perpetually having to support it.
* The tooling is pretty good.
* Performance is good, and they've done really good work on minimising GC pause lengths.
Of course I wouldn't pretend there aren't downsides (cough generics), but they're mostly minor and certainly no worse than you'd have in any other system (C++/Python sounds like it would have more than its fair share of issues!).
Edit: Aside from generics, my biggest complaint is the impossibility of RAII. It's too easy to forget to `close()` things. Most languages suffer from this though, and at least Go makes some attempt to improve matters with `defer`.
- cm3 11y ago> it generates a single statically linked binary. Doing this is very difficult in most other languages. For AOT platforms it's difficult mostly due to glibc. e.g. on FreeBSD and Linux musl it's trivial to build fully static binaries. Otherwise all valid statements and Golang is an improvement over other mainstream languages. So here's some future items for improvement that would make it even better and well suited for wider use: * a nicer error handling mechanism, though this may be hard * dead code elimination. Golang's static binaries are huge compared to fully statically compiled executables for other languages. I suppose the new compiler passes and backend might provide a basis to solve this. * restore compile speed, which of course was mostly due to previously missing optimizations and simple compiler passes, which were added now and made it slower. Still the Wirth'ian language design allows for much faster compile times than C or C++.
- _ph_ 11y agoAnd don't forget: no makefiles! All the building and rebuilding is entirely handled by the compiler. Which is very nice for simplifying project building.