An early birthday present: The Gmail Javascript compiler was just open-sourced! http://code.google.com/closure... (it compiles JS into smaller, faster JS)
Unfortunately it looks like the internationalization features may be missing. I wonder why those were removed? (or if I'm just not seeing it)
- Paul Buchheit
@Paul the Closure project has three components: compiler, library, and template language. Looks like the Closure/library might be competing with jQuery.
- Shakeel Mahate
I think jQuery does a lot of stuff that might confuse the compiler, e.g. iterating over an array of string function names and creating new function wrappers (look at the way the parent/child/next/prev/etc functions get installed) The Closure library is also full of type annotations that help the compiler make better optimization choices, so you're likely to get a better compiled outcome using Closure than jQuery + fixes + compiler
- Ray Cromwell
@paul -- I know you've been wanting this opensourced for a long time. sorry it took such a long time. Nick Santos and the jscompiler team has finally done it! Cheers!
- Jing Lim
Congratulations to the team (and @Paul & Jing) -- I know everyone's been waiting a long time for this. For anyone considering whether to use jQuery vs Closure, consider that they're meant for largely different purposes. jQuery's good for enhancing static web pages; Closure's much better at building large apps. And as Ray points out above, Closure the library is going to get much better results from Closure the compiler than an arbitrary js library would, because of all the type annotations.
- Joel Webber
Paul Buchheit has been at the top of my best of pages all month. Rock on, Paul.
- Donald C. Lindsay
Hey HAPPY BIRTHDAY PAUL !!! Cool present!! <insert CAKE> :D
- Susan Beebe
That writeup is trolling for traffic IMHO. Nit picking 50 lines out of 200+ thousand (written for readability, which get compiled and optimized), providing no benchmarks for claims, and spending half the time bashing Java, it just seems to be struggling to find something wrong with Closure.
- Ray Cromwell
Sachin: he seems to be commenting on Closure the JS library, not Closure the JS compiler (that Paul's post was about). And he may be a douchebag, but I haven't seen anything I disagree with.
- Gabe
@Sachin: I hate to be too harsh, but that post is pretty much garbage. From what I can tell he's pretty much managed to enumerate some of the worst things about Javascript -- nitpicking the code for referencing "undefined" directly without declaring it as an uninitialized local? That's insane. Following this advice is mostly a recipe for an unreadable mess. Also, look in the comments for several refutations of the idea that some of these are even optimizations.
- Joel Webber
Joel, you're just not man enough to handle a language where 'top' is an implicitly reserved keyword, and 'undefined' which should be, isn't. But it could be worse, 'null' could be something you could override. :)
- Ray Cromwell