Hacker News new | ask | show | jobs
by ianlancetaylor 2787 days ago
Go could introduce a moving GC without requiring that map keys not be interface types. The simplest approach would be to use read barriers as we already use write barriers, and forward pointers during the moving phase of the GC. (Efficiency costs might prohibit that, but it could be done.)

Another approach would be to use two different map implementations, and use a less efficient one for older code that used an interface type as a map key.

It's an interesting example, though. You're right: if there is an old language feature that can not be supported by a newer runtime, then there needs to be some sort of shim to let the older code keep working. That necessity may prevent us from making certain sorts of language changes.