Optimizing and Evaluating Transient Gradual Typing
summary
Gradual typing for Python via Reticulated Python inserts many lightweight runtime checks and shows up to a 6× slowdown on CPython as programs go from dynamic to static. A static analysis implements type inference that solves subtyping and new check constraints to delete redundant checks; applied to 10 benchmarks (random samples across typing lattices) it removes most overhead. Running the optimized output on a PyPy tracing JIT yields average overhead under 1%, showing the technique is effective.
AI-written summary · about
chapters (14)
- 0:00Intro
- 0:39Gradual typing combines static and dynamic typing soundly
- 3:30Transient gradual typing pervasive lightweight checks
- 5:20Reticulated Python: Gradual Typing for Python
- 8:16Experimental methodology
- 10:20Checks exist in static code
- 11:19Generate constraints
- 13:24Solve constraints
- 14:57Check removal
- 17:24Reticulated Python on a tracing JIT
- 17:59Performance across the lattice with PyPy
- 18:52PyPy performance across benchmark lattices
- 20:24Performance summary
- 21:30Conclusions
