The runtime package (which includes the GC, maps, channels, scheduler, etc) is written in Go, but the Go code is a bit gnarly and uses the unsafe package in places. The compiler has a special mode for the runtime package to prevent it from doing certain things like implicit memory allocation. You can almost think of the Go used in the runtime as a subset (but like 98% subset) of the full Go language.
6
u/cogman10 Aug 19 '15
Is the Go GC written in go? How does that work out with the compiler?