Skip to content
Search

LPython

lastmod 2023-08-01created 2023-08-011 edits

High performance typed Python compiler

LPython is a Python compiler that aims to provide optimized machine code by compiling type-annotated Python code. It offers several backends, including LLVM, C, C++, and WASM, which allow it to generate code into multiple target languages simultaneously. LPython’s main focus is on speed and performance, and it achieves this through various features and optimizations.

LPython is still in development (alpha stage) and may evolve further to encompass more extensive Python code and additional optimizations. LPython: Novel, Fast, Retargetable Python Compiler.

A new high-speed Python compiler

Features

  • A compiler that compiles type-annotated Python code into optimized code
  • Supports multiple backends such as machine code (LLVM), C, C++, and WASM
  • Machine Independent code optimization
  • Besides AoT (Ahead-of-Time) compilation, supports JIT (Just-In-Time) compilation by adding the @lpython decorator
  • Provides interoperability with CPython, so existing libraries and tools such as NumPy/TensorFlow/PyTorch/Matplotlib can be used as is
  • Running various algorithm benchmarks with builds using optimization flags showed competitive execution times
  • Still an alpha version, so there may be bugs
  • Open source (BSD license)

See also

Favorite site

author Zer0 sitemap