Python on Javascript VMs (such as V8)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luke Kenneth Casson Leighton

    #1

    Python on Javascript VMs (such as V8)

    [folks, my apologies for the double-post via comp.lang.pytho n whilst
    my tiny brain works backwards and notices - eventually - that
    comp.lang.pytho n is mirrored from python-list duh]

    On Sep 3, 10:02 pm, bearophileH...@ lycos.com wrote:
    Berco Beute:
    I wonder what it would take to implement Python in JavaScript so it
    1200 lines of code for the compiler, and about... 800 for a basic
    suite of builtin types (Dict, List, set, string).



    so it's been done.
    can run on those fancy new JavaScript VM's such as Chrome's V8 or
    that's been done, too.


    Firefox' tracemonkey. Much the same as Python implementations in C#
    (IronPython) and Java (Jython). It would certainly bring back the fun
    in web application development.
    it's great :) been using it just for fun, for about 18 months.

    and for a personal project

    and for a commercial project which i'm sorry i can't refer you to the
    development site right now.
    Is there anything done in that direction?
    yup. quite a lot.
    see http://groups.google.com/groups/pyjamas-dev
    The mythical beast pypy is supposed able to translate Python to
    Javascript too, I think. From some of my benchmarks Chrome's V8 is a
    little slower than Psyco... so the matter is how much efficiently can
    be Python translated in JS.
    well, the llpamies pyjamas branch from sep 2007 has some definite
    improvements in the _features_ provided (python-wise) but some time
    after that, one too many interoperabilit y features were added (proper
    support for **kwargs) and it just... blew up, got too complicated for
    luiz and he abandoned the effort.

    i've outlined on pyjamas-dev what work needs to be done to satisfy
    both goals of remaining efficient and also providing support for
    **kwargs.

    one _much_ more important requirement - over-and-above
    "efficiency " (which isn't that bad anyway in pyjs.py) is readability.

    remember you have to _debug_ these xxxxing programs .... in
    javascript, not python (which is why i did pyjamas-desktop - http://pyjd.sf.net
    so you could keep on using the standard python interpreter and _then_
    run the same app through pyjs.py to convert it to javascript).

    l.
Working...