Channels

Services

PyPy 2.0 alpha on ARM includes Pi support

The developers of the JIT-compiling Python interpreter PyPy have released an alpha version of PyPy 2.0 for ARM processors. Part of the work was sponsored by the Raspberry Pi Foundation, so it's not surprising to find the Raspberry Pi mini-computer listed as one of the supported platforms.

The alpha should also run on ARMv6 or ARMv7 with VFPv3 support and builds are available for hard-float and some soft-float systems, which means that the BeagleBoard, Chromebook and Cubieboard, among others, should work with the interpreter. That said, this is early days in the development and that means, as well as it being unsuitable for anything resembling production use, this release is missing PyPy's stackless Python support. The developers also warn that the assembler code produced may not always be correct, but they are relatively confident in it, given that they have run a large benchmark over the interpreter.

That benchmark showed PyPy on ARM (a Cortex A9 with 4MB of cache) running up 46 times faster than CPython on ARM, although some benchmarks were near equivalent in speed and one was slower. The benchmarking showed that a large interpreter such as CPython was subject to higher slowdowns than a JIT compiler like PyPy on ARM chips. The developers were surprised by this as their ARM assembler generation is "not nearly as polished as our x86 assembler" – the hunt for the actual reason for the differences is ongoing. On x86, PyPy 2.0 is currently beta 2 level.

The Raspberry Pi Foundation says that the funding for PyPy came in the latter stages of development and was "a small amount". The Foundation is planning to reveal other open source projects it has been funding in the coming weeks.

The PyPy developers suggest that users run PyPy from a virtualenv to keep it isolated from any system Python installation. Testers and developers can find PyPy 2.0 alpha for ARM on the PyPy download page with Linux binaries for 32-bit armel and armhf, and a deb file for Raspbian, the Debian port for Raspberry Pi. The same page also has the PyPy 2.0 beta 2 for x86 binaries. PyPy is published under the MIT licence.