Jump to content

PyPy

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Thejoshwolfe (talk | contribs) at 05:42, 7 October 2010 (Translation: added external link for RPython's informal definition). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
PyPy
Stable release
1.3 / June 25, 2010; 14 years ago (2010-06-25)
Repository
Written inPython
Operating systemCross-platform
TypePython interpreter and compiler toolchain
LicenseMIT License
Websitehttp://pypy.org

PyPy is a self-hosting interpreter for the Python programming language.

Details and motivation

PyPy was conceived as an implementation of Python written in Python, which enables Python developers to hack the implementation. This makes it easy to identify areas where it can be improved. The fact that PyPy is implemented in a high level language makes it also more flexible and easier to experiment with than CPython, thus allowing developers to experiment with multiple implementations of specific features.

PyPy aims to provide a common translation and support framework for producing implementations of dynamic languages, emphasising a clean separation between language specification and implementation aspects. It also aims to provide a compliant, flexible and fast implementation of the Python programming language using the above framework to enable new advanced features without having to encode low level details into it.[1]

Translation

PyPy consists of a standard interpreter and a translator.

The interpreter is a meta-circular evaluator implementing the full Python language in a restricted subset, called RPython (Restricted Python). Unlike standard Python, RPython is statically typed, to allow efficient compilation.[2]

The translator is a tool chain that analyzes RPython code and translates it to a lower-level language, such as C, Java bytecode or Common Intermediate Language. It also allows for pluggable Garbage collectors as well as optionally enabling Stackless. Finally it includes a JIT generator which builds a just-in-time compiler into the interpreter, given a few annotations in the interpreter source code. The generated JIT compiler is a tracing JIT[3].

Project status

The latest PyPy release, PyPy 1.3, is CPython 2.5 compatible. It runs on 32-bit Intel x86 architecture and includes a JIT compiler. PyPy is able to run pure Python software that does not rely on implementation specific features[4]. The x86-64 architecture is not yet supported. A translation for CPython C API extensions exists, but is incomplete and experimental. Interfacing with shared libraries is recommended via the ctypes infrastructure.

History

PyPy is a followup to the Psyco project, a just-in-time specializing compiler for Python, developed by Armin Rigo. PyPy's aim is to have a just-in-time specializing compiler with scope, which was not available for Psyco.

PyPy began as a research and development-oriented project. Reaching a mature state of development and an official 1.0 release in mid-2007, its next focus was on releasing a production-ready version with more CPython compatibility. Version 1.1 was released on April 28, 2009.[5]

As of late 2008, PyPy was able to run some popular Python libraries like Pylons[6], Pyglet[7], Divmod's Nevow[8] and Django[9].

In March 2010, PyPy 1.2 was released, focusing on speed. It includes a just-in-time compiler, which works, but is not advised to run in production environments. Along with the 1.2 release, the website was redesigned and a new PyPy speed center[10] for tracking progress was brought up.

Funding

PyPy was funded by the European Union as a STReP[11] between December 2004 and March 2007. In June 2008, PyPy announced funding as part of the Google Open Source programs, and has agreed to focus on making PyPy more compatible with CPython.

Supported backend

As of 2010, PyPy has abandoned its javascript backend.[12]

See also

Notes

  1. ^ Samuele Pedroni (2007). "PyPy - Goals and Architecture Overview". {{cite web}}: Unknown parameter |month= ignored (help)
  2. ^ "It is a proper subset of Python, restricted in a way that enables easy analysis and efficient code generation", Ancona et al., 2007.
  3. ^ Bolz et al., 2009
  4. ^ "PyPy - Python compatibility".
  5. ^ "PyPy Status Blog: 1.1 final released".
  6. ^ "Running pylons on top of PyPy".
  7. ^ "Running Pyglet on top of PyPy".
  8. ^ "Running Nevow on top of PyPy".
  9. ^ "PyPy runs unmodified django 1.0 beta".
  10. ^ "PyPy speed center".
  11. ^ "PyPy EU project page".
  12. ^ http://www.mail-archive.com/pypy-dev@codespeak.net/msg03946.html

References