Python+Pyjamas+V8=ftw
inhahe
inhahe at gmail.com
Wed Nov 26 15:20:58 EST 2008
I don't know how much the community knows about this - i haven't been
participating much of late - but here's something amazing.
Apparently javascript is just as dynamic as python, because someone made a
python-to-javascript converter in just 1200 line (pyjamas). Meanwhile
google's new javascript engine (v8) blew all the others out the water,
raising the bar - and now safari and firefox already have already risen to
that bar with their own jit js engines.
The exciting thing is that python code converted to javascript runs on v8 10
times faster (http://www.advogato.org/article/985.html).
Thus google's strategy in making the JIT compiler represents what Python
could (and should) be. Python should either adapt v8, Tamarin
(http://en.wikipedia.org/wiki/Tamarin_(JavaScript_engine), or similar to
make its own JIT, or take their basic principles
(http://www.youtube.com/watch?v=lZnaaUoHPhs) and recreate them for its own
JIT from scratch.
Until then, we can always install v8/tamarin/tracemonkey/squirrelfish and
easily make a front-end that automatically uses pyjamas to convert python
script to JS and runs it. Perhaps pyjamas needs some improvement to fully
implement Python - the homepage isn't very clear on how exactly the JS
implementation mirrors the Python implementation. Also I suppose it doesn't
support Python 3.0 and would have to be changed to support that.
More information about the Python-list
mailing list