News

Rust Developer argues GC Addition Would Undermine Lifetimes and Memory Safety

A community debate over adding GC to Rust intensified after a 2025 OOPSLA paper proposed "Alloy," with skeptics arguing GC would hollow out the very lifetimes that make Rust's safety guarantees meaningful.

Nina Kowalski3 min read
Published
Listen to this article0:00 min
Share this article:
Rust Developer argues GC Addition Would Undermine Lifetimes and Memory Safety
AI-generated illustration

The Rust community's long-simmering argument over garbage collection broke into open debate after Jacob Hughes and Laurence Tratt published "Garbage Collection for Rust: The Finalizer Frontier" at OOPSLA 2025. Their proposal, a GC layer called Alloy, lets existing Rust destructors double as GC finalizers, an elegant technical trick intended to make Alloy feel idiomatic. Skeptics were not convinced.

The core objection is not performance, though that matters. It is architectural: lifetimes in Rust are not just a compiler enforcement mechanism, they are documentation. When a function signature carries explicit lifetime annotations, it tells every caller exactly how long borrows can live and which values share ownership. Add a GC that manages its own object graph outside the borrow checker, and that contract quietly dissolves. The community critique, echoed across the Hacker News thread on the paper and the broader Rust forums, is that a GC-backed reference type sidesteps the very discipline that prevents sharing accidents and memory leaks in the first place.

AI-generated illustration

The practical stakes are concrete. Rust's deterministic deallocation is why it outperforms Java and C# in high-concurrency workloads: no stop-the-world pauses, no GC pressure spikes at inopportune moments. Rust's ownership system determines object lifetimes at compile time through scope-based automatic memory management, providing predictable latency with no unexpected collection pauses interrupting program execution. Introduce a tracing collector, even an optional one, and a crate that silently pulls in Alloy can impose pause behavior on a latency-sensitive binary whose author never asked for it. The Hacker News discussion surfaced this precisely: one commenter warned that GC implementations "tend to impose a lot of requirements, which is why a garbage collector is usually tightly integrated into the language," not bolted onto the side.

Hughes and Tratt acknowledged the tension directly in the paper: finalizers implicitly extend the lifetime of a GCed value, including any stored references, meaning accessing a reference in a finalizer could undermine Rust's borrow checking rules. Their solution, forbidding `Gc<T>` from storing normal Rust references in finalizable types, is technically sound but narrows the design space considerably and reinforces the skeptic's point: you cannot have GC and full borrow-checker integration at the same time.

That said, the use cases motivating the push for GC are real. Game scripting engines, GUI frameworks, and WebAssembly runtimes all benefit from managed memory because their object graphs are genuinely cyclic and their lifetimes are genuinely dynamic. The lack of GC makes expressing data structures that require shared ownership awkward, inefficient, or both. Rust already has answers here: the `gc-arena` crate provides incremental collection scoped to an arena lifetime; `Rc` and `Arc` handle shared ownership for acyclic graphs; scoped threads from `std::thread::scope` contain cross-thread borrows without needing a collector at all. A January 9, 2026 Nova blog post titled "Garbage Collection is Contrarian" pushed the design space further by advocating contravariant lifetimes for GC handles, arguing they enable self-referential data structures with fewer constraints than the covariant model Alloy uses.

Even with GC, Rust learners still need to understand ownership, borrowing, and lifetimes. That finding, from a randomized study on GC-assisted Rust learning, cuts both ways: GC does not let you escape the borrow checker, but it does offer a lower-friction on-ramp for the subset of programs where ownership is genuinely hard to express statically. The deeper question the community is circling is whether optional GC would serve those use cases without fracturing the ecosystem into two incompatible dialects: one where lifetimes mean something, and one where they are advisory.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.
Get Rust Programming updates weekly.

The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News