Google Go 1.5 Revs Garbage Collection, More

Google released version 1.5 of its Go programming language, which provides accelerated garbage collection and a rewrite of components from C++ to Go.

Google Go 1.5

Google announced the release of Go 1.5, the sixth major stable release of the company’s programming language, which brings much improved garbage collection along with several other enhancements.

Russ Cox, a principal engineer at Google and one of the two tech leads on the Google Go project, said there are four major new features or enhancements in Go 1.5. First, the compilers and the language runtime have been converted from C to Go. Second, there is a new low-latency, concurrent garbage collector. Third, it's now possible for C or C++ programs to call Go libraries. And fourth is that there are new ports of Go to Linux on 64-bit PowerPC, and Linux and Darwin on 64-bit ARM.

These last two things enable a project that is separate from Go 1.5 that Google calls the Go Mobile Experiment. That experiment is intended to explore the use of Go in mobile application development, Cox said.

Go is Google's attempt to make programmers more productive, he said. When you think about a programming language system, there are stacks, Cox explained. At the bottom, you have the language definition and above that you have the standard library APIs. Those two pieces are the foundation for everything else. Above those, you have the compiler and the library implementations and then there is the tooling to write, run and manage programs. That whole set serves as the foundation for additional libraries and projects that are written by end users—people outside Google.

When Google launched Go in November 2009, it launched some sketches of the bottom of the stack, such as the language definition and standard library and a prototype of the compilers and libraries. Their focus since then has been on refining the libraries and completing the stack. Go 1, which launched in March 2012, was the first step in finishing the stack. After Go 1.2, Cox said the team felt good about the core language and they started moving up the stack into the implementation of the runtime and the compilers. Go 1.3 and 1.4 built on that. Now, Go 1.5 is a major "painting in" of the key parts of the runtime and the compilers.

"The biggest change for us for Go 1.5 was that the compilers and the language runtime were converted from C to Go," Cox told eWEEK. "Originally these were both implemented in C because Go didn't exist and we needed something. But it made sense for a number of reasons to convert them to Go. For the runtime, the main reason was that writing a low-level language runtime depends on the tight integration with the compiler. So if your runtime is written in C that means you have to teach the C compiler about Go concepts like garbage collection pointer maps and write barriers. But the Go compiler already knows all of this anyway so it makes sense to convert the runtime to Go and not need the C compiler at all. So eliminating C code was very important to the concurrent garbage collection work because it reduced the amount of work we had to do in the compilers by half."