On Mon, Dec 16, 2013 at 3:51 PM, Michael Torrie <torr...@gmail.com> wrote: > I think Python is a great overall application development language, > especially for the GUI. First-class functions for callbacks make it > very nice compared to other languages. Python is fast enough for > full-blown apps too. Slow parts can be factored out to other languages.
Python is sooooooo slow when it waits for the human. That pesky input() function can take *minutes* to return. It's terrible! Factor that out and your job's done. And yeah. First-class functions *rock*. ECMAScript is almost there - not supremely, perhaps, but oh so "all-but"! [1] A function can retain all sorts of state by being a closure, and yet somehow it doesn't retain the state of which 'this' (in Python terms, 'self') it should reference. Why? I don't know. But it's part of the spec now, so callbacks have to take a function and a context. var func=document.getElementById; var foo=func("foo"); /* Won't work */ function funcgen(obj) { return function(desc) {return obj.getElementById(desc);} } var func=funcgen(document); var foo=func("foo"); /* Will work! */ In Python, the simple and obvious thing works, because there's less magic. The incantation "obj.member" followed by the incantation "callable(args)" has exactly the same meaning as "obj.method(args)". ChrisA [1] http://math.boisestate.edu/gas/patience/webop/pat16d.html -- https://mail.python.org/mailman/listinfo/python-list