|
|
Log in / Subscribe / Register

GUADEC: Luis Villa points GNOME at the web

GUADEC: Luis Villa points GNOME at the web

Posted Jul 29, 2010 5:21 UTC (Thu) by elanthis (guest, #6227)
In reply to: GUADEC: Luis Villa points GNOME at the web by aigarius
Parent article: GUADEC: Luis Villa points GNOME at the web

JavaScript has issues, sure. It isn't "slow" by ANY stretch of the imagination. To think that Python is an answer because JavaScript is slow just proves you have abso-freaking-lutely no idea what you're talking about. Python is one of the slowest of all the popular interpreted languages out there by a good margin, and JavaScript implementations have easily taken the crown as being the fastest. Hell, even Ruby (once the absolute king of slow-and-stupid runtimes) is faster than Python these days.

Your developer friends that would rather code in ActionScript (which is just JavaScript + static typing, seriously) or Java (or the subset there-of that certain tools translate to JavaScript) aren't the people to take advice on languages from. Those are the kinds of people who could only learn how to code by attending training seminars and community college classes (which are almost entirely all ActionScript and Java based) and could never manage to translate their cookie-cutter cut-n-paste programming skills to another language without having the knowledge spoon fed to them. Those are the same people that will balk at Python because it's not the exact same set of syntax and APIs that they memorized back in class.

Much of the "JavaScript on the Web" headaches people oft bitch about are entirely irrelevant with JavaScript on the Desktop. JavaScript can suck for Web programming because you have to deal with the least common denominator, which generally means IE6, which in turn means a horrendously out of date and horrendously buggy implementation of an ancient version of the JavaScript language.

Slightly back on topic, but related to my rant there, I will note that the idea that a JavaScript+HTML+CSS toolkit for GNOME will somehow magically attract more developers is totally bunk. Real applications need real developers. People who've never managed to learn anything besides JavaScript+HTML+CSS are not programmers and do not write applications. They write goofy animated web pages with some backend database integration. The people writing GMail for instance are not your common Web developer; compared to other Web developers, they are gods among rodents. Those aren't the kind of people who have been wanting to write GNOME apps but sat there and thought, "gee, I only know JavaScript, GNOME is too hard!" Those are the people who could probably code a GNOME app in pure assembler, but aren't writing GNOME apps because they just don't want to or just don't care.


to post comments

GUADEC: Luis Villa points GNOME at the web

Posted Jul 29, 2010 11:32 UTC (Thu) by nye (guest, #51576) [Link]

This.

Every point in this post is spot on.

GUADEC: Luis Villa points GNOME at the web

Posted Jul 30, 2010 0:41 UTC (Fri) by ras (subscriber, #33059) [Link] (3 responses)

To think that Python is an answer because JavaScript is slow just proves you have abso-freaking-lutely no idea what you're talking about. Python is one of the slowest of all the popular interpreted languages out there by a good margin, and JavaScript implementations have easily taken the crown as being the fastest. Hell, even Ruby (once the absolute king of slow-and-stupid runtimes) is faster than Python these days.

Actually, Python is substantially faster than Ruby, Perl, PHP, and most JavaScript implementations for that matter. See:

The Computer Language Shootout

That said, there is one very fast JavaScript implementation out there - V8. Given the amount of time and effort being poured into JavaScript I expect it will be the fastest in the medium term. But not in the long term, primarily because Python and JavaScript are almost identical languages under the hood. The main difference is Python has a sane syntax, so you don't have to go looking for the good parts. Given V8 already runs 3 times faster than Python, I suspect the urge to apply the techniques used in V8 to Python will become irresistible.

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.

GUADEC: Luis Villa points GNOME at the web

Posted Aug 2, 2010 15:34 UTC (Mon) by nye (guest, #51576) [Link] (2 responses)

>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.

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