Just got back from Pycon UK 2008 - here are some impressions.
During the 2-day conference we met many interesting people, most notably the guys from Resolver, among them William Reade who is working on IronClad -- which implements a fake python25.dll on top of IronPython. He presented some good results for Numpy in his lightning talk. This approach is surely something to follow closely and potentially use for PyPy.
We also had lunch and a couple of chats with Jacob Kaplan-Moss from Django fame - he is apparently up to try use PyPy's sandboxing features for one of his projects, cool!
Conference itself was well organized for the 230 attending people - although the venue might be a bit small for next year's EuroPython. Ah, and we gave three well attended talks, find the slides here:
Holger, Maciej, Anto (associated through merlinux, btw)
The PyPy team is happy to announce the next sprint, which will take place in the Computer Science Department of the University of Düsseldorf, Germany. Sprinting will start on the 6th of October and go on till the 12th. Please arrive on the day before if you want to come.
Topics of the sprint will be aiming at a 1.1 release and to work on integrating PyPy better with small devices. Other topics are also welcome!
We will try to find a hotel with group rates, so if you are interested, please sign up soon! See the announcement for more details.
PyPy and its 14638 automated tests use the py.test tool which is also used by many other projects. PyPy developers have actually driven and contributed a lot to its development. I just released version 0.9.2 of the py lib mainly fixing Windows issues and providing better packaging and integration with setuptools. It's usable completely independently from PyPy - "easy_install py" gives you the py.test command line. Of course you can run py.test on top of a translated PyPy version as well. Here is a quick summary of what the py lib provides besides py.test:
- py.execnet: ad-hoc code distribution to SSH, Socket and local sub processes
- py.magic.greenlet: micro-threads on standard CPython ("stackless-light") and PyPy
- py.path: path abstractions over local and subversion files
- py.code: dynamic code compile and traceback printing support
- tested against Linux, Win32, OSX, works on python 2.3-2.6
A few command-line options for translate.py have changed. Most interesting is that optimization levels are selected with the option --opt, or -O for short. This replaces --allopts, which was also called --faassen in reference to a person who is actually not involved in PyPy (so that was a bit of a strange joke). Also, --allworkingmodules is the default nowadays, and can be cancelled with --no-allworkingmodules. Threads are also included in --allworkingmodules now.
- translate.py (reasonable default, corresponds to --opt=2)
- translate.py --opt=3 (best, maybe 10-20% faster)
- translate.py --opt=1 (translation is faster and less RAM-hungry)
For more information, see:
The EuroPython 2008 conference and sprints have finished - it certainly was
a very eventful and successful conference for PyPy. And many very interesting
non-PyPy talks as well. PyPy presentations are available online: PyPy status talk
PyPy for the rest of us, PyPy behind the scenes. Armin and Maciej also did a well-attended
talk about PyPy's garbage collection, but that was quite interactive, no slides.
The talks were all well visited and we got good questions. However, we still need to work on sorting out the "PyPy technology cloud" and how to present it to different audiences. Anyway, we are happy to hear feedback or questions about the talks!
After the conference there was a three-day PyPy sprint. Despite the fact that most PyPy core developers were zombies, we made good progress. Particularly our newcomers did very well. Here are some results:
- itertools rewritten in RPython for performance by Jakub Gustak and Andrew Durdin
- a new ctypes based dbm and hashlib module, both by Gasper Zejn with support from Henrik Vendelbo, they also got ctypes to nicely work on OSX. (sorry for lack of proper letters in names :)
- implement builtin function call profiling by Stephan Diehl, Antonio and Armin.
- running Pinax on top of pypy-c, by Henrik, Holger, Gasper.
- Jim Baker started a _rawffi.py for Jython using JNA aiming to provide support to run PyPy's ctypes on top of Jython. When Jython gets this to run, PyPy's JVM backend should be able to use it. Talk about Code Reuse :)
- oldstyle classes are now the default, this makes PyPy mimick very closely cpython's 2.5 object model.
- Andrew started a port of the Malbolge interpreter written in Python to RPython (obviously the only missing link for PyPy to take over the world).
- various cleanups (a new option "--lonepycfiles" helps with saner imports, remove int-float comparison shortcuts, ...)
fijal & holger
Last week I played a bit with Fusil, which is a fuzzing framework. The idea is to feed the interpreter code that calls the functions of a module with random values of various types as arguments in the hope that one hits an unchecked case. This is done until a problem is hit , the most common problem being a segfault. Victor Stinner, the author of Fusil, is a regular in the PyPy IRC channel and thankfully helped me getting started with Fusil. I used his project description for CPython as a starting point and tweaked it a bit. Reason is that PyPy is harder to segfault and so I tweaked Fusil to also count uncaught RPython-level exceptions as such a problem. (RPython has full exception support, and if an RPython-exception escapes to the top level, the Python interpreter aborts. One should not be able to exploit this but but for a user it is bad enough, because such exceptions cannot be caught from Python code.)
Using Fusil I found a number of cases where such exceptions happened (in some pickle support-code, in the expat parser, in the os and in the termios module) and also one or two segfaults (in the parser module, of all places). I fixed all these problems so that by now the fuzzer just runs for a very long time and only finds things that take too long (so they count as a way to do a DoS attack) like pow(12355123123L, 12351512123121L) or round(1, 1000000000) (the latter should probably be fixed). This probably just means that the fuzzer is not good enough, because there are certainly segfaults left in PyPy. However, the fact that it is rather hard to find them validates our approach of using a high-level memory-managed language for our interpreter. Victor tells me that it is rather easy to find segfaults in CPython this way, he already found quite some problems.
During the EP2008 sprint we got Pinax running on top of PyPy. At our play1 server we have it running on top of pypy-c. Not that you'll notice many differences to the original site but that's the point, isn't it? ... Well, in fact i am too lazy to customize our play1 version now - i rather spent a nice evening with the other sprint guys :) Pinax integrates numerous reusable Django apps to take care of the things that many sites have in common. Many thanks particularly to Henrik Vendelbo who sorted out various Pinax and PyPy issues, and wrote up a nice DjangoAndPyPy wiki page describing the installation process. greetings from Vilnius (Lithunia), Holger
One of the great events at EuroPython 2008 were our chats and meetings with the Jython and Sun people. The Jython people recently are pushing into releasing Python version 2.5 and they currently pursue many interesting sub projects. Coincidentally, PyPy also has tons of interesting areas and results :) So we eventually got into brainstorming a number of possible technical collab ideas. Further below is a first list as i wrote it down from our 10 people PyPy / Jython 30 minute close up meeting yesterday. It felt great to be able to talk to the Jython people this way - kudos to Sun for their clear commitments and open ways to go about things! I sense a genuine interest on fair collaboration with non-java developer communities. Seems like they are serious about not focusing on "Java this", "Java that" anymore but rather focus on the JVM platform. Good! And about language independent interest in ambitious technology. Even Better! I am tensed to see how things go from here. So here the list of technical collab ideas:
- ctypes - try to create _rawffi module in Java for Jython, which will enable Jython to reuse our existing ctypes implementation (and have PyPy use the Jython-rawffi for its own for PyPy.JVM)
- generally see to share work / (continue) collaborate regarding extension modules
- Jython/PyPy (and eventually IronPython): document known differences to CPython, maybe in a PEP
- Python Interpreter for Jython (in order to run CPython's .pyc files): re-use pypy's bytecode evaluator, implement a "Jython object space".
- re-use rpython-extension modules for jython (e.g. SRE), by compiling them to Java and reusing as a native library.
- collaborate on testing framework / benchmarking, have a common site to show test results
- make py.test compatible with jython
- come up with a set of "pure Python language" tests, which would gather and refactor tests from CPython, PyPy and Jython.
- look into using java types / jython approaches for implementing free threading.
- share knowledge regarding JIT / psyco
Greetings from Vilnius, Lithuania. There were already
two pypy talks, one performed by Jacob Hallen
PyPy for the rest of us and second
by Maciej Fijalkowski PyPy status talk. The thing that
we forgotten to tell is that PyPy sandboxing feature
can also easily limit CPU and RAM usage as well as
any other possible resource (like network transfer).
For anyone who would like to join, there is a PyPy
sprint after the conference.
arigo & fijal