2 ms·
He makes many good points in his criticism but I'm still wondering what language one's supposed to use if not C. My lisp has a conservative mark-and-sweep garb
by matheusmoreira 1y ago
He makes many good points in his criticism but I'm still wondering what language one's supposed to use if not C.
My lisp has a conservative mark-and-sweep garbage collector. The mark phase spills all registers and then walks the entire stack looking for pointers to lisp objects. I managed to implement the stack walking through some convoluted pointer nonsense but even C could not express the notion of spilling registers, I had to write assembly code for each architecture.
I have no idea how such a garbage collector would be implemented in Rust or Zig.
- int_19h 1y agoThe same exact way you did it in C - by relying on implementation-specific features such as assembly.