

Introducing ClojureScript - abp
http://clojure.com/blog/2011/07/22/introducing-clojurescript.html

======
sirn
The best thing with the introduction of ClojureScript, at least for web
applications, is that we can now write the whole application in Clojure
without context switches. Gaka for CSS, ClojureScript for JavaScript, Hiccup
for HTML and Clojure for everything else. Possibly someone could design a form
validation library that validates both server side and client side with the
same code. Love the possibility being presented here.

~~~
runevault
Sandbar has form validation in it,though not sure if it would work for
clojurescript. And personally I'd still use enlive for HTML so can buy
prebuilt templates and just tweak my code to work within those, but that could
just be me :)

~~~
nickik
the enlive vs hiccup battle is not really changed by ClojureScript. I am glad
that we have enlive, hiccup and fleet so everybody can take whatever he wants.

~~~
runevault
Don't even know Fleet, but Hiccup certainly has a place for when you WANT code
as HTML. I'd never want it but I can understand why some would.

------
DanielRibeiro
Great Introduction! It is nice how this project makes the point that _"JS is
Assembly Language for the Web"_ [1][2]

[1] <http://news.ycombinator.com/item?id=2783060>

[2]
[http://www.hanselman.com/blog/JavaScriptisAssemblyLanguagefo...](http://www.hanselman.com/blog/JavaScriptisAssemblyLanguagefortheWebPart2MadnessorjustInsanity.aspx)

------
ericmoritz
Unless I'm doing something wrong, they need to do some optimizations to code
size if this is going to be used client side nearly 30k is a lot of overhead
for a function that returns "Hello, world!"

<http://pastebin.com/P5MTvP5Q>

~~~
omaranto
I didn't read either the article or what you did carefully, but I do wonder if
either (a) you're supposed to run the output of their compiler through Google
Closure's compiler which removes most of the code (which is probably library
functions unused by your little function), or (b) the 30K is a pretty much one
time cost, and if your code grows the output increases moderately.

~~~
ericmoritz
I believe it's already going through Google Closure. That's what
{:optimizations :advanced} does.

I'm certain it's a one time cost. Though I suspect that given that Closure
[optimizes out unused code]([http://blog.fogus.me/2011/07/21/compiling-
clojure-to-javascr...](http://blog.fogus.me/2011/07/21/compiling-clojure-to-
javascript-pt1/)) the more I use of the goog namespace, the larger that
baseline will become.

That being said, 30k is the size of minified jQuery, so folks that are alright
with building apps on jQuery won't find 30k to be that terrible.

~~~
wooby
It's a one-time cost, but we're also not done improving Closure Compiler's
ability to minify core.

There's a lot of Closure Compiler-specific metadata we're not leveraging yet,
and our goal is to reduce the baseline to much, much less.

------
krosaen
"""ClojureScript also makes use of the Google Closure library for capabilities
such as event handling, DOM manipulation, and user interface widgets."""

Kinda wished they had stopped at the language and left the DOM out of it.

Still, very cool.

~~~
nickik
Your understanding this wrong. You can use all java script libs (with
sometimes more sometimes less work) but the google closure library is really
easy to use. This DOM library has nothing to do with clojurescript itself its
just there and easy to use.

------
cdcarter
Now that this one is done, I'm going to get started on COBOLScript!

