[Idle-dev] The Future of Python

Bruce Sherwood Bruce_Sherwood at ncsu.edu
Mon Feb 17 15:54:16 CET 2014


Here's a welcome surprise. Thanks to quick work by Brythonist Billy Earney,
with tweaks by me, the zip file below contains a demonstration of a Python
program driving WebGL in a browser, using the Brython and GlowScript
libraries. Unpack the zip file, execute server.py, open a browser, and go
to "localhost:8000/bounce.html". If you have a WebGL-enabled browser and a
GPU-based graphics card, you'll see a standard VPython/GlowScript demo, a
ball bouncing around in a box, with instructions on how to rotate and zoom
the camera.

Then inspect the contents of bounce.html, where you'll see standard Python
syntax.

There's plenty more to do, but this looks very promising.

Bruce

https://dl.dropboxusercontent.com/u/18859068/brython_glowscript.zip


On Mon, Feb 10, 2014 at 9:34 PM, Guido van Rossum <guido at python.org> wrote:

> You've convinced me that brython is interesting. I still think it would
> require a miracle for it to become mainstream, but it has a better change
> than pythonb.org. :-)
>
>
> On Mon, Feb 10, 2014 at 3:35 PM, Glyph <glyph at twistedmatrix.com> wrote:
>
>>
>> On Feb 10, 2014, at 5:19 PM, Guido van Rossum <guido at python.org> wrote:
>>
>> Then we're doomed, because this is entirely political (the companies
>> making browsers must want to do it).
>>
>>
>> Not at all.  There are a number of promising proofs of concept,
>> demonstrating different aspects of this problem: Pyjamas, the PyJS fork of
>> Pyjamas, Skulpt, Empythoned (which actually compiles *CPython* to run in
>> the browser with surprisingly reasonable performance!), Brython, and PyPy's
>> now defunct JS backend to name a few.  With source maps, it's even possible
>> to use native JavaScript debugging and profiling tools on Browser-hosted
>> Python.
>>
>> The political problem is entirely based around getting the various
>> interested parties together and trying to hammer out some kind of common
>> core that they can all get running and contribute to, rather than
>> duplicating tons and tons of effort and only ever getting to a 60% solution.
>>
>> Browser vendors seem perfectly happy to treat JavaScript as a compilation
>> target; efforts like ASM.JS are in fact trying to formalize this process
>> and provide support for it.  Most of these Py-to-JS converters work fine on
>> mobile devices, too.
>>
>> Guido, if you haven't checked it out, <http://www.brython.info> is a
>> *very* interesting demo: it literally makes <script type="text/python3">
>> work in a web page, with nothing beyond a single JavaScript file include
>> (no local compilation, no offline processing).  The only problem is that
>> the language really isn't quite Python - see, for example, <
>> https://bitbucket.org/olemis/brython/issue/147/generators-send-method-missed>.
>>  But they've made a surprising amount of progress since I last checked, and
>> they seem to be closing issues all the time :-).
>>
>> -glyph
>>
>>
>
>
> --
> --Guido van Rossum (python.org/~guido)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20140217/e21e95a4/attachment.html>


More information about the IDLE-dev mailing list