Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just can't get myself to love JS the way I do other languages... so, this is my current little weekend project.

It's a source-to-source translator so it interops reasonably with JS and should perform similarly also.

The parser is derived from CPython's so that part is relatively complete, but the "backend" isn't done yet. For example, there's not even support for "class" yet.



Very impressive work. But you'll need to implement "import this" for it to be considered a serious Python implementation.


Any support at all for modules is really a requirement to be considered a serious Python implementation.

  >>> import sys
  don't have handler for: import_stmt
But otherwise, neato.


Good point


I was just looking at the source, and I want to compliment you on how good it looks. Very well done -- really organized and thought out with much less hackery than expected (which JS seems to have a tendency to bring out...)


Neat little thing. Feared and appreciated comprehensively.


What version of the language is this and what subset of stuff works, it seems like everything I try gives me some kind of error, maybe I'm just picking the wrong things.

like it lets me create a dictionary but if I try to call the iterkeys() method it doesn't like that, and the built-in function dir() doesn't work. It has range() but not xrange()?

Cool none the less.


The version is the "still lame" version where I haven't implemented those functions yet. :)

Parser-wise it's 2.6.2, but those functions you mention are in C code in real-Python, so I need to (re-)write them in JS. You can see the list of supported global functions and method functions if you grab the source off bitbucket.

(Incidentally, "for x in a_dict" will work the same as iterkeys currently)


Did you evaluate PyPy? I think they already have a significant RPython->Javascript backend.


Link? I don't see it at http://codespeak.net/pypy/dist/pypy/doc/docindex.html#pypy-d... (a js interpreter, but no translator).

If I were to guess, not having seen PyPy's: I'd like something about 100x smaller than PyPy seems to be, and I don't want a mandatory up-front translation "build" step.


Apparently they removed it:

http://www.mail-archive.com/pypy-dev@codespeak.net/msg03946....

That post also mentions Pyjamas, a port of Google Web Toolkit which compiles Python instead of Java: http://pyjs.org/


Well this is very annoying as I had started to use PyPy's Javascript backend in metapaw-dip:

http://www.metapaw.co.uk/projects/metapaw-dip/

I really, really want to do Python client-side (or rather compile Python to Javascript). Javascript is just so painful for me. Being able to test Python code as Python would be the major reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: