Interpreters
Bytecode dispatch, VM architecture, and simple JIT guidance for implementing language runtimes in C and C++.
- CCM score
- 62 of 100
- skills.sh installs
- 689
- GitHub stars
- 303
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers stack-based versus register-based VM design, dispatch loop strategies, and value representation such as tagged pointers and NaN boxing
- Includes switch dispatch, computed goto with a GCC/Clang fallback, inline caching, and an mmap/mprotect x86-64 JIT example
- Notes performance tips such as profiling dispatch overhead, specialised handlers, and trace recording as used by LuaJIT-style tracing JITs
- Designed for developers building scripting language runtimes who need dispatch and JIT trade-off guidance
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill interpreters -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Interpreters and Bytecode VMs
Purpose
Guide agents through implementing efficient bytecode interpreters and simple JITs in C/C++: dispatch strategies, VM architecture choices, and performance patterns.
Triggers
- "How do I implement a fast bytecode dispatch loop?"
- "What is the difference between switch dispatch and computed goto?"
- "How do I implement a register-based vs stack-based VM?"
- "How do I add basic JIT compilation to my interpreter?"
- "Why is my interpreter slow?"
Workflow
1. VM architecture choice
| Style | Description | Examples |
|---|---|---|
| Stack-based | Operands on a value stack; compact bytecode | JVM, CPython, WebAssembly |
| Register-based | Operands in virtual registers; fewer instructions | Lua 5+, Dalvik |
| Direct threading | Each "instruction" is a function call | Some Forth implementations |
| Continuation-passing | Interpreter functions return continuations | Academic |
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- First seen
- Jun 3, 2026
Questions
What does the interpreters skill help me build?
It guides agents through implementing efficient bytecode interpreters and simple JITs in C and C++, covering dispatch strategies, VM architecture choices and performance patterns. It is aimed at implementing language runtimes and scripting language runtimes. The skill also covers tracing JITs and understanding performance trade-offs in interpreter design.
How do I install the interpreters skill?
Run npx -y skills add mohitmishra786/low-level-dev-skills --skill interpreters -y in your project. This adds the interpreters skill to your agent setup. The agent can then guide dispatch loop design, VM architecture and simple mmap-based JIT work.
What is the difference between switch dispatch and computed goto in this skill?
The skill describes switch dispatch as the simplest baseline, where one indirect branch is shared across all opcodes and can mispredict heavily. Computed goto, a GCC and Clang extension, gives each opcode its own indirect branch so the CPU can predict better. It advises guarding computed goto with a compiler check and falling back to switch on other compilers.
Does the interpreters skill cover JIT compilation?
Yes, it shows how to add a simple JIT on x86-64 by allocating executable memory with mmap, writing machine code bytes and calling them. It also notes that macOS Apple Silicon needs pthread_jit_write_protect_np or the MAP_JIT flag. The skill mentions trace JITs, the LuaJIT approach, as a way to compile hot traces instead of full functions.
How does the interpreters skill handle value representation and inline caching?
It covers tagged pointers, which store a type tag in the low bits of a pointer, and NaN boxing, which stores non-double values in NaN bit patterns. For method dispatch it describes inline caching, which caches the last observed receiver type at each call site, and polymorphic inline caching that keeps up to about four type and method pairs. These patterns are meant to keep hot paths fast.
More from mohitmishra786/low-level-dev-skills
All 54- Cargo Workflows686
- Meson685
- Rust Debugging676
- Cpp Modules669
- Hardware Counters666
- Debug Optimized Builds652
- Rustc Basics649
- Cpp Templates648
- Rust Cross642
- Wasm Emscripten628
- Zig Debugging617
- Zig Build System616
- Wasm Wasmtime599
- Zig Cross598
- Zig Cinterop586
- Cmake2K
- Static Analysis1.4K
- Gdb1.3K
- Llvm1K
- Sanitizers1K
- Core Dumps948
- Assembly X86947
- Linux Perf916
- Clang904
Similar to Interpreters
assembly-armmohitmishra786/low-level-dev-skills800 installsReference for reading and writing AArch64 and ARM Thumb assembly, with AAPCS64 calling-convention and inline-asm guidance.
zig-debuggingmohitmishra786/low-level-dev-skills617 installsPractical debugging guide for Zig programs covering GDB, LLDB, panic and error-trace reading, and VS Code setup.
rev-unicorn-debugp4nda0s/reverse-skills1.9K installsDebugger and emulator for individual code fragments or functions using the Unicorn engine, with environment simulation.
anti-debugging-techniquesyaklang/hack-skills4.2K installsAnti-debugging playbook covering ptrace, PEB flags, timing checks, and signal or exception tricks on Linux and Windows, with bypass methods.
vm-and-bytecode-reverseyaklang/hack-skills4.3K installsPlaybook for reversing custom virtual machines and bytecode interpreters, covering dispatcher identification, opcode mapping, and maze challenges.
python-performance-optimizationwshobson/agents38.8K installsGuide to profiling and optimizing Python code with cProfile, memory profilers, and performance best practices.