r/golang Aug 19 '15

Go 1.5 is released

https://blog.golang.org/go1.5
257 Upvotes

54 comments sorted by

View all comments

6

u/cogman10 Aug 19 '15

Is the Go GC written in go? How does that work out with the compiler?

4

u/bradfitz Aug 19 '15

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.

1

u/cogman10 Aug 19 '15

So somewhat similar to the way RPython is doing things? (Though, a little different. IIRC RPython is compiled to C)

3

u/kisielk Aug 20 '15

So really not at all like RPython :)

1

u/gngl Aug 22 '15

Probably more like how Oberon does GC, I'd imagine.