Python, client side: Skulpt
skulpt.org
skulpt.org
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.
>>> import sys
don't have handler for: import_stmt
But otherwise, neato.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.
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/
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.
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)
Requires Silverlight, but is far more complete as it wraps IronPython. I think its quite neat what you can do with silverlight even if its EEEEVIL MS tech.
Another cool SL trick: http://www.mix09.org/labs/gestalt/samples/canvas.2d.drawing/...
Using Python inline in your html via Silverlight and a helper JavaScript called "Gestalt". It also supports Ruby.
Or is Silverlight not really a browser plugin like Flash?
(As is probably obvious, I'm totally ignorant of how browser plugins, Flash, Silverlight, and most other things work.)
I don't use it, but the trypython.org page has a statement:
"Target browsers are Firefox 2 & 3, Safari and IE 7 & 8. (It won't work in other browsers until there is a version of Silverlight that works with them.)"
I'm still curious about why Silverlight works for, say, Firefox on OS X, but not Firefox on Linux. I understand that Microsoft probably wants to prevent Silverlight from working on Linux, but I'm curious whether it's something hard to do because Linux doesn't have X, Y, and Z that Silverlight requires, or is it relatively easy to do (if you had control of the codebase).
http://www.mono-project.com/Moonlight
I've never used it before, so I don't know how well it works or anything.
Thanks.
Anyway, very neat project! How layered is it -- do you think it could approach the speed of JavaScript?
http://github.com/tlrobinson/cappruby
(disclaimer: it's horribly incomplete and I haven't touched it in months)
ObjJ and Capp were my inspiration for doing a browser language without an offline convert process, so... thanks :)
I was wondering if I could use Cappuccino as the "Skulpt GUI toolkit" too, but that might start to get a bit silly with number of layers involved.
I tried it in both Firefox 3.5 and Safari 4, and neither works.
Apparently it's not just this site, though. According to http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f... it's only sending a shift (KeyCode 16) when I try typing a colon...
On my Ubuntu system, the colon works just fine. Is this a known bug?
I haven't found a non-insane way of doing it.. see f.e. http://www.quirksmode.org/js/keys.html
Anyone have any pointers? (or patches? :)
>>> print 1, 2, 3
1 1 1Is this a problem on my end? FF3.1 Leopard.
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!
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.
>>> from __future__ import braces
don't have a handler for: import_stmt
Looks nice, still a lot to do.site looks down though..