[Web-SIG] Clientside Python

Johnny deBris johnny at debris.demon.nl
Sat Jun 23 17:15:50 CEST 2007


Sascha Peilicke wrote:
> 
> ... Wouldn't it be cool to have our favorite
> language at hand when developing a web-app? 

If you're don't mind having a bit of a different model, PyPy might be
interesting for you. They have a (relatively complete) Python to
JavaScript convertor, which allows you to write and test your code in
RPython, a subset of Python that's a little less dynamic (so not Python
syntax with JS semantics or anything), and when done convert it to
JavaScript to execute in the browser.

Although the feature is not as mature as some other parts of PyPy, and
even though RPython is by far not as nice to write and debug as Python
is, it's not a bad platform to work on (well, not as bad as JS is
generally percieved at least ;) and there are some nice additional
tricks provided too (such as a simple RPC thingie over
XMLHttpRequest/JSON). Also, there are DOM and XMLHttpRequest wrappers to
allow testing client-side code in a plain interpreter, which might be
useful for you to base your code on if you decide to give it a go...

For more information, see
http://codespeak.net/pypy/dist/pypy/doc/js/using.html

By the way, there once was an Active-X plugin for Python too, but iirc
that was cancelled because it's very hard, if not impossible, to sandbox
the interpreter properly...

Cheers,

Guido Wesdorp


More information about the Web-SIG mailing list