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=xt1KNDmOYqAIn 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.
Published at
2026-06-07 11:14:57 UTCEvent JSON
{
"id": "d65ba145df5a84d19e06b7b86f7b75d8216526683e16398aa83a7a734fd0a293",
"pubkey": "1b3764ee442ae1a63ff2f57c7df96d1955aa4f09737be752fa26bed4a9cf2621",
"created_at": 1780830897,
"kind": 1,
"tags": [
[
"proxy",
"https://mathstodon.xyz/@olynch/116708533689195957",
"web"
],
[
"proxy",
"https://mathstodon.xyz/users/olynch/statuses/116708533689195957",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mathstodon.xyz/users/olynch/statuses/116708533689195957",
"pink.momostr"
],
[
"-"
]
],
"content": "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.\n\nIn 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.\n\nCasey 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\n\nIn 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.\n\nA 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.",
"sig": "a770ab1cdfe60a5823e701dff23a4d6c7d879c1aac46b4f432a8585717392f004a16a2c42245e7f37859fd599c3747d64e633a86744a1e77e812f2a31a195547"
}