I think I finally get Go

So people tend to try to think about Go as a “C replacement” or a “C++ replacement” in the sense that it’s a substitute those languages. It isn’t that, but it still is a C replacement, it’s still a C++ replacement.

And they move on to talking about it replacing Python, and Ruby, and Java, in the same sense. It’s not that either.

What I’ve realized is that Go is setting itself up for being a new lingua franca for the toolchain. There’s a great deal of code in a given *nix distribution written in C simply because C is the portable language across *nixen. There’s also plenty of Bourne shell script, Perl, and in some distros Python. All of this stuff — written mostly with portability in mind, with performance a distant consideration — is ripe to be replaced with a language more modern than shell and Perl, more easily packaged than Python, better-performing than any of those, and safer and more featureful than C.

Docker is the exemplar of this — the kind of thing that would have been written as a handful of C binaries with Python or Perl support scripts without a question ten years ago.

And in this context, the things about Go that seem to suck become more understandable. Go’s rigid and SCM-based dependency system is pretty terrible, but it’s functional, and it’s simple, and thus it was easy just to shove into the language as a pragmatic decision. Similarly, the absence of generics, the inferior type system, the very concept of interface{} is obnoxious, but it also obviates a big long nasty argument about how to implement generics. I have been following Rust and I like Rust and I think it’s the Next Big Thing but because it’s trying to be the Next Big Thing every minor change takes endless aeons of hashing out and debating and documenting.

There’s nothing particularly revolutionary about Go, but it fits perfectly into a niche that’s been desperately waiting for something like it. It’s safer than C, it’s faster and easier to deploy than Python, but it has a lot of qualities that appeal to people who have worked in those languages. I can’t say I’ve loved working with Go (from a primarily Ruby background) but I am impressed by its pragmatism, and I think it’s going to be a staple language over the next decade because of that pragmatism.