digiarnie
digiarnie

Reputation: 23415

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

I think the title is self explanatory.

Upvotes: 92

Views: 42796

Answers (4)

zneak
zneak

Reputation: 138171

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.

Upvotes: 104

Ahmed
Ahmed

Reputation: 396

"go compiler written in go and little of assembly"

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

Rob Pike

Upvotes: 3

Artelius
Artelius

Reputation: 49099

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.

Upvotes: 171

Charles
Charles

Reputation: 11489

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.

Upvotes: 16

Related Questions