News for hackers. Stuff that matters.
Re:Garbage Collection in a Large Lisp System (1984) [pdf] by sph on Tuesday August 22, 2023 @03:17AM (#37219641)
If you find the time to share links, it would be much appreciated. Thanks for the pointers (heh) anyway.
Re:Garbage Collection in a Large Lisp System (1984) [pdf] by chubot on Tuesday August 22, 2023 @01:32PM (#37226007)
Sure, most of the links are in the posts I wrote about it:

https://www.oilshell.org/blog/2022/10/garbage-collector.html

https://www.oilshell.org/blog/2023/01/garbage-collector.html

AFAIK, the Cheney algorithm is the only way to do copying/moving GC. It's tiny and elegant, and I took a picture of it for a contributor:

https://app.oilshell.org/picdir/resize?name=193n849__4477C23...

The GC handbook explanation was better than anything I found online, including in wikipedia.

But GC handbook is also not engineering-focused (see blog posts). It surprisingly difficult to write a GC -- I have new respect for this problem!

As mentioned, we ended up going to a non-moving collector, mainly because debugging is harder, it breaks tools, and it involves even more rooting. And rooting problem is hard, especially in C/C++.

The GCs in C++ like v8 and SpiderMonkey are a bit hard to read -- it is almost like a special dialect of C++. I found the plain C femtolisp and es shell easier to read. And some toy examples on Github, but many of them (even from engineers I know to be great) were VERY incomplete, and not designed in context.

Don't trust an example GC that hasn't been used in production! It probably has bugs or a bad API for rooting!

femtolisp is probably the closest thing to "small" and "used in production" that I found (since it's used to bootstrap Julia)