Nikkei Electronics Asia -- January 2010
Features
Google Discloses New "Go" Language

E-Mail Article
Tweet This
Digg This
Share this with friends on Facebook
Buzz Up!
Jan 1, 2010 00:01 Tatsuro Hokugo, Nikkei Electronics

Google Inc. disclosed its new "Go" programming language on Nov. 10, 2009, aimed at developers of OS and other system software. The new language is attracting considerable attention because the development team included people famous in operating systems and programming languages such as UNIX developers Ken Thompson and Rob Pike (Fig. 1).

Fig. 1 The Go Programming Language
Go has caused quite a stir not only because some of the developers were key members in developing software like UNIX and Plan 9, but also because Google disclosed it. Go maintains language simplicity while incorporating advanced specifications.

Pike explained the motivation behind the development of Go: "There hasn't been any progress in programming languages for system software in a decade. In those 10 years, hardware has evolved to multicore software development for the Web now uses dynamic scripting, and a host of other changes have occurred. I wanted to develop a new, high-productivity programming language that combined the productivity of scripting languages with the stability of static typing."

Yukihiro Matsumoto, developer of Ruby and an expert in programming languages, says this about Go on his blog: "I think it has excellent balance. It is much simpler, without the complexity of languages like Java or C++, but at the same time is packed full of new ideas to stimulate people like me who love languages."

The new language will be primarily utilized in server software development for now, but it will also be tweaked to support the Native Client implemented in Chrome, Google's browser software. Native Client is a technology designed to let browsers execute binary programs safely, and would make it possible to add 3D graphics display functions, for example. This type of program will now probably be written in Go.

Fig. 2 Basic Structure of Go Program
Overall programs are defined as "packages," and one package can receive processing from another using "import." Reserved language terms are shown in blue, and variable names in red. Program source code copied from the official Go Web site.

Carrying on the Concepts of Plan 9

While Go was originally expected to be based on C, the actual underlying structure of the program is closer to Java, C#, or other new static-typing object-oriented languages (Fig. 2). This is most evident in the package concept, the fact that it is possible to specify external packages using import, and a few other points. They clarify the relationships in the source code.

The outstanding characteristic of Go is its fast compiling. A program with about 1000 lines of code is compiled in a flash. We ran some tests on our PC here and were able to build the included standard math library (about 1000 lines) in only about 0.2 s. Recompiling the entire library set only took 7 s. Normally it takes several seconds for the former, and several minutes for the latter.