removed broken links
|Deletions are marked like this.||Additions are marked like this.|
|Line 19:||Line 19:|
|* [[http://github.com/rocky/x-python/|x-python]] - The C Python Interpreter written in Python; useful for educational purposes. There is also bytecode debugger for it|
An "implementation" of Python should be taken to mean a program or environment which provides support for the execution of programs written in the Python language, as represented by the CPython reference implementation.
There have been and are several distinct software packages providing what we all recognize as Python, although some of those are more like distributions or variants of some existing implementation than a completely new implementation of the language.
These are implementations based on the CPython runtime core (the de-facto reference Python implementation), but with extended behaviour or features in some aspects.
CrossTwine Linker - a combination of CPython and an add-on library offering improved performance (currently proprietary)
Pyston - a fork of CPython, originally developed at Dropbox but now by independent developers, performance-focused including bytecode quickening and a lightweight JIT.
Cinder, a fork of CPython by Instagram, containing a number of optimizations like bytecode rewriting and a method-at-a-time JIT compiler.
Pyjion, a JIT extension for CPython that compiles Python code to CIL (.NET) and executes it on the CLR.
unladen-swallow - "an optimization branch of CPython, intended to be fully compatible and significantly faster", originally considered for merging with CPython subject to PEP 3146, but now unmaintained
wpython - a re-implementation of CPython using "wordcode" instead of bytecode
eGenix PyRun - Python runtime (CPython + std library) compressed into a single 3-4MB binary
x-python - The C Python Interpreter written in Python; useful for educational purposes. There is also bytecode debugger for it
Reduced Python Variants
These provide a subset of the full language + standard library, for use in embedded scenarios (see also the EmbeddedPython topic)
MicroPython - Python for microcontrollers (runs on the pyboard and the BBC Microbit)
Also look at the sections on Python compilers and extensions below, some of which would qualify as CPython variants.
These are re-implementations of the Python language that do not depend on (or necessarily interact with) the CPython runtime core. Many of them reuse (a large part of) the standard library implementation.
Note that most of these projects have not yet achieved language compliance. However, many of these have goals and features or run in certain environments that make them interesting in their own regard. The only implementations that are known to be compatible with a given version of the language are IronPython, Jython and PyPy.
The following implementations may be not comprehensive or even complete, but at the very least can be said to be working in that you can run typical programs with them already:
PyPy - Python in Python, includes a tracing JIT compiler
Jython - Python in Java for the Java platform
GraalPython - Python in Java, using the Graal just-in-time compiler and the Truffle interpreter implementation framework
Skybison - A C++ from scratch implementation of Python 3.8 using a moving GC, hidden classes and a template JIT.
CLPython - Python in Common Lisp
HotPy - a virtual machine for Python supporting bytecode optimisation and translation (to native code) using type information gathered at runtime
PyMite - Python for embedded devices
pyvm - a Python-related virtual machine and software suite providing a nearly self-contained "userspace" system
SNAPpy - "a subset of the Python language that has been optimized for use in low-power embedded devices" (apparently proprietary)
tinypy - a minimalist implementation of Python in 64K of code
The following implementations are apparent works in progress; they may not be able to run typical programs:
Berp - an implementation of Python 3 in Haskell, providing an interactive environment as well as a compiler
phpython - a Python interpreter written in PHP
https://web.archive.org/web/20041206021225if_/http://www.twistedmatrix.com/users/z3p/files/pyvm2.py - a CPython 2 bytecode interpreter written in Python 2, abandoned mentioned on the PyPy mailing list in 2003
These are typically part of CPython (or some other implementation) but change the implementation's behaviour:
Psyco - a just-in-time specialising compiler for CPython, abandoned, works only for CPython 2.6.
These compilers usually implement something close to Python, although some compilers may impose restrictions that alter the nature of the language:
Cython - a widely used optimising Python-to-C compiler, CPython extension module generator, and wrapper language for binding external libraries. Interacts with CPython runtime and supports embedding CPython in stand-alone binaries.
Nuitka - a Python-to-C++ compiler using libpython at runtime, attempting some compile-time and run-time optimisations. Interacts with CPython runtime.
MyPyC compiles fully typed Python code to a C extension, based on mypy.
2c-python - a static Python-to-C compiler, apparently translating CPython bytecode to C
Compyler - an attempt to "transliterate the bytecode into x86 assembly" (now abandoned)
GCC Python Front-End - an in-progress effort to compile Python code within the GCC infrastructure
Pyc - performs static analysis in order to compile Python programs, uses similar techniques to Shed Skin
Shed Skin - a Python-to-C++ compiler, restricted to an implicitly statically typed subset of the language for which it can automatically infer efficient types through whole-program analysis
unPython - a Python to C compiler using type annotations
VOC - A transpiler that converts Python bytecode into Java bytecode.
Pythran - ahead of time compiler for a subset of Python with a focus on scientific computing
Copperhead - purely functional data-parallel Python, compiles to multi-core and GPU backends
Parakeet - runtime compiler for a numerical subset of Python
Similar but Distinct Languages
These languages don't attempt to be directly compatible even with a subset of Python, choosing to provide their own set of features:
Alore - a compilable language with optional typing and Python/Ruby inspired syntax; an Alore-Python bridge is planned; development effort has been transferred to mypy (see below)
Converge - inspired by Python, Haskell, Icon and Smalltalk, provides macros which can be evaluated at compile-time
Delight - based on the D programming language
Genie - based on the same foundations (Gtk+, GNOME) as the Vala programming language, supposedly inspired by Boo
mypy - Python with optional static typing and some local type inference
Mython - an extensible variant of the Python programming language, apparently a front-end for CPython
Nim - statically typed, compiles to C, C++, and JS, features parameterised types, macros, and so on
Pythonect - a dataflow-oriented language adopting the basic Python expression syntax, implemented in Python and integrated with the Python environment
Roket Secured Language - an interpreter for a Python-like language for applications where "restricted Python" execution is desired
Serpentine - a language with Python-like syntax for the Dalvik virtual machine
Wirbel - a compilable language with similar restrictions to Shed Skin (statically typed names, lists cannot mix elements of different types), no longer actively developed as of 2011-07-21
Some Genie code samples indicating the differences between that language and other Python variants
(Fun) Python Preprocessors
There are even some tongue-in-cheek dialects of Python which you might find fun.
Python implementations and compilers have been the topic of various papers and theses. Those that have not apparently been developed further are listed here:
QGen : A Python to Qt/C++ translator - a simple translator described in a master's thesis from 2004
This page aims to replace one formerly maintained as "Cameron Laird's personal notes on varieties of Python implementation". Also of interest will be IntegratingPythonWithOtherLanguages, which, among other variants, mentions embeddings of Python in other languages.