I committed the gccgo frontend to the mainline of gcc yesterday. Getting to this point was a long series of steps to get the various supporting patches approved. This means that gccgo will definitely be available in the gcc 4.6 release, which will happen sometime early next year.
There is still quite a lot of work to do, of course. Now that it’s in mainline, more people are going to try it on more targets. I’ve only been using GNU/Linux, and Vinu Rajashekhar ported it to RTEMS. Other targets will have problems. Also, the gccgo frontend is still intimately tied to gcc when it converts from the gccgo IR to the gcc IR. I want to increase that separation, so that the frontend proper is independent of gcc itself.
On the functionality side, the gccgo library uses a single operating system thread for each goroutine. That is not what 6g/8g do: they multiplex goroutines onto operating system threads. Multiplexing is more efficient for a language like Go, and I need to change gccgo to work that way.
I also plan to use some escape analysis recorded in the export information to track whether pointer arguments escape—whether they are stored in memory. If a pointer argument does not escape, then it does not need to be pushed onto the heap. My hope is that implementing that will significantly reduce the amount of garbage that is created, and therefore reduce the amount of work that the garbage collector has to do.
Release gccgo in gcc is going to introduce a difficulty for Go programmers who use it. The Go language continues to evolve, but gcc 4.6 will not. That means that people using gcc 4.6 will be using a language which will be increasingly out of date. I don’t think there is any way to avoid that problem at this stage. The language will become more stable over time.
So this is just one more step along the way, but it’s a major one, and I’m very glad that it is finally done.
Leave a Reply
You must be logged in to post a comment.