Even though I was in holidays recently, I spent some time to have a look at the update from the
pypy project.
I get really excited by what the project has achieved so far.
Pypy is a python interpreter written in python.
The most interesting part of the project is the ability to use it to translate python code into other languages, like C, java, javascript, and LLVM.
So far only a subset of python language is translatable (for example generators won't work.) [
edit: as the pypy people pointed out, full python language will
never be translatable, that is not the goal of the project.]
But this simplified python (called RPython) is already good enough for many projects. As an example pypy interpreter itself is written in RPython and so can be compiled into machine code.
The good thing about this is that you can develop an application totally in python and then use the translators to generate fast machine code. So python could become some sort of universal language that replaces all other languages.
An other interesting things about pypy is the ability to generate stackless code, that allow many cool things, like tasklets (see the
documentation about this).
Now I can't help thinking about OpenMoko paroli project, that uses python and tasklets. Could it be possible to use pypy to translate the python code into machine code and so create optimized version of paroli ?
The idea is very seducing, but many problems would need to be solved before we can get to there. The first thing is that we would have to modify our code to remove all the things that are not supported by pypy.
The second things is that even though pypy supports tasklets, it is impossible to do it using the python yield statement and the trick explained in
PEP342.
An other good use of pypy would be to create web application without having to write -quite ugly- javascript code.