Live data from Hacker News

Introducing Closure Tools

googlecode.blogspot.com

31–40 of 71 posts

Re: Introducing Closure Tools

#31
post #5

For one of our JS bundles it's a substantial improvement over YUI's Compressor. Original: 459220 YUI: 241920 Google: 209929 -- 13% improvement YUI + gz: 66164 Google + gz: 61297 -- 7% improvement Caught a few non-fatal syntax errors too. We serve hundreds of thousands of those a day, so that's already committed to our tree and on the way to testing.

Here's another data point: I downloaded jquery-1.3.2.js and jquery-1.3.2.min.js from http://docs.jquery.com/Downloading_jQuery#Current_Release > wc -c jquery-1.3.2.js 120763 > wc -c jquery-1.3.2.min.js 57254 > java -jar compiler.jar --js jquery-1.3.2.js | wc -c 55340 Using Google's compiler saves an additional 4% over the existing minified version (disclosure: I used to work for Google)

I definitely plan on switching jQuery over to using this compressor - excited by the output. However it appears as if it crashes when you push the latest nightlies of jQuery in. Not sure what's up with that.

Re: Introducing Closure Tools

#32
post #27

Earlier quoted context omitted.

I am never going to be able to refer to an actual closure again and have anyone understand what I'm talking about, am I?

I already find that hard enough - I've found that people tend to conflate first-class functions with closures.

Well, is there any real different between a first-class function and a closure that closes over nothing?

Is it possible for a language to support closures without first-class functions? How common is it to have first-class functions without closures? (I think Python sort of had this arrangement, but I think this is fixed now.)

Re: Introducing Closure Tools

#33
post #32
post #27

Earlier quoted context omitted.

I already find that hard enough - I've found that people tend to conflate first-class functions with closures.

Well, is there any real different between a first-class function and a closure that closes over nothing? Is it possible for a language to support closures without first-class functions? How common is it to have first-class functions without closures? (I think Python sort of had this arrangement, but I think this is fixed now.)

A closure is just a (function, bindings) pair, so Python certainly has closures. The problem with Python is that there is no syntax for assigning to variables declared in an arbitrary scope, because there are no explicit declarations. As far as I understand, implicit local variables are what causes the problems in Python, not anything about closures, really. This causes other problems, too, such as those PG described here [1], under the heading "Implicit local variables conflict with macros".

1. http://www.paulgraham.com/arclessons.html

Re: Introducing Closure Tools

#34
post #19

Earlier quoted context omitted.

It was called Closure before Rich announced Clojure to the world.

Thats a terrible argument... He did indeed "announce Clojure to the world" before Google did, and now we all associate the phonetic name with him. Treat "closure" as a project name and pick a different product name, Google.

What about http://www.clozure.com/clozurecl.html? I believe it was Clozure before Clojure was released (but I could be wrong).

Re: Introducing Closure Tools

#35
post #2

What an unfortunate name. Perhaps, in the confusion, it will help to actually promote Rich Hickey's wonderful work.

Picking a name for a software project is one of the few areas where a developer gets to kick loose and be completely creative, and even fanciful.

Personally, I love picking names that recast old words in a new way, and think Closure is a great name for this project.

Re: Introducing Closure Tools

#36
post #2

What an unfortunate name. Perhaps, in the confusion, it will help to actually promote Rich Hickey's wonderful work.

I think most of the intended audience will not find 'Closure' confusing, because they are unaware of the concept that already has that name. The overlap of people interested in Clojure and people interested in Closure is rather small.

The overlap of people interested in Clojure and people interested in Closure is rather small.

This entire thread is evidence against that point.

Re: Introducing Closure Tools

#37
post #2

What an unfortunate name. Perhaps, in the confusion, it will help to actually promote Rich Hickey's wonderful work.

Why is it called Closure? Does it close stuff? Does it pass functions and bindings? What could possibly have inspired them to use this particular name?

Re: Introducing Closure Tools

#38
post #26

Wow, I have been seriously missing this outside google-land. So happy it's released; it's a fantastic set of tools, even if you only use the compiler as a glorified lint.

How many lint-like tools use a full AST? pylint yes, but I doubt the original did.

Re: Introducing Closure Tools

#39
post #28
post #2

What an unfortunate name. Perhaps, in the confusion, it will help to actually promote Rich Hickey's wonderful work.

This is indeed an unfortunate name. The word 'closure' was, at first, used to describe a concept in programming: http://en.wikipedia.org/wiki/Closure_(computer_science) . Then Clozure and Clojure came along. Now, I can see how these two are related to the aforementioned concept, but I simply can't see what these 'Closure tools' have to do with the concept of closures. Yet the name would suggest that they do. Is there…

Note that the word closure has meaning in set theory and other areas of mathematics relevant to computer science. SICP explicitly avoids using what wikipedia calls a 'computer science closure' for this reason.

Re: Introducing Closure Tools

#40
post #28
post #2

What an unfortunate name. Perhaps, in the confusion, it will help to actually promote Rich Hickey's wonderful work.

This is indeed an unfortunate name. The word 'closure' was, at first, used to describe a concept in programming: http://en.wikipedia.org/wiki/Closure_(computer_science) . Then Clozure and Clojure came along. Now, I can see how these two are related to the aforementioned concept, but I simply can't see what these 'Closure tools' have to do with the concept of closures. Yet the name would suggest that they do. Is there…

It's not quite as bad as PrototypeJS -- the most ironically named library ever. The whole point of it is to force Class-based bullshit onto the only pure Prototype-based language anyone uses. It's named after the concept it's designed explicitly to stamp out.

So depressing.

Post reply on HN