Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

there was an article a few month ago here describing how refcounts and liveness reachability were the two dual basic GC and most simple GC are a combination of the two techniques.


Was it this one? https://www.cs.virginia.edu/~cs415/reading/bacon-garbage.pdf

Tracing and reference counting are two GC approaches that the paper shows are dual in some interesting ways and can have similar characteristic -- when both are sophisticated enough.


yes, thank you.


All programming languages are "duals" of each other in the Turing complete sense, though that doesn't tell you much beyond: they're programming languages.

So here's how reference counting and garbage collection are duals: they both manage the memory lifetimes for objects not on the stack. If that blows your mind, you also might enjoy the above referenced paper and the meme that reference counting is "GC done badly".


I was referring specifically to the paper https://www.cs.virginia.edu/~cs415/reading/bacon-garbage.pdf (found by pron in another comment).

Where duality is in term of seeing reference counting as a form of negative-tracing. the paper also analyzes various techniques and claim that they mostly just mixes the two approaches.

also if I can be facetious:

> So here's how reference counting and garbage collection are duals: they both manage the memory lifetimes for objects not on the stack.

that would be an equivalence, not a duality.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: