Hacker News new | past | comments | ask | show | jobs | submit login
Compiling Clojure to javascript pt 1 (fogus.me)
133 points by nickik on July 21, 2011 | hide | past | favorite | 11 comments



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


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


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.


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.


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.


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.


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.


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.


I believe Closure optimizes many uses of arguments.


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.





Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: