PyPy
PyPy[index]

PyPy - a Python implementation written in Python

1   PyPy User Documentation

getting started provides hands-on instructions including a two-liner to run the PyPy Python interpreter on your system, examples on advanced features and entry points for using PyPy's translation tool chain.

FAQ contains some frequently asked questions.

New features of PyPy's Python Interpreter and Translation Framework:

extension compiler describes the (in-progress) tool that can be used to write modules in PyPy's style and compile them into regular CPython extension modules.

JavaScript backend describes how to use the JavaScript backend to create AJAX-based web pages.

PyPy Prolog Interpreter describes an implementation of Prolog that makes use of our Translation Tool chain.

Status of the project.

2   Project Documentation

architecture gives a complete view of PyPy's basic design.

coding guide helps you to write code for PyPy (especially also describes coding in RPython a bit).

sprint reports lists reports written at most of our sprints, from 2003 to the present.

talks and related projects lists presentations and related projects.

ideas for PyPy related projects which might be a good way to get into PyPy.

PyPy video documentation is a page linking to the videos (e.g. of talks and introductions) that are available.

Technical reports is a page that contains links to the reports that we submitted to the European Union.

development methodology describes our sprint-driven approach.

license contains licensing details (basically a straight MIT-license).

Glossary of PyPy words to help you align your inner self with the PyPy universe.

3   Status

PyPy is mainly developed on Linux and Mac OS X. Windows is supported, but platform-specific bugs tend to take longer before we notice and fix them. About 64-bit machines: although support is mostly present, we decided to stop tracking and fixing the remaining issues for a while, as an attempt to keep some focus. So PyPy requires a 32-bit machine or OS for now.

PyPy's own tests, daily updated, on Linux, on Windows
and on built pypy-c.

Nightly builds and benchmarks of PyPy to C, CLI and LLVM (PowerPC machine).

Nightly compliance test runs for compiled pypy-c.

compliance test status shows outcomes of compliance test runs against PyPy on top of CPython.

PyPy LOC statistics shows LOC statistics about PyPy.

PyPy statistics is a page with various statistics about the PyPy project.

compatibility matrix is a diagram that shows which of the various features of the PyPy interpreter work together with which other features.

4   Source Code Documentation

object spaces discusses the object space interface and several implementations.

bytecode interpreter explains the basic mechanisms of the bytecode interpreter and virtual machine.

interpreter optimizations describes our various strategies for improving the performance of our interpreter, including alternative object implementations (for strings, dictionaries and lists) in the standard object space.

translation is a detailed overview of our translation process. The rtyper is the largest component of our translation process.

dynamic-language translation is a paper that describes the translation process, especially the flow object space and the annotator in detail. This document is also part of the EU reports.

low-level encapsulation describes how our approach hides away a lot of low level details. This document is also part of the EU reports.

translation aspects describes how we weave different properties into our interpreter during the translation process. This document is also part of the EU reports.

parser contains (outdated, unfinished) documentation about the parser.

rlib describes some modules that can be used when implementing programs in RPython.

configuration documentation describes the various configuration options that allow you to customize PyPy.

CLI backend describes the details of the .NET backend.

JIT Generation in PyPy describes how we produce the Python Just-in-time Compiler from our Python interpreter.

4.1   PyPy directory cross-reference

Here is a fully referenced alphabetical two-level deep directory overview of PyPy:

Directory explanation/links
annotation/ type inferencing code for RPython programs
bin/ command-line scripts, mainly py.py and translatorshell.py
config/ handles the numerous options for building and running PyPy
doc/ text versions of PyPy developer documentation
doc/config/ documentation for the numerous translation options
doc/discussion/ drafts of ideas and documentation
doc/*/ other specific documentation topics or tools
interpreter/ bytecode interpreter and related objects (frames, functions, modules,...)
interpreter/pyparser/ interpreter-level Python source parser
interpreter/astcompiler/ interpreter-level bytecode compiler, via an AST representation
jit/ the just-in-time compiler generator
jit/codegen/ jit backends for different architectures
jit/hintannotator/ the hint-annotator that analyzes an interpreter
jit/timeshifter/ the timeshifter that turns an interpreter into a JIT compiler
jit/tl/ interpreters for toy languages, with which we test the JIT generator
lang/ interpreters for non-Python languages, written in RPython
lang/js/ a JavaScript interpreter (in-progress)
lang/prolog/ a Prolog interpreter
lib/ PyPy's wholesale reimplementations of CPython modules and experimental new application-level modules
lib/app_test/ tests for the reimplementations, running on top of CPython
lib/distributed/ distributed execution prototype, based on transparent proxies
module/ contains mixed modules implementing core modules with both application and interpreter level code. Not all are finished and working. Use the --withmod-xxx or --allworkingmodules translation options.
objspace/ object space implementations
objspace/trace.py the trace object space monitoring bytecode and space operations
objspace/dump.py the dump object space saves a large, searchable log file with all operations
objspace/taint.py the taint object space, providing object tainting
objspace/thunk.py the thunk object space, providing unique object features
objspace/logic.py the logic object space, providing Prolog-like logic variables
objspace/cpy/ an object space supporting the extension compiler
objspace/flow/ the FlowObjSpace implementing abstract interpretation
objspace/std/ the StdObjSpace implementing CPython's objects and types
rlib/ a "standard library" for RPython programs
rpython/ the RPython Typer
rpython/lltypesystem/ the low-level type system for C-like backends
rpython/ootypesystem/ the object-oriented type system for OO backends
rpython/memory/ the garbage collector construction framework
tool/ various utilities and hacks used from various places
tool/algo/ general-purpose algorithmic and mathematic tools
tool/pytest/ support code for our testing methods
translator/ translation backends and support code
translator/backendopt/ general optimizations that run before a backend generates code
translator/c/ the GenC backend, producing C code from an RPython program (generally via the rtyper)
translator/cli/ the CLI backend for .NET (Microsoft CLR or Mono)
translator/goal/ our main PyPy-translation scripts live here
translator/js/ the JavaScript backend
translator/jvm/ the Java backend (in-progress)
translator/lisp/ the Common Lisp backend (incomplete)
translator/llvm/ contains the LLVM backend producing LLVM assembler from fully annotated RPython programs
translator/squeak/ the Squeak backend (very incomplete)
translator/stackless/ the Stackless Transform
translator/tool/ helper tools for translation, including the Pygame graph viewer
*/test/ many directories have a test subdirectory containing test modules (see Testing in PyPy)
_cache/ holds cache files from internally translating application level to interpreterlevel code.