4 ms·
Inko (https://inko-lang.org/ https://inko-lang.org/) uses this approach for its bytecode interpreter. I can't speak about how well it performs compared to an AS
by YorickPeterse 8y ago
Inko (https://inko-lang.org/ https://inko-lang.org/) uses this approach for its bytecode interpreter. I can't speak about how well it performs compared to an AST interpreter since I never wrote one for Inko, but generally bytecode interpreters should be faster. I also think bytecode interpreters would be easier to optimise, as you're no longer directly tied to the AST of the input language.
If you're curious, you can find Inko's interpreter loop here: https://gitlab.com/inko-lang/inko/blob/master/vm/src/vm/machine.rs#L294 https://gitlab.com/inko-lang/inko/blob/master/vm/src/vm/mach...
- RReverser 8y ago> as you're no longer directly tied to the AST of the input language This is the case with closure-based approach too, and indeed was one of the main motivations to switch away from AST interpretation.