Significant whitespace

Duncan Booth duncan.booth at invalid.invalid
Sat Jan 2 05:42:39 EST 2010


Donn <donn.ingle at gmail.com> wrote:

> On Saturday 02 January 2010 00:02:36 Dan Stromberg wrote:
>> I put together a page about significant whitespace (and the lack
>> thereof). 
> The only thing about Python's style that worries me is that it can't
> be compressed like javascript can*, and perhaps that will prevent it
> becoming a browser-side language one day. How I'd love to code PyQuery
> instead of JQuery! 

You can do simple white-space removal as easily in Python as in Javascript, 
you just need to maintain a minimal indentation and as you don't need 
Javascript's curly braces there probably isn't must difference especially 
once the code has been gzipped for transfer to the browser.

You can already run Python client side in certain situations (e.g. 
Silverlight), but if you want to write Python for the browser portably 
today have a look at Pyjamas http://code.google.com/p/pyjamas/ .

Google's Chrome also supports native code (currently just for x86 machines 
though they have said they intend to support ARM), so there should be some 
potential there to compile a Python interpreter that runs client-side in 
Google's sandbox: see http://plash.beasts.org/wiki/NativeClient for an 
early port.




More information about the Python-list mailing list