rulox
rulox copied to clipboard
Treewalk interpreter should have a GC
jlox
gets away with not implementing a GC because it relies on the one from the JVM.
We use ref-counted values which give us almost the behaviour we want except from when there are cycles in the dependency graph. In such cases we're going to leak memory :(
The bytecode-VM implementation will have a GC so it might be a good idea to make it general enough so that it can be ported back to the treewalk interpreter.