4 ms·
Can you write the GC for go in go?
by Ericson2314 7y ago
Can you write the GC for go in go?
- fiddlerwoaroof 7y agoPeople have written GCs for lisps in (non-allocating subset of) the target language
- Ericson2314 7y agoYes they have. It's a great approach. Does Go have a precisely defined subset for this?
- yellowapple 7y agoGo is self-hosting (i.e. Google's Go compiler is written in Go and is able to compile itself). I would assume that includes the garbage collector.
- Ericson2314 7y agoNope it does not. Writing the compiler self hosting has nothing to do with writing the run time system.
- yellowapple 7y agohttps://github.com/golang/go/tree/master/src/runtime https://github.com/golang/go/tree/master/src/runtime There's some assembly in there, but it seems to be mostly Go.
- tomohawk 7y agoYou need a Go compiler to compile Go, so yes.
- Ericson2314 7y agohttps://news.ycombinator.com/item?id=20522115 https://news.ycombinator.com/item?id=20522115 as I say here, this is unrelated.
- pjmlp 7y agoYes, in fact that is the case with the reference compiler.