Join Nostr
2026-06-07 11:14:57 UTC

Owen Lynch on Nostr: I really feel like generational garbage collection is underappreciated, and not ...

I really feel like generational garbage collection is underappreciated, and not enough part of people's mental models when they compare GC languages to manual/Rust-style memory languages.

In a GC language, "heap objects" are *much cheaper* than "heap objects" in a language with manual memory management, because they are first allocated on what is essentially a bump allocator, and then if they survive long enough, are allocated as part of a *bulk* allocation.

Casey Muratori talks about "n+1 programming" which is when you shift from thinking about individual objects in your program to collections of objects. A well-tuned runtime system for a GC language is *precisely* this; it handles memory management in batch-mode. https://www.youtube.com/watch?v=xt1KNDmOYqA

In order to recover the performance of a GC language doing tree manipulation in a manually managed language, you have to completely rearchitect your code to think in batches, use custom allocators, etc. Which is possible, it just means that the idea of "writing functional-style code in Rust" is a lie. You have to work at a fundamentally lower level of abstraction.

A runtime system is *not* just some cope that managed languages need in order to run, it's a tool that you actually may have to reimplement when you don't have it.