[Web-SIG] Clientside Python

Robin Bryce robinbryce at gmail.com
Sat Jun 23 12:21:58 CEST 2007


> is available. But one thing is missing: client-side python-scripting in
> the web-browser!

You might be interested in Brett Cannons work see:

http://mail.python.org/pipermail/python-dev/2006-June/066344.html

AIUI: The restricted execution issue needs to be addressed before
anything else can happen along the lines you suggest.

On the other hand its going to be very interesting to see the impact
this has on browser scripting http://www.mozilla.org/projects/tamarin/

The browser / http platform is a _very_ big tent and python is just
one player. In the long run I (wildly) speculate that techniques like
those employed by PyPy (which has a js backend ISTR) will make the
question of which browser scripting language is supported a moot
point.

Interfaces & standards are a different issue though.

> fully-compatible DOM-Implementation, XMLHttpRequest and some kind of
> wrapping middleware which acts as the interface for the specific
> browser.

DOM - surely there is one around somewhere ?

XMLHttpRequest - writing a library that wraps urllib2/httplib (from
the standard lib) could be a good place to start.

> object which does the same for upload. Example: I want to upload a big
> pdf file in my plone site. This usually takes time, lots of time. It is
> possible to do this asynchronously with nasty JavaScript hacks

nasty JavaScript hacks ? Pushing or streaming data from the client
side using XMLHttpRequest is *not* a java script hack - it's a http
hack ;-)

Have fun :-)

Robin

On 23/06/07, Sascha Peilicke <sasch.pe at gmx.de> wrote:
> Hello,
>
> Hello, hopefully this is the right place, I would like to propose a new
> application area for Python. But lets start from the beginning. Python
> already started to conquer the server-side via all those cool frameworks
> (Django,Pylons,TurboGears,...), basically everything related to networks
> is available. But one thing is missing: client-side python-scripting in
> the web-browser! Think about it, there are basically only two languages
> usable for this purpose, VBScript, no option. JavaScript, the status quo
> but it is more a thing one has to work with and not want to work with.
> Like these guys from the MochiKit framework " ... make JavaScript suck
> less" and it really sucks! Wouldn't it be cool to have our favorite
> language at hand when developing a web-app?
> I am not sure about how difficult this task could be. The interpreter
> runs on every platform which can run a browser, it can be embedded in
> basically every kind of software. The thing to do would be creating a
> fully-compatible DOM-Implementation, XMLHttpRequest and some kind of
> wrapping middleware which acts as the interface for the specific
> browser. I tried to do some programmer's art:
>
> -----------   --------------  ------------------------
> | Browser |   | Middleware |  | Python-Interpreter   |
> |         |===| (glue code)|==| DOM-Stack            |
> -----------   --------------  | Reduced Standard-Lib |
>                               | XMLHttpRequest       |
>                               | ...                  |
>                               ------------------------
>
> Then the following will become possible then:
>
> ...
> <script type="text/python">
>    def compute():
>         2*3
> </script>
> ...
> <div onload="compute"></div>
> ...
>
> Altough I see a slight problem: correct indentation, which is important
> for python code inside <script> tags. I am sure this could be solved
> somehow. Another point: License, we can't say just GPL or free licenses
> in general, to become successfull it has to work in proprietary
> browsers, a thing to talk about. As a last point we could implement a
> unique feature, let me explain that point. Everybody knows the
> XMLHttpRequest object, which made Web2.0 possible. It is cool to do
> asynchronous request but only for the download direction. What about an
> object which does the same for upload. Example: I want to upload a big
> pdf file in my plone site. This usually takes time, lots of time. It is
> possible to do this asynchronously with nasty JavaScript hacks
> (toghether with an iframe..). I call it XMLHttpResponse :)
>
>
> I am looking foward to hearing from you, all the best,
> Sascha Peilicke
> --
> http://saschashideout.de
>
> _______________________________________________
> Web-SIG mailing list
> Web-SIG at python.org
> Web SIG: http://www.python.org/sigs/web-sig
> Unsubscribe: http://mail.python.org/mailman/options/web-sig/robinbryce%40gmail.com
>
>
>


More information about the Web-SIG mailing list