Differences between revisions 75 and 76
Revision 75 as of 2012-06-22 12:59:08
Size: 9559
Editor: PaulBoddie
Comment: Added Roket Secured Language and pyvm2.py.
Revision 76 as of 2012-09-20 16:49:44
Size: 10134
Editor: PaulBoddie
Comment: wiki restore 2013-01-23
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from implementation
Line 6: Line 6:
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.
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|CPython]] reference implementation.
Line 10: Line 12:
Line 12: Line 15:
These are implementations based on the [[CPython]] runtime core (the de-facto reference Python implementation), but with extended behaviour or features in some aspects.
These are implementations based on the [[CPython|CPython]] runtime core (the de-facto reference Python implementation), but with extended behaviour or features in some aspects.
Line 16: Line 21:
 * [[http://code.google.com/p/unladen-swallow/|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|PEP 3146]], but now unmaintained  * [[http://code.google.com/p/unladen-swallow/|unladen-swallow]] - "an optimization branch of CPython, intended to be fully compatible and significantly faster", originally considered for merging with CPython subject to [[PEP:pep-3146|PEP 3146]], but now unmaintained
Line 18: Line 23:


Also look at the sections on Python compilers and extensions below, some of which would qualify as CPython variants.
Line 21: Line 30:
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.
Line 23: Line 31:
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. These are re-implementations of the Python language that do not depend on (or necessarily interact with) the [[CPython|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|IronPython]], [[Jython|Jython]] and [[PyPy|PyPy]].
Line 27: Line 39:
Line 29: Line 42:
 * [[CLPython]] - Python in Common Lisp
* [[CLPython|CLPython]] - Python in Common Lisp
Line 31: Line 45:
 * IronPython - Python in C# for the Common Language Runtime (CLR/.NET) and the [[http://fepy.sourceforge.net/|FePy]] project's IronPython Community Edition (IPCE)
 * [[Jython]] - Python in Java for the Java platform
 * [[http://pyjs.org/|pyjamas]] - a Python to !JavaScript compiler plus Web/GUI framework
 * PyMite - Python for embedded devices
 * PyPy - Python in Python, targeting several environments
 * [[IronPython|IronPython]] - Python in C# for the Common Language Runtime (CLR/.NET) and the [[http://fepy.sourceforge.net/|FePy]] project's [[IronPython|IronPython]] Community Edition (IPCE)
 * [[Jython|Jython]] - Python in Java for the Java platform
 * [[http://pyjs.org/|pyjamas]] - a Python to JavaScript compiler plus Web/GUI framework
 * [[PyMite|PyMite]] - Python for embedded devices
 * [[PyPy|PyPy]] - Python in Python, targeting several environments
Line 40: Line 54:
Line 41: Line 56:
Line 44: Line 60:
Line 45: Line 62:
 * [[http://code.google.com/p/pystachio/|Pystacho]] is, like Skulpt, Python in !JavaScript  * [[http://code.google.com/p/pystachio/|Pystacho]] is, like Skulpt, Python in JavaScript
Line 47: Line 64:
 * [[http://www.skulpt.org/|Skulpt]] - Python in !JavaScript  * [[http://www.skulpt.org/|Skulpt]] - Python in JavaScript
Line 49: Line 66:
Line 52: Line 70:
Line 54: Line 73:
 * [[http://psyco.sf.net|Psyco]] - a just-in-time specialising compiler for CPython
* [[http://psyco.sf.net/|Psyco]] - a just-in-time specialising compiler for CPython
Line 58: Line 79:
Line 59: Line 81:
Line 62: Line 85:
 * [[http://cython.org/|Cython]] - an 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.  * [[http://cython.org/|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.
Line 69: Line 92:
Line 70: Line 94:
Line 73: Line 98:
 * [[http://www.alorelang.org/|Alore]] - a compilable language with optional typing and Python/Ruby inspired syntax; an Alore-Python bridge is planned
* [[http://www.alorelang.org/|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)
Line 75: Line 101:
 * [[Cobra]]  * [[Cobra|Cobra]]
Line 79: Line 105:
 * [[http://www.mypy-lang.org/|mypy]] - Python with optional static typing and some local type inference
Line 87: Line 114:
Line 88: Line 116:
Line 92: Line 121:
Line 94: Line 124:
 * EmbeddedPython
 * PythonDistributions

* [[EmbeddedPython|EmbeddedPython]]
 * [[PythonDistributions|PythonDistributions]]
Line 99: Line 131:
Line 101: Line 134:
  * [[http://www.staringispolite.com/likepython/|Like, Python]]
  * [[http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html|LOLPython]]

* [[http://www.staringispolite.com/likepython/|Like, Python]]
 * [[http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html|LOLPython]]
Line 106: Line 141:
Line 107: Line 143:
Line 111: Line 148:
Line 113: Line 151:
This page aims to replace one formerly maintained as
"[[http://phaseit.net/claird/comp.lang.python/python_varieties.html|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.



This page aims to replace one formerly maintained as "[[http://phaseit.net/claird/comp.lang.python/python_varieties.html|Cameron Laird's personal notes on varieties of Python implementation]]". Also of interest will be [[IntegratingPythonWithOtherLanguages|IntegratingPythonWithOtherLanguages]], which, among other variants, mentions ''embeddings'' of Python in other languages.

Line 116: Line 158:
CategoryImplementations
[[
CategoryImplementations|CategoryImplementations]]

Python Implementations

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 of 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.

CPython Variants

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)

  • Stackless Python - CPython with an emphasis on concurrency using tasklets and channels (used by dspython for the Nintendo DS)

  • 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

Also look at the sections on Python compilers and extensions below, some of which would qualify as CPython variants.

Other Implementations

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.

Working Implementations

The following implementations may be 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:

  • CLPython - Python in Common Lisp

  • HotPy - a virtual machine for Python supporting bytecode optimisation and translation (to native code) using type information gathered at run-time

  • IronPython - Python in C# for the Common Language Runtime (CLR/.NET) and the FePy project's IronPython Community Edition (IPCE)

  • Jython - Python in Java for the Java platform

  • pyjamas - a Python to JavaScript compiler plus Web/GUI framework

  • PyMite - Python for embedded devices

  • PyPy - Python in Python, targeting several environments

  • 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

Tentative Implementations

The following implementations are apparent works in progress; they may not be able to run typical programs:

Extensions

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

Compilers

These compilers usually implement something close to Python, although some compilers may impose restrictions that alter the nature of the language:

  • 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)

  • 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.

  • GCC Python Front-End - an in-progress effort to compile Python code within the GCC infrastructure

  • Nuitka - a Python-to-C++ compiler using libpython at run-time, attempting some compile-time and run-time optimisations. Interacts with CPython runtime.

  • 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

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)

  • Boo

  • Cobra

  • 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

  • Nimrod - statically typed, compiles to C, 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

  • Serpent - inspired by Python, supporting real-time garbage collection and multiple virtual machines in separate threads (more information)

  • Trylon - inspired heavily by Smalltalk

  • 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

Comparisons:

Topic Guides

(Fun) Python Preprocessors

There are even some tongue-in-cheek dialects of Python which you might find fun.

Academic Projects

Python implementations and compilers have been the topic of various papers and theses. Those that have not apparently been developed further are listed here:


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.


CategoryImplementations

PythonImplementations (last edited 2023-06-24 04:21:27 by MaxBernstein)

Unable to edit the page? See the FrontPage for instructions.