Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

PyPy

From Wikipedia, the free encyclopedia
Alternative implementation of the Python programming language
Not to be confused withPyPI, the Python official third-party software repository.
PyPy
Initial releasemid 2007; 19 years ago (2007)
Stable release
7.3.19[1] Edit this on Wikidata (26 February 2025; 11 months ago (26 February 2025))
Written inRPython
Operating systemCross-platform
TypePython interpreter and compilertoolchain
LicenseMIT
Websitepypy.org Edit this on Wikidata
Repository

PyPy (/ˈpp/) is an implementation of thePythonprogramming language.[2] PyPy frequently runs much faster than the standardimplementationCPython because PyPy uses ajust-in-time compiler.[3] Most Python code runs well on PyPy except for code that depends on CPython extensions, which either does not work or incurs some overhead when run in PyPy.

PyPy itself is built using a technique known asmeta-tracing, which is a mostly automatic transformation that takes aninterpreter as input and produces atracing just-in-time compiler as output. Since interpreters are usually easier to write thancompilers, but run slower, this technique can make it easier to produce efficient implementations of programming languages. PyPy's meta-tracingtoolchain is calledRPython.

PyPy officially supports Python 2.7 and 3.11[4] and has a few differences in implementations compared to CPython.[5]

Details and motivation

[edit]

PyPy aims to provide a common translation and support framework for producing implementations ofdynamic languages, emphasizing a clean separation betweenlanguage specification and implementation aspects. It also aims to provide a compliant, flexible and fast implementation of the Python programming language using the aboveframework to enable new advanced features without having to encode low-level details into it.[6][7]

RPython

[edit]

The PyPy interpreter itself is written in a restricted subset of Python called RPython (Restricted Python).[8] RPython puts some constraints on the Python language such that a variable's type can beinferred at compile time.[9]

