Ask HN: How to Implementing Garbage Collection Algorithms
I have always been interested in garbage collection algorithms and language runtimes. And recently got my hands on "The Garbage Collection Handbook"[1].
My questions is, how can I go about implementing these algorithms :
- are there any student focused language VMs that anyone can recommend ?
- or any other recommendations on how to go about them?
[1] http://gchandbook.org/
2 comments
[ 3.6 ms ] story [ 14.6 ms ] threadSICP also has a chapter on GC w/implementation https://mitpress.mit.edu/sicp/full-text/sicp/book/node117.ht...
Universities have some lectures on this too and you can look up the algorithms they mention
https://suif.stanford.edu/~courses/cs243/lectures/l14.pdf Intro to GC
http://web.stanford.edu/class/cs243/lectures/L17-Advanced-GC... Advanced GC
Therefore firm knowledge of C is required. Then when you have that knowledge, you can build an object model. I suggest starting with just two simple types: array and integer objects.
Then you can implement simple memory management. The easiest is probably to begin with reference counting. After you have that, continue with mark and sweep, copying collection and more advanced techniques.