- Lexing
- Parsing
- Compiling
- Interpreting (+GC)
The lexer is handwritten and implemented as an Iterator. Lexing errors are passed on using
Error
tokens. The lexer already allocates identifiers and string literals into the GC.
The parser is handwritten using recursive descent. It calls the next
method on the lexer to get the next token,
but the iterator could be any Iterator and doesn't have to be a lexer.
The AST is allocated using a bump-allocator with the lifetime 'ast
.
The compiler takes the AST and compiles it down to bytecode. The full instruction set my change and can be found in the code.
The bytecode is allocated using a bump-allocator with the lifetime 'bc
The VM executes the bytecode. It uses the GC for its allocations.
The garbage-collector is work-in-progress.