Tom Morris

11 November 2009

A pungent mix of programming, philosophy, pedanticism, procrastination, perplexity, peripheral political polemic, and platters of preposterousness.

New programming language: Go

I read on ReadWriteWeb that Google has published a new open source programming language called Go. You’d think Google would figure out that if you are designing a programming language it should be easy to Google - I remember the bad old days when search engines didn’t know the difference between C, C++ and C#. Okay, here are the good bits of Go. Ken Thompson and Rob Pike are on the team building it. So, you know, if you like UNIX, Plan9 or the kind of C you find in UNIX, you might rather like this.

It’s being sold as a faster, simpler C. What’s more interesting is that it has garbage collection built in: currently it’s just mark-and-sweep, but they plan on improving it. It has a rather primitive - deliberately so, they say - object system. And they’ve nicked the packaging system from Python, which is no bad thing. Go also has support for concurrency in the form of “goroutines” (geddit? They are like coroutines, but in Go! Huh huh huh.).

All in all, it’s pretty nice. Where might people use it? Well, actually, I’m guessing people might use it to prototype C. Rather than prototyping in Python/Ruby/Perl, prototype in Go. Only then people will find that the prototype becomes the product. And people might use it as a way of slowly easing into C and C++ from higher-level languages.

Am I going to use it? No. I’ll keep an eye on it, but I don’t do any C programming - or programming that would necessitate writing in a language that’s supposed to be broadly equivalent to C - at the moment. Currently, Ruby is my main language and Scala is the new sexy toy I’m playing with. I did this in Scala the other day when faffing around with the XML support: (doc"h1")(0).getClass.getMethods.filter(_.getReturnType() == Class.forName("java.lang.String")).foreach(println _). Pretty nice, eh? It’s like Ruby one-liners but type-safe! Perhaps I’m lazy, but I’m really beginning to like having the JVM, having good reflection support and all the stuff that comes with it.

Tags: