Project: PYJIT - a fast and flexible toolkit for dynamic programming languages based on PyPy

The PYJIT project will deliver a fast and flexible Just-In-Time Compiler toolkit based on PyPy to the market of dynamic languages. Our CO aim is to showcase our project's results for the Open Source language Python, providing unprecedented levels of flexibility and with speed hitherto only available using statically _x000D_typed languages. These efforts are set to fully meet the needs of the Python community and many companies world wide. This will enable us to sell a large range of services: Implementations of_x000D_custom backends/VMs, creation of interpreters for dynamic languages different from Python, implementation of new dynamic features for existing interpreters and porting to specialised_x000D_hardware (e.g. game platforms and embedded systems)._x000D__x000D_PyPy is an Open Source project that implements a highly flexible Python interpreter written in Python itself. Its development was partially funded under the EU Sixth Framework IST programme. One strategic advantage of PyPy over virtually all other dynamic language implementations is that PyPy's virtual machines are generated, and not written by hand. Only one interpreter source needs to be COtained in a very high level language. One can independently add new target execution environments. In PyPy the low-level details of the virtual machine (VM) implementation (such as memory management strategies, threading model) are kept separate from the high-level details about the semantics of the language. This provides many benefits. _x000D__x000D_In a few lines of code one is able to experiment with new, elegant ways of providing state-of-the art security mechanisms for sandboxing executed Python code. We support alternative threading mechanisms, including the microthreading model first developed for Stackless Python. It is also possible to freeze_x000D_a running program and then resume it on a different computer, with a different operating system and a different virtual machine. This opens up exciting new possibilities in the field of mobile computing, dynamic load balancing, and peer-to-peer resource sharing._x000D__x000D_Besides providing an improved architecture and unique features, the CO scientific result of the former PyPy EU project was the ability to automatically generate a Just-in-Time (JIT) compiler from the interpreter, with the help of partial evaluation techniques. In its current state this JIT compiler generator is a proof of concept for the technology, showing that performance approaching the speed of code written in C_x000D_can be achieved. This is arguably one of the biggest success stories of partial evaluation and the idea of generating compilers from interpreters in general._x000D__x000D_While the PyPy project is an example of a highly successful research project, it did not yet produce a market-ready solution. Further research in the JIT generator field is necessary to bring the envisioned performance improvements. During the Eureka project the research shall focus on the Python language, but the technology developed will be reusable for many other dynamic programming languages. In fact, PyPy' tool-chain is itself well suited for implementing other dynamic languages. Our JIT compiler generator will *automatically* make such implementations efficient -- allowing it to rise as a premier_x000D_platform for implementing custom languages. _x000D__x000D_The commercial Ps of the project are well known in the Python community. They aim to sell development and service contracts. Customers will be software producers of all sizes, with in-house applications or commercial offerings. Customers for services are expected to be larger companies_x000D_both in the software and the hardware sectors of the computer business. The custom VM generation should make PyPy broadly attractive to chip and hardware manufacturers._x000D__x000D_The consortium consists of Open End (Sweden), merlinux (Germany) and Heinrich-Heine-Universität (HHU, Germany). These Ps have already collaborated closely during the PyPy IST FP6 project for several years and bring core expertise in different areas to the project. No P on its own has the required breadth of expertise and knowledge to fulfill the ambitious goals of the project. Open End provides knowledge about JIT, JVM and parser technology, as well as expertise in converting research prototypes into robust products which are suitable for general customer use. HHU provides the core JIT and partial evaluation knowledge, as well as knowledge about interfacing with external software components. Merlinux provides relations to _x000D_industry players, has headed pilot PyPy projects and COtains extensive knowledge about Continous Integration tools and creative dissemination strategies for the type of hybrid project envisioned in this proposal.

Acronym PYJIT (Reference Number: 4791)
Duration 15/04/2009 - 15/10/2011
Project Topic By applying novel Just-in-Time Compilation techniques we will make dynamic programming languages perform at speeds comparable to their static counterparts, enabling new applications. Python is our first target but the techniques are easily extended to a range of programming languages.
Project Results
(after finalisation)
A language-independent meta-tracing JIT-compiler that can be adapted to various languages with the help of hints the interpreter-author can add to the interpreter._x000D_The tracer uses a powerful allocation removal allocation to reduce the overhead of dynamic typing._x000D_An x86-backend was developed, for both 32bit and 64bit Intel machines._x000D__x000D_This meta-tracing JIT was used to greatly speed up PyPy's Python interpreter._x000D_The current speeds are about five times faster than CPython across a number of benchmarks._x000D__x000D_The new testing tools developed COly by merlinux allow a significant_x000D_speedup of test runs. On common machines with 4 CPUs cores a speedup of_x000D_3-4 times is achieved. merlinux also set up the benchmarking_x000D_infrastructure which PyPy developers used to continously stear their_x000D_development efforts. It helped to migrate to new development_x000D_infrastructure and version control systems.
Network Eurostars
Call Eurostars Cut-Off 2

Project partner

Number Name Role Country
3 Heinrich Heine Universität, Düsseldorf Partner Germany
3 merlinux GmbH Partner Germany
3 Open End AB Coordinator Sweden