why there is no pythonscript insine web browsers?

Diez B. Roggisch deets at nospam.web.de
Tue Nov 13 06:08:53 EST 2007


bramble wrote:

> On Nov 13, 3:07 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
>> On Mon, 12 Nov 2007 20:07:38 +0200, Timuçin K?z?lay
>> <t... at savaskarsitlari.org> declaimed the following in comp.lang.python:
>>
>> > python support? there is even a vbscript support inside MS-IE but there
>> > is no python support. it would be really nice and easy for me to use
>> > python instead of javascript to write those ajax scripts.
>>
>>         Javascript is meant to, basically, control the browser and the
>> contents of HTML pages sent to it. [snip] Python can not
>> be safely sand-boxed (and the early restricted mode modules have been
>> removed for that reason).
>>
> 
> Why can't it be safely sandboxed?
> 
> That is, why not just have a Python interpreter and some safe subset
> of the Python standard library run with the browser? I mean, aside
> from the work involved with combing out the unneeded or dangerous
> parts of the standard lib, it seems like it would be much nicer to
> just use Python syntax and modules rather than having to fool around
> with Javascript.

The problem is that building such an environment would mean building it up
from scratch instead of trying to secure the existing one - wich quite a
few people tried, and failed.

So it's more than "just" creating a sandbox, it's keeping track with
CPython's language features and lib-advances as well.

There are two projects I aware of that might help, IronPython & Jython. The
latter had some hard times getting up to python 2.2 (important for the new
style classes support), but now it's finished in that respect so hopefully
we will see more frequent releases of it, with newer python version
support.

And all this still doesn't tackle the fact that at least one, not to say THE
browser vendor won't adopt python just for the fun of it - they even don't
taclke the flaws of the existing product.

Diez



More information about the Python-list mailing list