This is a solid deep dive into bytecode VMs and simple JITs for anyone implementing a scripting language or runtime in C/C++. It walks through the dispatch loop strategies (switch, computed goto, direct threading) with real code showing why computed goto beats switch for branch prediction, covers stack vs register VM architectures, and includes practical patterns like NaN boxing and inline caching. The simple JIT section with mmap is a good entry point before you jump into LLVM. Honestly, this is the guide I wish I had when I first tried to understand why Lua switched to a register VM or how LuaJIT gets so fast. It assumes you're comfortable with C pointers and low-level systems programming.
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill interpreters