Python

Flavors of Python

  • CPython: official engine for python language written in C
  • PyPy: written in subset of Python called RPython (Restricted Python)
    • supports Just In Time (JIT) Compilation to translate code into machine language dynamically
    • This makes it significantly faster than CPython
  • MicroPython: written in C
    • highly optimized and lightweight version
    • runs on micro-controllers and embedded systems
  • CircuitPython: based on MicroPython
    • education-friendly version
    • backed by Adafruit
  • GraalPy: written in Java using Truffle Framework
    • built on GraalVM ecosystem to embed python scripts
  • Legacy/Niche
    • Jython: (obsolete) written in Java
      • compiles Python code into Java bytecode
      • allows you to import and use Java native classes in python scripts
    • IronPython: (obsolete) written in C#
      • runs on .NET/CLR runtime
    • Brython: (niche) written in JS
      • compiles Python code into JavaScript

Python Integrations

  • Java
    • Py4J: used in Apache Spark
      • allows python code to access Java objects
    • GraalPy: flavor of Python
    • jnius: allows python code to access Java classes
      • used in Android Development
  • .NET/C#
    • PythonNET: seamless integration b/w Python and CLR
    • Python code can call C# or vice versa
  • C/C++
    • Used to write high performance libraries and code in Python
    • pybind11: bridges Python and C++
      • allows Python code to call C++
    • Cython: superset language of CPython
      • Python Syntax + C datatypes
      • compiles to C/C++ modules
    • ctypes: built-in Python library
      • allows you to call functions from compiled C libraries
  • JS/Wasm
    • Pyodide: compiles CPython runtime into Wasm
      • allows to run Python in Wasm
    • PyScript: framework built on top of Pyodide

Numerical Accelerators

  • Numba