[pypy-dev] Testing generated JavaScript code

James Ascroft-Leigh jwal at jwal.me.uk
Sun Sep 9 17:38:14 CEST 2007

Hi all,

I am interested in the potential for PyPy to run python code within
the web browser using, at least as a fallback, the JavaScript
interpreter.  I have my own project (very immature and not yet usable)
to try an achieve just this goal and, like PyPy, my tests exercise the
generated JavaScript code using an external interpreter (currently

I am just writing to let you know about this great project I
discovered the other day called jpype (http://jpype.sf.net/) that lets
you interact with an in-process JVM.  Now that the JVM includes the
Rhino JS interpreter I am going to switch my tests over to using this
to run my generated JS code.  This allows a higher level interaction
between the languages because you no longer have to serialise the
output of the script to stdout and de-serialise it to compare to the
expected output.

Maybe PyPy could do the same?  I might get time to post a patch for
this but, as the attached snippet shows, it is not too hard to get
started so somebody else might want to do it sooner.  What do people
think about adding a testing dependency on the JVM and this jpype


-------------- next part --------------
A non-text attachment was scrubbed...
Name: rhino.py
Type: text/x-python
Size: 464 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20070909/377f0033/attachment.py>

More information about the Pypy-dev mailing list