[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame webplugin



The C Python implementation can not currently be sandboxed in a way that makes this feasible. Brett Cannon has recently started working on a dissertation for a new restricted execution design [1], but don't hold your breath.

A more viable solution would probably be to write a Python to haXe [2] translator (maybe a PyPy backend). Then you could compile down to ActionScript and run it in the Flash player, which has extremely high penetration and would be much better than trying to get users to install some crap just to play your game in a browser. The ActionScript 3 VM in Flash 9 is quite fast and would be suitable for pygame-like applications. This is of course non-trivial, but it would be a really exciting project if someone is so inclined. ActionScript 3 bytecode could also be used directly, but haXe would give you _javascript_ support for free as well.

This of course wouldn't get you SDL/pygame, but it wouldn't be hard to write something API compatible with pygame that used something else as a backend.

A somewhat easier alternative might be to write something API compatible with pygame that worked on top of Java via Jython. However, Java applets are much more annoying than Flash (longer load time, etc.).


-bob

On Jul 8, 2006, at 2:45 PM, machinimist@xxxxxxxxx wrote:

i see. isn't there a way to block modules from being importable somehow? and only allow the absolutely needed and secure ones?
 
the same problem also exists with standalone pygame applications though, or not? someone could make a game that formats your harddisk? but with a webplugin it would be more serious since you potentially reach a bigger audience and it runs automatically?
 
On 7/8/06, Luke Paireepinart <rabidpoobear@xxxxxxxxx> wrote:
machinimist@xxxxxxxxx wrote:
> hi,
>
> with google i came across various hints that people work on a pygame
> webplugin. what did happen to these projects?
>
> i think having a python alternative to flash and java applets would be
> awesome! :)
>
> what are the difficulties involved in doing such a webplugin? i guess
> if it were easy it already would have been done?
The biggest problem I see is security.
What keeps the web programmer from doing an os.popen("FORMAT C:/") or
whatever?
you have to go through every function and make sure it's not a security
risk, and if it is, eliminate it.
Whitelisting would be the answer here I think, blacklisting would take
too long.
But yeah, being able to do animations in python would roxxor.