- Stack based vm
- Emulates the way computers are architected
- Implement a stack
- Include it in the VM
- Implement debug functionality for the VM stack
- Add push to the constant case instruction
- And pop while returning
- Add arithematic operators to the vm
- Another possible imlplementation is register based vm
- They are much more efficient since we can directly load and store values instead of repeatedly pushing and popping
- Here we start implementing the lexical part of the compiler
- We cahnge the siganture of interpret function to acept strings
- Start implementation of scanner
- has fields start, current and line
- Here we scan a token only when the compiler needs one
- Implement token type to contain the necessary values
- Add enum to hold possible tokens
- And make the scanner return the appropriate token