3 ms·
To be fair I don't think this is a blocker for Go to implement GGC and CGC. .NET supports interior pointers too, for example. You just have to design your alloc
by pcwalton 13y ago
To be fair I don't think this is a blocker for Go to implement GGC and CGC. .NET supports interior pointers too, for example. You just have to design your allocator right to allow the card marking to work.
In practice I think that the biggest problems are compiler related and affect both Go and Rust. Go and Rust both use conservative GC on the stack and as a result they take a lot of shortcuts. For example, LLVM (and GCC as far as I'm aware, though someone like DannyBee may correct me here) loses the distinction between integers and pointers by the time they get to the machine instruction level, which makes a lot of optimizations easier to implement but also making it impossible to generate precise stack maps. Fixing this would be a lot of hard work. It's probably easier in the Plan 9 compilers, of course, though I suspect it's still going to be a lot of hard work.
- agentS 13y agoI've been following along on golang-dev, and they seem to be making progress on precise stacks. See https://groups.google.com/forum/?fromgroups#!topic/golang-dev/vukEooCaZmM https://groups.google.com/forum/?fromgroups#!topic/golang-de... for example.
- darklajid 13y agoYou know a lot more about these things than I do. That said: Aren't the equivalent pointers in .Net _only_ allowed/usable if you pin your object? If you tell the GC explicitly 'please don't move that, I'm pointing to that thing here'? That's hard to bolt on to Go, imho. For Go it seems to be implicitly allowed, in .Net you have to ask explicitly?
- happy_dino 13y agoGo's GC is non-moving, exactly because they can't precisely know what a pointer is and what is just some random int. So it's basically as if all objects are pinned in Go. I don't expect that to change. There are probably tons of Go code out there which will break in response to a change. I guess it will be pushed back to some mystical "2.0" release, along with Generics.