[Idle-dev] The Future of Python

Bruce Sherwood Bruce_Sherwood at ncsu.edu
Thu Feb 6 19:31:45 CET 2014


I was surprised that in talking about the future of Python Jessica didn't
touch on what may be really crucial, which is the importance of being able
to use Python in client-side browser programming. Running in a browser is
of rapidly increasing importance and Python could easily get left behind.
There exist multiple projects whose goal is to be able to compile Python to
JavaScript to address this issue. It looks to me like Brython may be the
best bet, in that it seems to be an active development with a small but
growing community of interested parties. What do you think about this,
Guido?

I'll mention that with the aid of Steve Spicklemire VPython has been
converted to be based on wxPython, which was vital in order to get off
Carbon and onto Cocoa on the Mac, and which also makes it possible to use
wxPython widgets with VPython 3D canvases. I'm happy to report that in the
last six months there were nearly 50,000 downloads of VPython, and that
it's now featured in four (soon to be five) computational physics textbooks.

Inspired by VPython, with a big initial push from David Scherer, the
originator of VPython, I'm developing GlowScript (glowscript.org) where you
can write VPython-like 3D animations using WebGL, writing in JavaScript or
CoffeeScript. A minimal program is the single-line program

box()

This program places a WebGL canvas in the window, displays a cube in the
window, creates lights to illuminate the scene, places the camera so that
the cube fills the window, and enables mouse interactions to zoom and
rotate. You can of course control all of these elements, but there are lots
of good defaults to get going easily. Needless to say writing WebGL
programs with other tools is vastly more difficult.

It's already the case that it's very nice to be able to send a URL in an
email and have the recipient click that link to see a 3D animation rather
than asking them to install Python and VPython. Here's a simple example
that will run in WebGL-enabled browsers:

http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/Bounce-CoffeeScript

Many more demo programs are available at glowscript.org.

However: I don't like the syntax of JavaScript, especially for novice
programmers, and even though CoffeeScript is more Pythonesque its syntax
and use of white space is kind of quirky and, I judge, not good for
novices. I would love to enable Python as one of the languages (indeed the
major language) for novices and experts to write GlowScript programs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20140206/946aac8c/attachment.html>


More information about the IDLE-dev mailing list