Hacker News new | ask | show | jobs
by KMag 8 days ago
Though, if your compiler generates stack maps to facilitate pointer moving at runtime, one could have a system that used a bump allocator and compaction of a GC without running the trace portion of GC. It could also use a per-thread list of freed objects to batch up the freeing. Then we get into a semantic argument as to whether compile-time GC is really GC.
1 comments

I'm not sure what you mean exactly because there can be pointers in the heap (although work on compile-time GC based on arena-like "regions" has been around for decades), but there are plenty more optimisations that generational moving collectors can do, and we're working on them. But no matter what you do, once you can move objects you need an FFI layer between the "movable stack" and the hardware/OS, which is not something you want in a low-level language (because once you need an FFI layer, you might as well use a more high level language for the parts above it).