[ANN] pyjamas pyv8run converts python to javascript, executes under command-line

lkcl luke.leighton at googlemail.com
Fri Sep 18 17:17:59 EDT 2009


just for fits and giggles and also because i'm getting fed up of using
web browsers as part of the pyjs development cycle instead of the
command-line, the pyjamas pyv8run.py has been brought back up-to-
scratch, and can now execute the pyjamas LibTest regression tests with
a 99.95% pass rate.

pyv8run is a back-to-back combination of google's v8 engine + a
library by flier liu which makes extensive use of python-boost (http://
code.google.com/p/pyv8) + the pyjamas python-to-javascript compiler.
the initial experiment some months ago, with pyjamas 0.5, produced a
python ACcellerator with a 10x performance increase; the latest
0.6~svn pyjamas compiler results in a python DEcellerator with a
[finger-in-the-air] 10x performance DEcrease, thanks to the addition
of several python strictness features.  hurrah! :)

perhaps it is the fact that the 0.5 test used google's stable x86
libv8, and the 0.6~svn test used google's alpha-release of amd64 libv8
- who knows, who cares, it's just hilarious to convert arbitrary
python code into javascript and have it do 99.95% the same job.

on the roadmap of this sub-sub-project of pyjamas is:

* to throw pyv8run at the standard http://python.org regression tests
and see what sticks

* to improve the pyjamas compiler and/or alter the adapted lib2to3
parser/AST library in order to create a stand-alone, self-bootstrapped
_javascript_ version of the pyjamas python-to-javascript compiler.
this is _mandatory_ in order to support "eval" and "exec" - execution
of python _source_ code - inside web browsers (and under a js> prompt
such as spidermonkey or d8)

this latter goal has already been hilariously achieved by the
(completely independent) skulpt project: http://skulpt.org/ whose
parser/AST code the pyjamas project has borrowed - and back-ported
from javascript to python.  you can see their demo python prompt on
the main page, and use it to mash your own web browser of choice into
submission.

the pyjamas project is taking a slightly different approach to achieve
this same goal: beat the stuffing out of the pyjamas compiler, rather
than hand-write such large sections of code in pure javascript, and
double-run regression tests (once as python, second time converted to
javascript under pyv8run, d8 or spidermonkey).

anyway, just thought there might be people who would be intrigued (or
horrified enough to care what's being done in the name of computer
science) by either of these projects.

l.



More information about the Python-list mailing list