Zef outpaces CPython with optimized AST walking
Filip Pizlo’s Zef language demonstrates that highly optimized AST-walking interpreters can outperform CPython and QuickJS. By applying 21 distinct optimizations, Zef achieves performance competitive with Lua without the complexity of a JIT or bytecode.
Zef proves that the death of AST walking was premature; modern hardware favors simple, cache-friendly implementations over complex bytecode VMs for many workloads.
- –Inline caching and watchpoints provide massive speedups by minimizing property lookups
- –Nan-tagging and specialized stack-based argument passing reduce heap pressure and allocation overhead
- –The project serves as a masterclass in language implementation for engineers who find JITs too daunting
- –By explicitly forbidding "monkey patching," Zef enables optimizations that most dynamic languages leave on the table
- –Performance results against Lua 5.4 suggest that "slow" languages are often victims of architecture, not just their dynamic nature
DISCOVERED
45d ago
2026-04-21
PUBLISHED
45d ago
2026-04-21
RELEVANCE
AUTHOR
pizlonator