

Compiling Clojure to javascript pt 1 - nickik
http://blog.fogus.me/2011/07/21/compiling-clojure-to-javascript-pt1/

======
brlewis
Wow. I didn't know Google Closure implemented a real optimizer like that.

~~~
devin
Not many people did. It's a pretty stunning project that they just give away
for free.

------
runevault
I love the fact that the Closure compiler realizes "oh, that's 2" and outputs
it. Personally I'll probably give them more time to build things out a bit in
case they start adding some of the missing pieces like transients, but I'm
more exited by this the more I read.

~~~
nickik
I don't think transiants are hugely importend in that setting. I can really
see how agents are useful and the could be nicly implmenteted with webworkers.

~~~
runevault
I like them for being able to modify normally persistent structures to build
them faster but still hand back a persistent one for the guarantees they allow
throughout the rest of the system, threads or no.

------
sbochins
This should make a lot of the authentication stuff easier. You only need to
write the code once and use it on both the front end and the backend.

------
azakai
The heavy use of |arguments| may be an issue here. arguments is an object that
is only created if actually needed in most JS engines, but it looks like here
every single function will need it? That might be a significant amount of
additional overhead.

~~~
swannodette
Only functions which leverage multiple arities will use arguments.

That said, it seems like a fairly simple optimization to the compiler to avoid
resorting to arguments.

------
watmough
Gosh that's really neat.

This is another arrow in the quiver for Javascript as the assembly language of
the web.

The bonus is that it's a very nice little language, becoming highly
performant, and universally available.

------
nickik
Video up now: [http://blip.tv/file/get/Richhickey-
RichHickeyUnveilsClojureS...](http://blip.tv/file/get/Richhickey-
RichHickeyUnveilsClojureScript918.avi)

