Thursday, July 12, 2007

On the "multiplatformness" of Python

I will allow my self to stray a little bit away from my normal focus of posting about science-related pythonic stuff, to raise a question that has been on my mind lately: the future of Python. No, it's not about Py3K!

One of the strong selling points of Python, in my opinion, is its support for multiple platforms. If you write a pure Python program you can run it on just about any OS/hardware combination. Nowadays, however the concept of a "platform" is shifting away from its usual meaning of an OS+CPU combination. The web, i. e., the browser is becoming the "platform of choice" by projects that, maybe 5 years ago, would be done in Python as a desktop application.

What worries me, is that while Micro$oft(silverlight), Adobe(Air), and others are investing heavily in adding support for their development languages and tools to the "new platform", the Browser apparently does not figure in Python's plans for the future.

I think that is a pity, because Python is the best suited language, in my opinion, to unleash the power of the browser platform, with its "batteries included" and easy-to-learn nature. I shiver at the prospect of having to depend on Jython or IronPython to be able to have my python code run from within a browser. Python should be aiming for the place Javascript occupies right now.

So, thats my lament... I hope that Python developers, after reading this post tell me I am wrong. That projects like MozPython should have never been abandoned, and that we can hope that exciting projects, like Crunchy, will one day, be runnable from within the browser.

15 comments:

Unknown said...

You do know about the pypy javascript backend, right?

Paul Prescod said...

Funny how not much changes over 15 years or so.

There are two obstacles to getting Python into the browser, just as there were 15 years ago. First, making Python appropriate for usage there (security being the key but not exclusive issue). Second, getting browser vendors to bundle it. Unless you have a magic plan for the second problem, work on the first is probably not worth undertaking.

It isn't particularly interesting to have Python in one browser or another, nor to have plugins for it. For it to be relevant, it needs to have >95% penetration as Javascript and ActionScript do.

Phenix2013 said...

Dude, your blog really hurts my eyes! Please consider changing the template!

Regards,

Timmy Jose.

Michael Foord said...

IronPython through Silverlight is well integrated with the browser.

Why does that make you shiver? IronPython is just Python - and a pretty recent Python too...

Perhaps you should try it. You can't use a lot of CPython extensions, but if you had a sandboxed CPython that would also apply.

Mozilla have a 'new idea' about embedding Python (soon to be announced) and it won't be CPython I'm afraid. It will still be good though...

Chris said...

Python's dependence on whitespace might hurt it as a client side language. What makes JavaScript such a good choice is that semicolons survive a hostile environment where you can't count on formatting especially considering all the mashup / hodgepodge web sites that are currently in vogue.

I'm not trying to bash Python as like it very much but I think that whitespace will be an issue.

Are you suggesting it's use in another way besides a drop in replacement for JavaScript?

Unknown said...

jchu,

I know about pypy' javascript backend, lets hope it matures soon. but I am not sure it will ever address the translation of projects which depends on extensions modules...Especially not pure-python ones...

Unknown said...

Fuzzyman,

My problems with IronPython is that its development is not guaranteed to always serve the interests of the Python Community, since it is controlled by M$.

I don't like to rely on technologies that aren't open (in the truest sense, not some crappy shared source licence from MS)

Jython would be a far better alternative, if only it got the development effort it deserves...

Unknown said...

Pragmatic, You have a good point with the white spaces, but the puthon code could be inserted into webpages as bytecode (pyc) and not pure source. (Though I am not sure it would solve the problem entirely,)

I am looking not necessarily for the displacement of Javascript, but the execution of any python code straight from the browser, with possible access to extension modules installed at the client's box (like crunchy does).

Anonymous said...

Well, javascript is a pretty darn nice language, it mostly suffers from a borked standard library.

Javascript is already borrowing ideas from python so it shouldn't take much to create a fork of it... a "pythonic" javascript let's say.

We could licence BSD style write an IE plugin and offer it for free to MS (*and* MS users), MS could see the value in this and adoptit.

But doing that would be moot, the real nice thing Silverlight (or Moonlight) is not the language or the syntax, its that it runs on the local .NET (or MONO) and has access to the installed .NET standard library including, probably sandboxed, versions of System.IO which is a very dangerous tool.

Think about it. MS tried to create a word processor, and ended up creating the greatest virus vector of all time, until it made a web browser, and then a mail client.

Do you think they will succeed at securing Silverlight?

It might be more wise to shy away from that execution model...

Michael Foord said...

"not some crappy shared source licence"

What is it about that license that you don't like - other than the fact that it is from Microsoft ?

If you want a more open version then there is Mono and Moonlight.

Do you really not trust Jim Hugunin's commitment to Python?

Unknown said...

I trust Jim, I just don't trust his boss!
;-)

Unknown said...

I can't find any information on this pypy javascript backend? Can you guys explain it or provide some links?

Unknown said...

Pypy is able to convert simple python programs into javascript. That's all.

You can find some more information in the docs for PyPy 1.0

Luis said...

I believe this time, Microsoft got it right. I think Hugunin, as well as John Lam (developer of ironruby), are people who really understand the comunities around their languages, and they would never do anything to hurt their susceptibilities (sorry, is this a word? :-).

It's in the best interest of Microsoft to support and respect these comunities, because they have nothing to win with a forked or modified version of the language. They are not selling languages, they sell tools and platforms!

Luis said...

By the way, the future of python in the browser looks brighter than ever.
Look at Mozila's new project to integrate Ironpython to the Tamarin virtual machine (yes, I said "Iron" python).
If this project comes to an end, it will run on Firefox as well as IE.
Also Silverlight is a reality, and it runs on both browsers.

ccp

Amazon