Python to JavaScript Compiler? Anyone written such a beast?

Steve Holden steve at holdenweb.com
Wed Sep 13 22:22:05 EDT 2006


kenneth.m.mcdonald at sbcglobal.net wrote:
> Of course, I'm not talking about something that would transform
> any Python code into semantically JavaScript code, but simply
> something that would analyze a "restricted" Python source file,
> and spit out equivalent JavaScript. The big advantage (as far
> as I'm concerned) is that one could make use of some of the
> syntactic shortcuts that JavaScript doesn't offer, that the Python
> syntax checker generally does a better job than the JS one, and
> (perhaps most importantly) this could be configured to put in 'instrumentation',
> such as checks to make sure than an attempt to access an undefined
> attribute actually throws an error.
> 
> Color me curious,
> Ken
> 
Take a look at the PyPy project, which has produced a JavaScript 
back-end (thugh I suspect it's more of a curiosity than a practical 
solution). It might suit your needs, though, and they've had a Summer of 
Code project going on it.

     http://codespeak.net/pypy/dist/pypy/doc/news.html

and specifically

     http://codespeak.net/pypy/dist/pypy/doc/getting-started.html

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list