What language is the compiler of Go programming language written in?

I think the title is self explanatory.


Solution 1:

Programming languages aren't programs, hence they're not "written" in any language. They are often described by formal grammars (e.g. BNF).

Interpreters and compilers for programming languages are programs and so must be written in some kind of programming language.

Go has at least two compilers, gc and gccgo. The former was written in C, but is now written in Go itself. While the latter is a gcc frontend written mainly in C++. Go's libraries are written in Go.

Solution 2:

Look at the source and C for yourself, if I may say.


EDIT The Go team announced in December 2013 that they will be transitioning the compiler to Go. As of February 2015, the compiler is exclusively self-hosting, as the C implementation was deleted. The new compiler shipped for the first time with Go 1.5.

Solution 3:

It's written in C. The libraries are written in Go itself.

Edit: Now the compiler has been rewritten in Go, so it is fully self-hosting.

Solution 4:

"go compiler written in go and little of assembly"

"but gccgo is written in c c++ and go"

Rob Pike