Python to JavaScript Compiler? Anyone written such a beast?

Discussion in 'Python' started by kenneth.m.mcdonald@sbcglobal.net, Sep 14, 2006.

  1. Guest

    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
    , Sep 14, 2006
    #1
    1. Advertising

  2. Steve Holden Guest

    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
    Steve Holden, Sep 14, 2006
    #2
    1. Advertising

  3. Ben Finney Guest

    writes:

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


    You may be looking for Pyjamas:

    <URL:http://pyjamas.pyworks.org/>

    --
    \ Hercules Grytpype-Thynne: "Well, Neddie, I'm going to be |
    `\ frank." Ned Seagoon: "Right, I'll be Tom." Count Moriarty: |
    _o__) "I'll be Gladys." *slap* -- The Goon Show, _World War I_ |
    Ben Finney
    Ben Finney, Sep 14, 2006
    #3
  4. fijal Guest

    fijal, Sep 14, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. joker

    Footer, the beast

    joker, Aug 24, 2007, in forum: HTML
    Replies:
    14
    Views:
    648
    joker
    Aug 26, 2007
  2. Helmut Jarausch

    module finalizer - is there such a beast?

    Helmut Jarausch, Jan 11, 2008, in forum: Python
    Replies:
    2
    Views:
    239
    Peter Otten
    Jan 11, 2008
  3. Ben Giddings

    indent.rb <- does such a beast exist?

    Ben Giddings, Mar 4, 2005, in forum: Ruby
    Replies:
    4
    Views:
    125
    llothar
    Mar 6, 2005
  4. baalbek
    Replies:
    7
    Views:
    116
    baalbek
    Mar 13, 2006
  5. Simon Krollpfeifer

    Beast - stack too deep problem

    Simon Krollpfeifer, Jul 9, 2008, in forum: Ruby
    Replies:
    1
    Views:
    114
    Roger Pack
    Jul 10, 2008
Loading...

Share This Page