Yet another programing language

Google have declared a new programming language – Go. Contrary to how the title might read, this post is not a tirade about the abundance of programming language – I just like this sort of expressions (and Google could have easily named Go as YAPL instead 😉 ). On the contrary – I’m all for a large selection of good programming language to choose from, and a programming language coming from there, like any other Google product released, definitely warrants a more serious test then what I can offer in this rather quick post.

But I actually found out about Go from a friend that asked about it, didn’t mention Google, and gave me a link to the home page at GoLang.org where Google is not mentioned. So my review below was not influenced by any Google hype, and on the face of it, after reading through about half of the tutorial and a couple of other documents, I don’t like it.

It is basically a C variant with garbage collection, some support for objects, a different type system (possibly better, definitely simpler then C++’s)  and internal support for threading and asynchronous IPC. I don’t like the fact that it has “native types” and “reference types” but requires the developer to know the difference and care about it (use new() vs. make(), Slices vs. Arrays, etc.) unlike Java which has similar issues but cares much less. Go is obviously built to compile fast and run fast with minimal considerations for coherent programming, and also to play into a few select people limited sense of “easy to program” – and the contrived syntax does not help.

Go also tries to adopt some useful features that were introduced in dynamic languages such as tuples, functions as 1st class values and closures but in this C variant this only makes the syntax more contrived and less understandable, possibly due to the designer’s aversion from using parenthesis to group stuff1.

I can see how it could be used to write small services instead of writing them in C or C++, and the benefits of that, but I would be very careful writing large software projects in this language, or small system administration tools.

The problems Go presents for large software development are in code reuse: lacking any sort of inheritance (not even Ruby-style mixins, though those would be obvious here) providing multiple implementations of an interface is going to be a pain. It looks like they prefer to implement polymorphism using services (as APIs or communication protocols) that reduce code duplication by importing functionality from packages – hardly what I’d consider sane for a large software project. Using flat packages (a-la C) for managing code is doable but allows developers to easily make a lot of mess and if I was designing a programming language with support for better code management I would have done it differently.

The problems Go presents for small system administration tools is that its overhead – while slightly lower then C or C++ – is still much higher then Perl and other dynamic languages (Ruby, Javascript, python) and possibly even higher then Java.

Its only benefits I see of Go are built-in multi-processing semantics with asynchronous communications, and possibly the small footprint which I guess would only interest people that have limits on the hardware they can deploy (small embedded systems, mobile devices, etc.). If you are planning to need these things, then by all means – go ahead and learn it, otherwise I suggest putting time into a more mature language with better semantics – like Ruby. It may be slower performing but it will allow you to deploy software faster and maintain it better.

After I’ve seen the Google blog post, I’d also like to comment that this new programming language came from several rather well known people:

  • Rob Pike is one of the fathers of UNIX, author of programming books and well known hater of object oriented design.
  • Ken Thompson is also one of the fathers of UNIX and responsible to a large degree for C (and many of its horrors).
  • Russ Cox is like the previous two one of the people responsible for Plan 9, the failed UNIX sequel from Bell Labs.
  • And a few other folks who with a quick Googling I did not find any interesting information about them other then the fact that they work for Google :-).

All in all, a respected group that I feel will allow the Go programming language develop into a mature programming language on its own. But at the moment, I suggest staying away from it.

  1. for example, compare var a,b = genTuple() vs. var (a,b) = genTuple() []

3 Responses to “Yet another programing language”

  1. Alon P:

    I haven’t gone over the language specs yet so I can’t judge the details, although the basic “Hello I18N World” app has rather hideous syntax. To my fragile Java-oriented mind this looks like some mutated JS.

    Skimming over the buzzword list does revel some things that are sourly missing from Java – tuples and closures, for instance. Regardless, one can argue that past a certain point added syntax is nothing more than semantic sugar. Certainly a language doesn’t really NEED tuple support. In the end it’s the massive Java (or, alternatively, .Net) API that makes it strong. Surely it’s not the stripped-down C++ syntax that made it attractive.

    In general what we need a is a widely accepted CLI-like solution.

  2. Adam S:

    Those Googlers, if you can’t win them, you’ll code using them(/ir language)

    grr 🙂

  3. Oded:

    I’m sometimes a bit surprised by the street-cred of the people Google hire to develop stuff: there was Guido van Rossum that wrote the App-Engine, Here we have Ken Thompson and Rob Pike and there were several other very famous people in their own right that did projects for Google.

    It looks a bit like Google is like some research lab that invites famous researchers to develop cool stuff, often with no clear commercial agenda behind it. Makes you wonder.

Leave a Reply