[BangPypers] Python app in a browser sandbox?

Jeff Rush jeff at taupro.com
Fri Feb 22 19:28:29 CET 2008


logan wrote:
> Hello Prashanth,
> 
>> You could use IronPython + Silverlight for an application sandbox
>> within a browser.
> 
> That's interesting. But the whole point of going to Python was to avoid 
> using MS specific technologies. If I have to use Silverlight then I would 
> prefer writing a .NET wrapper for my C++ library. BTW, what are the licenses 
> related issues in using Silverlight? But I hope I don't have to take the MS 
> route and instead use Python to get the job done.

I'm afraid what you want is not possible, for a number of reasons.

First off, running simple Python code within the browser is not a mature 
technology.  While there is a long-term project, called "PyXPCOM" for running 
Python inside a Mozilla-based browser, it (a) doesn't address non-Mozilla 
browsers, (b) is still immature and not well documented, and (c) is not 
already installed on the mass market of Mozilla browsers.

Second, is that the audio interfaces are not _at all_ standard across 
platforms and Python does not provide a seamless interface that masks these 
differences in its standard library.  If you've managed to do so within your 
C++ library, it'd make a nice addition to the standard library.

And last, you mention you have a C++ library you have wrapped.  Unfortunately 
C++ is poorly standardized at the OS/library level (C is much better) but your 
real problem is that, once C or C++ is compiled, it is tied to a specific 
operating system and so visitors to your website running a Mac won't be able 
to execute the binary code you wrote under Windows.  You could bandage it by 
trying to detect their OS and supplying a version for each flavor, but 100% 
reliable detection is hard and there is such a variety of binary-level APIs 
out there (at least 7 just for Windows, 8 for Linux, 5 for Mac or so).

I wish there were a solution like you need.  I've wanted one for many years 
but the browser/OS wars just won't permit one.  Another solution is to build 
something using Macromedia flash, as they provide a crude audio interface but 
that won't be in Python, many people refuse to run flash for legal and 
security reasons, and you'll be dependent on particular versions of flash. 
And then there may be some Java solutions, but you still won't be able to run 
your C++ executable in all browsers.  Cross-platform multimedia is HARD.

-Jeff


More information about the BangPypers mailing list