Work in progress implementing the lox bytecode compiler and virtual machine.
Main differences currently from the reference implementation is the Objects are all separate values so the types can be checked and there are no global variables.
The messiest part is probably the GC which should be refactored.
For computationally intensive programs it will be really slow without the release flag.
cargo build
cargo run -- <file> to run a file, otherwise cargo run will start it a REPL.
- 14. Chunks of Bytecode
- 15. A Virtual Machine
- 16. Scanning on Demand
- 17. Compiling Expressions
- 18. Types of Values
- 19. Strings
- 20.
Hash Tablesusingstd::collections::HashMapinstead - 21. Global Variables
- 22. Local Variables
- 23. Jumping Back and Forth
- 24. Calls and Functions
- 25. Closures
- 26. Garbage Collection
- 27. Classes and Instances
- 28. Methods and Initializers
- 29. Superclasses
- 30. Optimization