News for hackers. Stuff that matters.
Re:Garbage Collection Is Useful by keith_analog on Sunday November 16, 2025 @01:11PM (#45947104)
My favorite quote from Alan Perlis: “Symmetry is a complexity-reducing concept (co-routines include subroutines); seek it everywhere.”
Re:Garbage Collection Is Useful by summa_tech on Sunday November 16, 2025 @02:35PM (#45947739)
Unfortunately, the symmetry provided by higher levels of your software stack is not always reflected by the lower levels. This causes your symmetry to be created as an abstraction. (Subroutines are more efficient to implement than co-routines on real hardware.) Abstractions are leaky and this, in turn, causes the superficial symmetry to merely mask the underlying asymmetry.

If done exceptionally well, the only visible evidence of the leak will be substantial performance disparities between seemingly symmetric features (well done! this is unusual).

If done with the normal level of software design quality, the evidence will show up as quirky behavior, imperfect symmetry, "well this one always works but the other one is not reentrant", etc.

Re:Garbage Collection Is Useful by artemonster on Sunday November 16, 2025 @04:52PM (#45948751)
Yes! Subroutine call is a) allocation of activation record b) switching context c) returning that combines de-alloc and switch. while coroutines have all of these concepts separated. Why not start with a powerful and general concept and optimize for that one?
Re:Garbage Collection Is Useful by aw1621107 on Sunday November 16, 2025 @04:56PM (#45948786)
> Why not start with a powerful and general concept and optimize for that one?

As with basically everything, there are tradeoffs involved. Sometimes restrictions can be helpful for keeping things understandable, which can in turn make optimizations easier to implement. As a rather hamfisted example: completely unrestricted goto. Very general, debatably powerful, but relatively easy to use in a way that makes comprehension difficult. That same generality can also make it difficult to verify that optimizations don't change observable program semantics compared to something more restricted.

Re:Garbage Collection Is Useful by cryptonector on Monday November 17, 2025 @04:17PM (#45958426)
Because you can allocate the activation record on the heap, provide a way to reify continuations, and presto! now you have call/cc (and trivially implemented, no less)!

Price paid: a) you need a GC (ok, whatever, sure, you have one), b) well, the performance hit of having to GC activation records (you don't care; others do), c) whoops, thread-safety got much harder and maybe you can't even have threads (imagine two threads executing in the same activation record at the same time!).

That's a very very steep price.

Re:Garbage Collection Is Useful by veunes on Monday November 17, 2025 @04:59AM (#45952251)
It's amazing how often symmetry shows up as both a design aesthetic and a practical tool for managing complexity