SPy (Static Python) lang: fast as C, Pythonic as Python
summary
Claims a new Python dialect, SPy, that uses a statically enforced type system plus partial evaluation and meta‑programming to resolve decorators metaclasses and lookups at compile time and produce C or WebAssembly code so runtime is “fast as C.” It implements three phases import/freeze/run, optional eager or lazy type errors, and generics that generate specialized implementations. A working prototype exists, compiles .spy files, and demos the optimizations end to end.
AI-written summary · about
chapters (12)
- 0:00SPy introduction and goals
- 4:16Why Python subsets fall short
- 8:51Python’s implicit static behavior
- 12:42SPy execution phases
- 16:14SPy partial evaluation example
- 18:24Closures and type checking
- 21:40Generics and static dispatch
- 25:39Dynamic dispatch and safety
- 26:24Low-level memory access
- 28:58SPy WebAssembly & JS interop
- 31:50Future compiler targets
- 32:13Q&A
related talks
46mSPy (Static Python) lang: fast as C, Pythonic as Python
59mMyths and fairy tales around Python performance
21mFrom PyPerf to py-spy - Everything You Need to Know About Python Profilers
23mRunning (snippets of) Python in the browser
01h 12mFurious & Fast Python 7: Writing Fast Python Code
25mHow two teams are working together to make Python better for all
01h 05mHigh-Performance Python: Faster Type Checking and Free Threaded Execution
23mInside CPython 3.11's new specializing, adaptive interpreter
