An Executable Semantics for Faster Development of Optimizing Python Compilers
summary
An executable semantics encodes Python’s lookup, boxing/unboxing and calls as Python-with-primitives (uses class_get_ATR and an int_to_host/int_from_host pair) so compilers can parse and reuse it; a partial evaluator named semPy partial evaluator applies three transforms—aggressive inlining, branch-resolution with a type context, and redundant boxing elimination—to emit fast behaviors; a prototype compiler Zipi prototype uses those behaviors and shows benchmarks faster than CPython and sometimes competitive with PyPy on arithmetic-heavy workloads.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:26Python semantics overview
- 3:54Method lookups and operations
- 7:24Reusable executable semantics
- 10:12Primitive operations and types
- 12:00Performance issues and partial evaluation
- 15:52Senpai and behavior generation
- 18:24Integrating behaviors into Zippy
- 19:29Performance comparison
- 20:13Conclusion and future work
- 22:03Q&A
related talks
17mInside a PyPy JIT: is that even legal?
41mHow to write a JIT compiler in 30 minutes
27mPython: From Source to Execution
24mThe AST and Me
51mImplementing C++ Semantics in Python
21mHiPy: Extracting High-Level Semantics From Python Code For Data Processing
55mMaking CPython Fast Using Trace-based Optimisations
33mSPy (Static Python) lang: fast as C, Pythonic as Python
