Features

PyPy 1.2 implements Python 2.5. It supports all of the core language, passing Python test suite (with minor modifications that were already accepted in main python in newer versions). It supports most of commonly used Python standard library modules. For known differences with CPython, see our compatibility page. If you are interested in helping with 2.6, 2.7 or 3.x features, contact us!

PyPy 1.2 runs essentially only on Intel x86 (IA-32). On 64-bit platforms you have to use the 32-bit compatibility mode, for now — or contact us to help!

Speed or memory usage?

Our main prototype comes with a Just-in-Time compiler. It is really fast in running most benchmarks. Try it out!

An issue with our JIT compiler is that it's hard to control the exact amount of RAM that is used. If this is an important issue to you, you can try our baseline version, which does not include a JIT compiler at all.

Sandboxing

PyPy's sandboxing is a working prototype for the idea of running untrusted user programs. Unlike other sandboxing approaches for Python, PyPy's does not try to limit language features considered “unsafe”. Instead we replace all calls to external libraries (C or platform) with a stub that communicates with an external process handling the policy.

To run the sandboxed process, you need pypy-sandbox. You also need to get the full sources (step 1 only). Run:

cd pypy-trunk/pypy/translator/sandbox
pypy_interact.py path/to/pypy-sandbox

You get a fully sandboxed interpreter, in its own filesystem hierarchy (try os.listdir('/')). For example, you would run an untrusted script as follows:

mkdir virtualtmp
cp untrusted.py virtualtmp/
pypy_interact.py --tmp=virtualtmp pypy-sandbox /tmp/untrusted.py

Note that the path /tmp/untrusted.py is a path inside the sandboxed filesystem. You don't have to put untrusted.py in the real /tmp directory at all.

To read more about its features, try pypy_interact.py --help or go to our dev site.

Stackless

PyPy is also available in a separate Stackless version that includes support for micro-threads for massive concurrency. Read more about it at the Stackless main site (we provide the same interface as the standard Stackless Python), and at the greenlets page.

Other features

PyPy has many secondary features and semi-independent projects. We will mention here:

  • the .NET backend: you get a version of pypy-c that runs natively in the .NET/CLI VM. Of particular interest is the cli-jit branch, in which you can make a version of pypy-c which also contains a high-level JIT compiler (it compiles your Python programs Just in Time into CLR bytecodes, which are in turn compiled natively by the VM).
  • the Java backend: PyPy can run on the Java VM, but more care is needed to finish this project. (Requires the cli-jit branch for now.) Writing a backend for our high-level JIT compiler would be excellent. Contact us!
  • Other languages: available in a separate part of the repository, we implemented other languages too: Prolog (almost complete), as well as Smalltalk, JavaScript, Io, Scheme and Gameboy.