Python on JavaScript VM's (such as V8)?

lkcl luke.leighton at googlemail.com
Mon Oct 13 11:09:01 CEST 2008


On Oct 7, 10:15 pm, Fuzzyman <fuzzy... at gmail.com> wrote:
> On Oct 2, 1:06 pm,lkcl<luke.leigh... at googlemail.com> wrote:
>
> > On Sep 3, 10:02 pm, bearophileH... at lycos.com wrote:
>
> > > Berco Beute:
>
> > > > I wonder what it would take to implement Python inJavaScriptso it
>
> >  it's been done.  http://pyjamas.sf.net
>
> That's hardly an implementation of Python inJavascript-

 someone _is_ considering validating the pyjs.py interpreter to ensure
that it's NP complete.  however, it's an academic exercise that's not
driven by an actual real-world need.

 basically, running pyjs.py and the standard python 2.5 "compile"
module under pyv8.  just for kicks :)

 so, the beginnings of the process - to bootstrap your way entirely
into javascript-land, where you'd be able to "input" python and have
it compiled _to_ javascript _by_ a python-to-javascript compiler which
_itself_ has been compiled to javascript - the foundations have been
laid.

and it's not _as_ crazy as it sounds.  sufficient tests to demonstrate
unequivocably that the equivalent javascript _is_ equivalent; you then
have pyv8 empirically demonstrating a ten times - TEN times for
goodness sake - performance increase - that's got to be worth it.

especially if it can be done "automagically", behind the scenes, so
that when you type "python myapp.py" instead of executing forth-like
byte code (myapp.pyc) you "execute" javascript (myapp.pyj).


> it's a
> partial Python toJavascripttranslator.

 compiler.  python to javascript _compiler_ :)

 with a more complete python-to-javascript compiler in http://code.google.com/p/pyjamas
subversion - you'll need the llpamies branch, but you'll _also_ need
to go back to around sep 2007.  somewhere in between then and now,
luis tried to add proper support for **kwargs and he didn't complete
it.


> Still looks good though.

 yeh :)




More information about the Python-list mailing list