The PyPy project has developed atoolchain that analyzes RPython code and translates it into a form ofbyte code, which can be lowered intoC. There used to be otherbackends in addition toC (Java,C#, andJavaScript), but those suffered frombitrot and have been removed. Thus, therecursive logo of PyPy is asnake swallowing itself since the RPython is translated by a Pythoninterpreter. The code can also be run untranslated for testing and analysis, which provides a nicetest-bed for research into dynamic languages.

It allows for pluggablegarbage collectors, as well as optionally enablingStackless Python features. Finally, it includes a just-in-time (JIT)generator that builds ajust-in-time compiler into the interpreter, given a few annotations in theinterpretersource code. The generated JIT compiler is atracing JIT.[10]

RPython is now also used to write non-Python language implementations, such asPixie.[11]

Project status

[edit]

PyPy as of version 7.3.17 is compatible with twoCPython versions: 2.7 and 3.10.[12][13] The first PyPy version compatible with CPython v3 is PyPy v2.3.1 (2014).[14] The PyPy interpreter compatible with CPython v3 is also known as PyPy3.

PyPy hasJIT compilation support on 32-bit/64-bitx86 and 32-bit/64-bitARM processors.[15] It is tested nightly on Windows, Linux, OpenBSD and Mac OS X. PyPy is able to run pure Python software that does not rely on implementation-specific features.[16]

There is a compatibility layer for CPython C API extensions called CPyExt, but it is incomplete and experimental. The preferred way of interfacing withCshared libraries is through the built-in Cforeign function interface (CFFI) orctypes libraries.

History

[edit]

PyPy is a followup to thePsyco project, ajust-in-timespecializing compiler for Python, developed by Armin Rigo between 2002 and 2010. PyPy's aim is to have a just-in-time specializing compiler with scope, which was not available for Psyco.[clarification needed] Initially, the RPython could also be compiled intoJava bytecode,CIL andJavaScript, but these backends were removed due to lack of interest.

PyPy was initially 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. Many of PyPy's changes have been made duringcoding sprints.

  • In August 2008, PyPy was able to run some popular Python libraries likePylons,[17]Pyglet,[18]Nevow[19] andDjango.[20]
  • On 12 March 2010, PyPy 1.2 was released, focusing on speed. It included a working, though not yet stable, just-in-time compiler.[21]
  • On 30 April 2011, PyPy version 1.5 was released, which reached compatibility with CPython 2.7.[22]
  • On 9 May 2013, PyPy 2.0 was released, which introduced alpha-quality support for JIT compilation on ARMv6 and ARMv7 JIT, and included CFFI in the standard library.[23][24]
  • On 20 June 2014, PyPy3 was declared stable[14] and introduced compatibility with the more modern Python 3. It was released alongside PyPy 2.3.1 and bears the same version number.
  • On 21 March 2017, the PyPy project released version 5.7 of both PyPy and PyPy3, with the latter introducing beta-quality support for Python 3.5.[25]
  • On 26 April 2018, version 6.0 was released, with support for Python 2.7 and 3.5 (still beta-quality on Windows).[26]
  • On 11 February 2019, version 7.0 was released, with support for Python 2.7 and 3.5.[27]
  • On 14 October 2019, version 7.2 was released, with support for Python 3.6.9.[28]
  • On 24 December 2019, version 7.3 was released, with support for Python 3.6.9.[29]
  • On 16 February 2020, the PyPy team announced the move of the source code hosting fromBitbucket to heptapod.net with the repositories of the CFFI (CForeign Function Interface) project. A new logo and website design are also published. However, the author and the license of the new logo are unknown.[30]
  • On 29 December 2023, PyPy announced hosting has moved toGitHub and development will now be tracked withgit.[31]

Funding

[edit]

PyPy was funded by theEuropean Union being aSpecific Targeted Research Project[32] between December 2004 and March 2007. In June 2008, PyPy announced funding being part of theGoogle Open Source programs and has agreed to focus on making PyPy more compatible withCPython. In 2009 Eurostars, a European Union funding agency specially focused onSMEs,[33] accepted a proposal from PyPy project members titled "PYJIT – a fast and flexible toolkit for dynamic programming languages based on PyPy". Eurostars funding lasted until August 2011.[34]AtPyCon US 2011, thePython Software Foundation provided a $10,000 grant for PyPy to continue work on performance and compatibility with newer versions of the language.[35]The port to ARM architecture was sponsored in part by theRaspberry Pi Foundation.[23]

The PyPy project also accepts donations through its status blog pages.[36] As of 2013, a variety of sub-projects had funding: Python 3 version compatibility, built-in optimizedNumPy support for numerical calculations andsoftware transactional memory support to allow better parallelism.[23]

See also

[edit]

Notes

[edit]
  1. ^"PyPy v7.3.19 release". Retrieved12 March 2025.
  2. ^"Interview Maciej Fijalkowski PyPy". 29 November 2015.
  3. ^"PyPy Speed".speed.pypy.org. Retrieved2019-12-01.
  4. ^"PyPy". 30 December 2024.
  5. ^"Differences between PyPy and CPython — PyPy documentation". 30 December 2024.
  6. ^Samuele Pedroni (March 2007)."PyPy – Goals and Architecture Overview". Archived fromthe original on 2012-06-14.
  7. ^"PyPy – Goals and Architecture Overview – Mission Statement". Retrieved11 October 2013.
  8. ^Our runtime interpreter is "RPython", Coding Guide – PyPy documentation
  9. ^"It is a proper subset of Python, restricted in a way that enables easy analysis and efficient code generation", Ancona et al., 2007.
  10. ^Bolz, Carl; Cuni, Antonio; Fijalkowski, Maciej; Rigo, Armin.Tracing the Meta-Level: PyPy's Tracing JIT Compiler. ICOOOLPS '09.doi:10.1145/1565824.1565827.
  11. ^Timothy Balridge interview.
  12. ^"PyPy – Python compatibility".pypy.org. 28 December 2019. Retrieved2020-12-15.
  13. ^"PyPy v7.3.7: bug-fix release of 3.7, 3.8".pypy.org. 25 October 2021. Retrieved2021-11-10.
  14. ^abthe PyPy team (20 June 2014)."PyPy3 2.3.1 – Fulcrum". PyPy blog.
  15. ^"PyPy v7.2.0: release of 2.7, and 3.6".pypy.org. 16 October 2019.
  16. ^"PyPy – Python compatibility". 28 December 2019.
  17. ^"Running pylons on top of PyPy". 10 June 2008.
  18. ^"Running Pyglet on top of PyPy". 20 February 2008.
  19. ^"Running Nevow on top of PyPy". 20 June 2008.
  20. ^"PyPy runs unmodified django 1.0 beta". 19 August 2008.
  21. ^"Introducing the PyPy 1.2 release". 30 April 2011.
  22. ^"PyPy 1.5 Released: Catching Up". 12 March 2010.
  23. ^abcJake Edge (15 May 2013)."A look at the PyPy 2.0 release".LWN.net.
  24. ^"PyPy 2.0 – Einstein Sandwich". 9 May 2013.
  25. ^"PyPy2.7 and PyPy3.5 v5.7 – two in one release". 21 March 2017.
  26. ^"PyPy2.7 and PyPy3.5 v6.0 dual release". 26 April 2018.
  27. ^Cuni, Antonio (2019-02-11)."PyPy Status Blog: PyPy v7.0.0: triple release of 2.7, 3.5 and 3.6-alpha".PyPy Status Blog. Retrieved2020-08-17.
  28. ^Mattip (2019-10-14)."PyPy Status Blog: PyPy v7.2 released".PyPy Status Blog. Retrieved2020-08-17.
  29. ^Mattip (2019-12-24)."PyPy Status Blog: PyPy v7.3.0 released".PyPy Status Blog.
  30. ^"PyPy and CFFI have moved to Heptapod". 16 February 2020.
  31. ^"PyPy has moved to Git, GitHub". 29 December 2023.
  32. ^"EU Community Research and Development Information Service Entry".
  33. ^"Eurostars – Aim Higher".
  34. ^"Project Page on Eureka Network". Archived fromthe original on 2012-04-03. Retrieved2011-10-17.
  35. ^"A thank you to the PSF". 22 March 2011.
  36. ^"PyPy Status Blog: Oh, and btw: PyPy gets funding through "Eurostars"". 10 December 2010.

References

[edit]

External links

[edit]
Implementations
IDEs
Topics
Designer
Retrieved from "https://en.wikipedia.org/w/index.php?title=PyPy&oldid=1331407226"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp