neutron-language icon indicating copy to clipboard operation
neutron-language copied to clipboard

Interpreter written on top of an interpreter?

Open Demonstrandum opened this issue 5 years ago • 20 comments

This implementation will end up being quite slow, given that your writing this high level language in another interpreted high level language. Perhaps consider writing a bytecode compiler. You could compile your parse tree to Python bytecode and have it run on the Python VM. This is a good option because you're already writing it in Python so getting it to work should be easy, although Python bytecode is slightly non-standardised, so that's a con. Alternatively you could rewrite this AST traversing interpreter in a compiled language and give it a speed boost, or even do that and write a virtual machine and compile it to your own bytecode.

Demonstrandum avatar Jun 29 '19 05:06 Demonstrandum