I found a post I made here an year ago (Compiler for a minimal LISP dialect to run on the Java Virtual Machine) and got interested on this subject again. This time I decided to implement the instruction level myself instead of relying on the Java virtual machine like last time. An obstacle is that since I'm implementing the instruction level, if I decide to port a Lisp variant to this VM, I should also handle the compilation from the high level Lisp constructs to the low level instructions. As this is a fairly complicated task, it is not yet done.

The functions ending with _ correspond to the instructions that the VM should handle. The main function is there to show how a certain Lisp construct would be compiled down to a sequence of instructions.

The garbage collector is a simple copying collector. There are two heaps, and when the current heap in use is full, the referenced objects are copied to the other heap, and so on.

And it seems the original garbage collector was broken. I edited with the hopefully working patch.