A Bytecode Virtual Machine (VM) written in C
. To avoid the overhead of traversing an AST, a bytecode representation is introduced. The scanner
outputs tokens which are later given as input to the compiler
to generate bytecode - similar to assembly code although magnitudes simpler with a limited set of instructions. The generated bytecode is later given as input to the VM
that then executes and displays the output.
- Chapter 14 - Chunks of Bytecode
- Chapter 15 - A Virtual Machine
- Chapter 16 - Scanning on Demand
- Chapter 17 - Compiling Expressions
- Chapter 18 - Types of Values
All solutions can be found in the ./challenges
folder
- (Chp15/#4) - Look into ways to more accurately measure performance. How is the memory/CPU affected?
- (Chp16/#1) - Understand how Wren and other languages interpret string interpolations. Maybe add support for it later on.