Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
u/ndmitchell has been working on a Starlark interpreter. He wrote up a blog post with some thoughts about different interpreter styles. He found that in his case using fixed sized instructions was about the same as byte-encoded ones, but compiling the AST to closures was also about the same performance as well, and doesn't need an AST->bytecode compiler.
I also gave a talk about writing an interpreter, which goes into a big more depth on interpreter styles: https://ndmitchell.com/#interpreter_23_feb_2021 (slides at https://ndmitchell.com/downloads/slides-cheaply_writing_a_fast_interpreter-23_feb_2021.pdf, video at https://www.youtube.com/watch?v=V8dnIw3amLA&list=PLFTr8ChfQg9t9quFJNSoRwVHQhLFfTYnV, code at https://github.com/ndmitchell/interpret ). The conclusion was a compact bytecode was basically the same speed.