Why hasn't anyone made a compiler for Python yet?

This page summarizes the projects mentioned and recommended in the original post on /r/C_Programming

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Nim

    Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).

  • The Nim language does this. High-level python-like syntax that compiles to C, C++, or JavaScript to execute. It's not exactly Python, but might suit your use case.

  • Numba

    NumPy aware dynamic Python compiler using LLVM

  • Having said that, some people are working on having a JIT compiler for a subset of Python with some success: https://numba.pydata.org/

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Nuitka

    Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.

  • Nuitka does that: compiles Python code to C code which still has dynamic dispatch and garbage collection, using libpython. It is faster than the Python interpreter, but obviously it's still far from the performance of more typical C code.

  • Crafting Interpreters

    Repository for the book "Crafting Interpreters"

  • For an example of doing all of these for dynamic language, check out Crafting Interpreters: https://github.com/munificent/craftinginterpreters

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts