garbage collection First from wiki https://en.wikipedia.org/wiki/Garbage_collection_(computer_science) then classic papers 1) https://arxiv.org/pdf/1505.00017.pdf Comparative Analysis of Classic Garbage-Collection Algorithms for a Lisp-like Language Tyler Hannan, Chester Holtz, Jonathan Liao (2015) 2) https://courses.cs.washington.edu/courses/cse590p/05au/p50-bacon.pdf A Unified Theory of Garbage Collection David F. Bacon, Perry Cheng, V.T. Rajan (2004) discussion https://news.ycombinator.com/item?id=14823054 3) super classic https://dl.acm.org/doi/pdf/10.1145/1317203.1317205 Overview of garbage collection in symbolic computing by TJ McEntee ยท 1987 You should try to implement it ! The base code is here (no garbage collection). You can add in. Base language https://www.cp.eng.chula.ac.th/%7Eprabhas/project/recursive-programming/rec-programming.htm