-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible optimization: tree of closures #32
Comments
@cosmos72 thank you for the idea! Why is |
Because it's a too high-level language:
So the core loop of any bytecode interpreter will either:
Anyway, if you are start optimizing |
Interesting, thanks. However, for the (short-running) toy problems I've looked at so far |
Directly interpreting the abstract syntax tree is slow, as you point out.
And Go is not really well-suited to write bytecode interpreters.
An approach that works quite well in Go, as I found out for my Go interpreter gomacro, is to convert the abstract syntax tree to a tree of closures (lambdas) and then execute it.
The text was updated successfully, but these errors were encountered: