4 ms·
Interested to see how you handle the nested compilers in the bytecode compiler once you hit functions. I still haven't gotten my rust-lox compiler handling this
by n8ta 5y ago
Interested to see how you handle the nested compilers in the bytecode compiler once you hit functions. I still haven't gotten my rust-lox compiler handling this in an elegant way.
- chrisseaton 5y agoWhat's the issue with nested compilers in Lox?
- n8ta 5y agoThe implementation recommended in the book involves allocating a new compiler struct for each function with a pointer to the enclosing compiler. I found this very awkward in rust. Additionally the nested compiler needs to share the lexer (which is lazy thus mutable).