Lox bytecode compiler and interpreter written in Rust.
My implementation has a few QoL improvements over the vanilla language:
nil
->null
fun
->fn
var
->let
+=
,-=
,*=
, and/=
for operation and assignment%
for modulobreak
support insidefor
andwhile
loopsprint
as a built-in function instead of a statement
Some possible optimizations to implement once everything is up and running so I can measure them:
- Use tries for matching keywords (https://docs.rs/trie-match/latest/trie_match/)
- Sprinkle some pointer + unsafe magic around
- Use data structures that go more brrr (FxHash{Set, Map}, ArrayVec...)