|
|
|
|
|
by NobleExpress
1193 days ago
|
|
C# has interior pointers as well and it is a language with a precise, moving garbage collector. The deal with Go is that is has a concurrent mark-sweep collector, so it is non-moving. Given the non-moving collector, it is significantly easier to reason with than a moving collector. Hence, you would have a lot of unstated assumptions (about whether the collector moves objects or not) baked into the runtime that would need to be fixed. You probably can't use a moving collector in Go like G1 or ZGC or LXR without non-trivial refactoring. |
|
It makes Java's GCs quite Java-specific in practice because there aren't that languages that even moderately widely used which are both statically typed (to the degree that it's possible to tell pointers apart before generating code) and restrict pointers to point to the start of the object.