Deegen: A Meta-compiler Approach for High Performance VMs at Low Engineering Cost
Speaker: Haoran Xu, PhD Student, Stanford University
Date: July 19, 2023
Building a high-performance VM for a dynamic language has traditionally required a huge amount of time, money, and expertise. To reduce the high engineering cost, we present Deegen, a meta-compiler that generates a high-performance VM automatically from a semantical description of the bytecodes. Currently, Deegen is capable of automatically generating an optimized interpreter and baseline JIT compiler. This allows the user get a high-performance VM for their own language at an engineering cost similar to writing an interpreter. To demonstrate Deegen's capability in the real world, we implemented LuaJIT Remake (LJR), a standard-compliant VM for Lua 5.1. Across a variety of benchmarks, we demonstrated that LJR's interpreter significantly outperforms LuaJIT's interpreter, and LJR's baseline JIT generates high-quality code with a negligible compilation cost.