LPython: Novel, Fast, Retargetable Python Compiler
summary
LPython compiles a typed subset of Python to lean native binaries (example 16 KB) using a C++ compiler that parses to an ASR (abstract semantic representation) of ~300 nodes, runs Jupyter and WebAssembly demos successfully, and in examples beats CPython import+run times and even an optimized C++ implementation. Back ends include LLVM, a direct wasm emitter, and OpenMP for parallel loops; SymPy support uses a SymEngine-backed SymPy subset. Compiler builds in ~30 s locally, is alpha-stage but retargetable and supports LFortran and LC front ends.
AI-written summary · about
chapters (17)
- 0:00Introduction to LPython
- 1:49Motivation for LPython
- 3:39Compiler architecture overview
- 4:22Simple Python compilation demo
- 7:11SymPy integration and error handling
- 10:21Jupyter notebook support
- 11:26WebAssembly compilation demo
- 12:49Fortran frontend and ASR internals
- 15:35LLVM and web assembly backends
- 16:41Compiler transparency and debugging
- 17:25Python-C interoperability
- 18:50Performance benchmarks
- 19:53Frontend compatibility and goals
- 21:16ASR design and benefits
- 22:22Compiler speed and development
- 23:24Project roadmap and conclusions
- 24:06Q&A session
