|
|
Log in / Subscribe / Register

GUADEC: Luis Villa points GNOME at the web

GUADEC: Luis Villa points GNOME at the web

Posted Aug 2, 2010 15:34 UTC (Mon) by nye (guest, #51576)
In reply to: GUADEC: Luis Villa points GNOME at the web by ras
Parent article: GUADEC: Luis Villa points GNOME at the web

>The main difference is Python has a sane syntax, so you don't have to go looking for the good parts.

In your opinion. I find Python to be distressingly inelegant at times, and has enough gotchas to be mildly dangerous. Reasonable people can differ here.

>If you are doubting that Python and JavaScript are very similar have a look at Pyjamas, a Python to JavaScript Compiler. Turns out there is almost a 1 to 1 correspondence between Python constructs and JavaScript.

The conclusion doesn't necessarily follow from the premise. Python can be compiled to JavaScript pretty successfully, but I think the reverse would be harder (Python doesn't even have closures; how can you take a dynamic language seriously without closures? :p) - although as we all know, it is possible *in principle* to compile any (Turing complete) language into any other.

This probably doesn't change your point about speed, and it would be interesting to see if the same techniques can be successfully applied to speed up Python, but the fact that JavaScript is improving in that area faster than Python would be a warning sign.


to post comments

GUADEC: Luis Villa points GNOME at the web

Posted Aug 2, 2010 22:49 UTC (Mon) by ras (subscriber, #33059) [Link] (1 responses)

Posted Aug 2, 2010 15:34 UTC (Mon) by nye (subscriber, #51576):

Python doesn't even have closures

Quoting from Wikipedia: Python has had support for lexical closures since version 2.2.

GUADEC: Luis Villa points GNOME at the web

Posted Aug 3, 2010 10:37 UTC (Tue) by nye (guest, #51576) [Link]

Thanks for the correction. Since I can't imagine the last time I looked was before 2.2, I can only assume that Python's weird scoping led me to the conclusion that closures were useless, and I misremembered that as 'absent'.

Many more thanks for introducing me to the 'nonlocal' keyword - finally a good reason to use Python 3.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds