TITLE OF PAPER: PyPy - Implementing Python in Python URL OF PRESENTATION: _URL_of_powerpoint_presentation_ PRESENTED BY: Jacob Hallen REPRESENTING: AB Strakt CONFERENCE: PyCON 2004 DATE: 20040324 LOCATION: _venue_and_room_in_venue_ -------------------------------------------------------------------------- REAL-TIME NOTES / ANNOTATIONS OF THE PAPER: {If you've contributed, add your name, e-mail & URL at the bottom} PyPy is an implementation of Python in Python Currently a Python interpreter implemented in RPython runs on top of CPython Allows testing against CPython. Next stage, a translater takes the interpreter above and builds an optimised interpreter that no longer needs CPython. Modules | User Program bytecodes | compiled bytecode ------------------------------- bytecode interpretor Approach is to turn everything dynamic (as opposed to Starkiller which turns everything static). Uses multimethods in the implementation of the new interpreter. Multimethods are supplied by the StdObjSpace class Multimethods dispatch on the type of all arguments of a method, not only the first (self), e.g. add(int, int) or add(float, float). RPy -> Flowgraph -> Pyrex (via annotated flowgraph) -> C. Translation phase takes RPython and generates a flowgraph and then that is passed thru something like PyRex to generate code Rpy -> bytecode interpreter -> flow graph Interpreter has plugins which do various stuff to the flow graph. Flow graph is generated using the same bytecode interpreter but using a different object space (the Flow object space). Demonstration of what can be done in PyPy command line shows "Python py.py" and the prompt is ">>>>" to remind you are in pypy Different object space (Trace) allows tracing of operations. E.g. typed 2+3 and got back the answer along with every bytecode instruction that was run to achieve the result. Using the full object space the interpreter runs very slow as all objects are written in pure Python. But it can run essentially all Python code. Static analysis of programs that promise to behave. Translator uses PyPy code to perform analysis. One output is a flow chart in postscript. The graph data was generated by "running" the code using abstract values instead of an actual number as the parameter. This technique is called abstract interpretation. The flow graph can be compiled to C by generating Pyrex code. This translation is intended to be applied to the PyPy interpreter; the restrictions required should not apply to the Python code that is to be run by the interpreter. How to Participate: http://www.codespeak.net/pypy Download source from Subversion repository About 16 kLOC MIT Licensed. Participate in sprints. Applied for funding from the EU ~1.6 million Euros Motivation for PyPy Flexible implementation Elegant implementation platform for experimentation Modular implementation multiple implementations of core features Potentially faster than CPython See PyPy website for motivation presented to the EU Is PyPy is able to run itself (metacircularity)? Hasn't been tried. A core of 6-8 people. -------------------------------------------------------------------------- REFERENCES: {as documents / sites are referenced add them below} Paper: http://www.python.org/pycon/dc2004/papers/27/pypy.html PyPy Project: http://www.codespeak.net/pypy -------------------------------------------------------------------------- QUOTES: -------------------------------------------------------------------------- CONTRIBUTORS: {add your name, e-mail address and URL below} Ted Leung, twl@osafoundation.org, http://www.sauria.com/blog Abhay Saxena, ark3@email.com -------------------------------------------------------------------------- E-MAIL BOUNCEBACK: {add your e-mail address separated by commas } -------------------------------------------------------------------------- NOTES ON / KEY TO THIS TEMPLATE: A headline (like a field in a database) will be CAPITALISED This differentiates from the text that follows A variable that you can change will be surrounded by _underscores_ Spaces in variables are also replaced with under_scores This allows people to select the whole variable with a simple double-click A tool-tip is lower case and surrounded by {curly brackets / parentheses} These supply helpful contextual information. -------------------------------------------------------------------------- Copyright shared between all the participants unless otherwise stated...