PyPy

From Wikipedia, the free encyclopedia
  (Redirected from Pypy)
Jump to: navigation, search
Official PyPy logo
Stable release 1.8 / 10 February 2012; 14 days ago (2012-02-10)
Written in Python
Operating system Cross-platform
Type Python interpreter and compiler toolchain
License MIT License
Website pypy.org

PyPy is a Python interpreter and JIT compiler. PyPy focuses on speed, efficiency and 100% compatibility with the original CPython interpreter.

Contents

[edit] 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, emphasizing 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]

[edit] Translation

PyPy consists of a standard interpreter and a translator.

The interpreter implements the full Python language utilizing 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].

[edit] Project status

The latest PyPy release, PyPy 1.8, is CPython 2.7.2 compatible. It runs on 32- and 64-bit Intel x86 architecture and includes a JIT compiler. It's nightly tested on Windows, Linux and Mac OS X. PyPy is able to run pure Python software that does not rely on implementation-specific features[4]. A translation for CPython C API extensions exists, but is incomplete and experimental. Interfacing with shared libraries is recommended via the ctypes infrastructure.

[edit] 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] Many of PyPy's changes have been made during coding sprints.

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

In March 2010, PyPy 1.2 was released, focusing on speed. It included a just-in-time compiler, which works, but was 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.

In December 2010, PyPy 1.4, the first PyPy suitable for production use was released. PyPy 1.4 is compatible with Python 2.5.

On April 30, 2011, PyPy 1.5 was released. PyPy 1.5 is compatible with Python 2.7.1.

On August 18, 2011, PyPy 1.6 was released.

On November 21, 2011, PyPy 1.7 was released.

On February 10, 2012, PyPy 1.8 was released, compatible with Python 2.7.2.

[edit] 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. In 2009 Eurostars, a European Union funding agency specially focused on SMEs[12], accepted a proposal from PyPy project members entitled: "PYJIT - a fast and flexible toolkit for dynamic programming languages based on PyPy". Eurostars funding will last until August 2011. [13] At PyCon US 2011, the Python Software Foundation provided a $10,000 grant for PyPy to continue work on performance and compatibility with newer versions of the language[14]. The PyPy project also accepts donations through its status blog pages. [15]

[edit] Supported backends

  • C - the RPython code can be translated to C and run as a native program, and this is the standard operation mode;
  • CLI - Common Language Interface;
  • JVM - Java Virtual Machine;
  • Python - the PyPy interpreter can also be run on a Python interpreter. Though extremely slow, this possibly is useful for debugging.

As of 2010, PyPy has abandoned its JavaScript backend.[16]

[edit] See also

[edit] Notes

  1. ^ Samuele Pedroni (March 2007). "PyPy - Goals and Architecture Overview". http://codespeak.net/pypy/dist/pypy/doc/architecture.html#mission-statement. 
  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". http://pypy.org/compat.html. 
  5. ^ "PyPy Status Blog: 1.1 final released". http://morepypy.blogspot.com/2009/04/11-final-released.html. 
  6. ^ "Running pylons on top of PyPy". http://morepypy.blogspot.com/2008/06/running-pylons-on-top-of-pypy.html. 
  7. ^ "Running Pyglet on top of PyPy". http://morepypy.blogspot.com/2008/02/running-pyglet-on-pypy.html. 
  8. ^ "Running Nevow on top of PyPy". http://morepypy.blogspot.com/2008/06/running-nevow-on-top-of-pypy.html. 
  9. ^ "PyPy runs unmodified django 1.0 beta". http://morepypy.blogspot.com/2008/08/pypy-runs-unmodified-django-10-beta.html. 
  10. ^ "PyPy speed center". http://speed.pypy.org/. 
  11. ^ "EU Community Research and Development Information Service Entry". http://cordis.europa.eu/search/index.cfm?fuseaction=proj.document&PJ_RCN=7746170. 
  12. ^ "Eurostars - Aim Higher". http://www.eurostars-eureka.eu/. 
  13. ^ "Project Page on Eureka Network". http://www.eurekanetwork.org/project/-/id/4791. 
  14. ^ "A thank you to the PSF". http://morepypy.blogspot.com/2011/03/thank-you-to-psf.html. 
  15. ^ "PyPy Status Blog: Oh, and btw: PyPy gets funding through "Eurostars"". http://morepypy.blogspot.com/2010/12/oh-and-btw-pypy-gets-funding-through.html. 
  16. ^ Re: [pypy-dev] pypy appears to have entirely removed all mention of javascript back-end support from web site, By Maciej Fijalkowski, 22 Apr 2009, pypy-dev

[edit] References

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages