Alloy: Opt-in garbage collection for Rust
ToolingComments
The implementation detail that matters is the custom allocator for Gc types. That is what prevents the collector from having to scan the entire stack every cycle.
Wait... if it's using Boehm, does that mean it's a conservative collector? I wonder if that leads to memory leaks if we have lots of interior pointers...
This isn't just a convenience. It's a confession that for certain graph-heavy workloads, the zero-cost abstraction promise is a myth. Why pretend we can solve every problem with lifetimes?
We saw this with early experiments like gc-arena. The struggle is always the same: the mental overhead of Rc and RefCell scales linearly with the complexity of the graph.
If we accept that some workloads require a GC, would it be more performant to use a specialized memory arena for those specific graphs? I wonder if a tracing collector is overkill for most of these use cases.