Why I want to learn Go? Because I know Lisp and Java!

So everyone is talking about the Go language lately. The niche it’s supposed to fill, as I understand it, is low level systems programming, with a somewhat more pleasant experience for the programmer than C used to provide, and better security. Well, I’m a little sceptical about Go, so I’ll learn it. What, you ask?

Well, for one thing, in my personal view of the world, low level systems programming and Garbage Collection don’t mix. GC has always been a sign of higher level languages to me, cemented by languages that call themselves “object oriented” and/or “functional”. Guess what, Go claims to be both — somewhat. So no manual control about memory in a systems language? But it’s more than that.

The real problem I have with Go is that it looks like a Jack of all trades, master of none:

  • OOP? Yup, but only a little: Interfaces and methods, but no type hierarchy or inheritance, because that’s hard, and requires lots of specification.
  • Functional programming? Yup, but only a little: Lambdas and lexical scoping, but no tail calls, because that’s hard, and the stack traces become mangled. Sounds just a tiny little like the arguments against TCO in Python to me.
  • Strong static typing? Yup, but only a little. No generics, because that’s hard. So if I want to write a library for, say, linked lists, I just can’t make it generic. It’s either a list of ints, or a completely new implementation for lists of strings. Whee. Of course, you can use interface{} as the new void*, but then you lose type safety. In a strongly, statically typed language. It’s like Java < 1.4 all over again.
  • Don’t get me started on concurrency. A little of this, a little of that. Cool. Knowing Erlang and hearing the rave about all the cool concurrency features in Go makes me cringe.
  • new vs. make. What? Ah, so I need make for slices and hashes, and new for everything else. Why doesn’t the compiler choose for me? That’s what a compiler is there for!

So, at a first glance-and-write-a-few-pet-projects-in-go, it looks — to me, at the moment — like Go takes a few features from other languages, mixes them together, but only in a somewhat half-assed way. Please correct me if I’m wrong, okay?

Maybe it’s because I’ve just completed another Scheme implementation: A compiler for a virtual machine that’s simple enough to be implemented in or further compiled to 386 Assembler. Going through SICP is an eye opening experience, once again exposing Scheme as a damn fine language. Doing the SICP exercises in Common Lisp makes it even more clear how powerful Lisp as a language family is. The problem is this: Once you are comfortable with Lisp, you start to see ALL other programming languages as toys, some of them cheaper than the others. It’s Blub all over again. Maybe that’s why my view of Go is mangled. Maybe I expect too much. But every time I hear someone rave about Go, I think, yup, can be done simpler in Lisp. I know Lisp is not considered a low level, systems language, but if Go is one, then so is Lisp.

Of course I’m being unfair here: I’ve known Lisp for a few years now, written half a dozen interpreters and compilers for it, and waded my way through almost all the SICP exercises, the full implementation of Scheme in C or Assembler (exercise 5.5.1 and 5.5.2) still waiting for me on the horizon. Not for long, I guess. On the other hand, my knowledge of Go is way more limited: A few toy programs, a little “how do I do this/that in Go?”, that’s all.

So to be able to judge it properly I’ll have to learn it properly. A programming language is more than syntax and semantics. It’s the culture you have to dive in. Like with human languages: You can’t learn, say, the Japanese language without learning about Japanese culture, too. If you don’t know Japanese culture considers foxes to really like fried tofu, you don’t know why きつねうどん (“fox udon”) are udon noodles with fried tofu. Gotta study the culture.

I made a big mistake with Java before: Look at it, consider it a joke (and let’s face it, Java 1.0 WAS a joke), and stop bothering with it altogether. And suddenly, a few years later, half the job market consists of Java. Now that the hype is gone, other languages have taken Java’s place, but it has carved a niche for itself, just not the one it had been designed for.

Go is already far more advanced by now than the Java beta was. If the same happens to Go, I don’t want to be standing on the platform and watch the train leave without me AGAIN.

BRB gotta learn Go.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s