The lone lisp heap
6 points by veqq
6 points by veqq
The heap is literally just a big dumb flat array of values now. A black monolith. An absolute unit. Lone values simply index into this array. The array could be anywhere in memory, it doesn't matter where it is. The real pointers are simply calculated on the fly.
I think is similar to how memory was handled in classic Mac OS (and Windows). You got a handle, which was a pointer to a master pointer. The memory manager could reorganise the heap, updating the master pointer as needed. The downside as you had to dereference two pointers to get to the actual data.
The downside as you had to dereference two pointers to get to the actual data.
I was going to joke that as a CISC the 68000 probably had an indirect addressing mode that allowed you to double-dereference in one shot, but it turns out memory indirect addressing was one of the ill-advised super-CISC features added in the 68020.
It’s interesting to read this article that how lone lisp is implemented. I have also wrote some similar topics on Elisp that I think it’s worth sharing.