News for hackers. Stuff that matters.
Re:For Better Computing, Liberate CPUs from Garbage Collection by dleslie on Thursday May 09, 2019 @11:47AM (#19869295)
If the lifetime can be expressed with a state machine then it needn't be garbage collected so long as the language is sufficiently expressive.

Reference counting isn't garbage collection, as most people consider it. There is no need to sweep or otherwise traverse memory to discover objects that are not referenced.

Claiming that ref counting is gc is a bit like claiming malloc/free is gc.

Re:For Better Computing, Liberate CPUs from Garbage Collection by norswap on Thursday May 09, 2019 @12:00PM (#19869409)
I've always seen automatic reference counting classified as GC.

e.g. https://users.cecs.anu.edu.au/~steveb/pubs/papers/rc-ismm-20...

> Reference counting and tracing are the two fundamental approaches that have underpinned garbage collection since 1960.

https://www.cs.virginia.edu/~cs415/reading/bacon-garbage.pdf

> Tracing and reference counting are uniformly viewed as being fundamentally different approaches to garbage collection that possess very distinct performance properties.

This last one is great if you want to understand GC tradeoffs btw, highly recommend it.

---

And as the first paper implies, refcounting is often slower (because it trashes caches). The issue is having to propagate the diminution of refcounts amongst a graph of references. This also creates de facto "pauses", much like tracing GC (although arguably more predictable!).

And this "propagation of diminished refcount" is very much a memory traversal — (probably) smaller in scope than (non-incremental) tracing, but also much less local.

Re:For Better Computing, Liberate CPUs from Garbage Collection by dleslie on Thursday May 09, 2019 @12:04PM (#19869447)
Interesting! I'll be reading that today.
Re:For Better Computing, Liberate CPUs from Garbage Collection by nickpsecurity on Thursday May 09, 2019 @01:47PM (#19870428)
"If the lifetime can be expressed with a state machine then it needn't be garbage collected so long as the language is sufficiently expressive."

One programmer here told me he does that in Ada and/or SPARK Ada using enumerated types encoding states. Now there's two of you. Most stuff I see like this are linear/affine/dependent types or separation logic. I rarely see people talking about simple solutions like this. Do you have any links that go in-depth on it with examples? It would be good to have something to pass along to people interested in this.