Python, client side: Skulpt
11–20 of 43 posts
Re: Python, client side: Skulpt
#12Along with hn user pmorici I'd like to find out what subset of Python this supports.
Re: Python, client side: Skulpt
#13I 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.
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.
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)
Re: Python, client side: Skulpt
#14In Opera 10 b2, the python shell never seems to grab focus correctly, so pressing space will scroll down the page way past it, making it very fiddly to use! Along with hn user pmorici I'd like to find out what subset of Python this supports.
From the look of it I'm telling MooTools to stop that event, but backspace doesn't seem to stop in Opera either. Maybe they don't want people disabling keyboard navigation maliciously?
edit: re: subset, my intention is for source-level 2.6 compatibility with the core language, but that's definitely far away.
Re: Python, client side: Skulpt
#15Re: Python, client side: Skulpt
#16I 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.
Re: Python, client side: Skulpt
#17I'd actually love to create a "GWT like" that would compile my python (in javascript/html/css) for the different browsers out there. That would be awesome.
GWT is nice and all, but python >> Java...
Re: Python, client side: Skulpt
#18Doing the source-to-source translation on top of the javascript on the client side is quite neat. I'd actually love to create a "GWT like" that would compile my python (in javascript/html/css) for the different browsers out there. That would be awesome. GWT is nice and all, but python >> Java...
I used pyjamas a while back for a couple toy projects. It's quite nice and sounds like what you're looking for.
With Skulpt, I wanted to avoid the build step that Pyjamas has (the compiler's written in Python, not Javascript so you run it ahead of time) and at least when I used it, it sometimes felt like Javascript with Python syntax, rather than actually programming in Python. It's certainly closer to Python than Skulpt is today though!
Re: Python, client side: Skulpt
#19Re: Python, client side: Skulpt
#20Anyway, very neat project! How layered is it -- do you think it could approach the speed of JavaScript?