News for hackers. Stuff that matters.
Re:Treadmill garbage collector by H. Baker by gumby on Monday July 25, 2022 @11:43PM (#32234006)
> In fact, some of the Lisp Machines had garbage collection implemented in hardware and allocated everything including stack frames and binding environments in the heap.

I wrote a lot of code for CADR, Symbolics and D-Machine Lispms and I’m not aware of any of them having hardware or microcode GC. That would be crazy anyway. Tagging and other support sure, but you could say that the x86 has hardware support through its pager too.

As for stack frames on the heap, think of how important function calling is, and the impact of allocation, cache, etc of such an approach. They all used PDLs like any other machines.

Now InterLisp-D did spaghetti the stack when you made a closure, at least for some time. I know this because I triggered it with a pathological case of making thousands of closures, bringing any machine to its knees. But a spaghetti stack is a different thing from allocating frames from the heap.

Re:Treadmill garbage collector by H. Baker by oecumena on Monday July 25, 2022 @11:49PM (#32234038)
The Scheme-79 chip (https://dspace.mit.edu/handle/1721.1/6334) was doing GC in microcode. According to Steel & Sussman it typically spent 80% of time collecting. :-) RMS invented "phantom stacks" to reduce the amount of garbage due to closures, not sure this was ever implemented anywhere.
Re:Treadmill garbage collector by H. Baker by gumby on Tuesday July 26, 2022 @12:47AM (#32234343)
I forgot about that chip.

yeah, I don’t think anyone looked at the phantom stack idea. Perhaps interlisp should have.

Re:Treadmill garbage collector by H. Baker by kragen on Tuesday July 26, 2022 @09:25AM (#32237950)
Generational GC might make heap-allocating your activation records a viable option, even if you're not satisfied with CPython levels of performance. I mean in a sense that's what Chicken does, right?
Re:Treadmill garbage collector by H. Baker by fanf2 on Tuesday July 26, 2022 @10:42AM (#32238968)
That is the argument made by Andrew Appel’s paper “garbage collection can be faster than stack allocation” https://www.cs.princeton.edu/~appel/papers/45.pdf and it’s the compilation strategy used by SML/NJ as set out in Appel’s book “compiling with continuations”
Re:Treadmill garbage collector by H. Baker by kragen on Tuesday July 26, 2022 @01:57PM (#32241528)
Well, I know, but I think he turned out to be wrong in that case. Fast enough, maybe.
Re:Treadmill garbage collector by H. Baker by gumby on Tuesday July 26, 2022 @05:33PM (#32244358)
It's pretty hard to beat the pushj/popj approach, except that you have to lock out the GC before returning (as it may be scanning the activation records to find roots).
Re:Treadmill garbage collector by H. Baker by kragen on Tuesday July 26, 2022 @08:23PM (#32245643)
Yeah, whatever Appel thinks, the stack is always faster. But sometimes the heap penalty is affordable. Before generational GC it was ridiculous.
Re:Treadmill garbage collector by H. Baker by gnufx on Tuesday July 26, 2022 @04:02PM (#32243231)
For microcoded GC, also see https://en.wikipedia.org/wiki/Flex_machine