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

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

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

 someone _is_ considering validating the 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 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

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" 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
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

> Still looks good though.

 yeh :)

More information about the Python-list mailing list