4

I would like to investigate whether ClojureScript, with the associated Google Closure library is a reasonable tool to build modern, in-browser, Javascript applications.

My current Javascript stack consists of jQuery, Backbone and RequireJS with the possible additions of some widgets libraries like jQueryUI or KendoUI. So it will be quite a big leap (I already know how to work in Clojure, although I have little experience).

What is a good roadmap to do so? Should I learn the Google Closure library first, or can I grasp it together with ClojureScript?

One thing I am concerned about is the overall application structure. Backbone is rather opinionated on how to organize your application. I am not sure whether Google Closure also includes some components to help with the design of the application. And, if this is the case, I do not know how to tell whether this structure will port to ClojureScript or a ClojureScript application will require a different organization anyway, and only use - say - the widgets and DOM manipulation features of Closure.

6
  • 1
    What is the relationship between ClojureScript and Google Closure? Commented Mar 14, 2012 at 18:44
  • 2
    @GarrettHall: ClojureScript is a compiler for Clojure that emits JavaScript. Closure is a Javascript to better Javascript compiler. ClojureScript is designed to emit JavaScript code which is compatible with the advanced compilation mode of the Google Closure optimizing compiler. Commented Mar 14, 2012 at 20:40
  • Moreover, Google Closure also features a library, and that one is the suggested library in ClojureScript wiki. As they put it, it seems it is also used in the core.
    – Andrea
    Commented Mar 15, 2012 at 7:37
  • github.com/clojure/clojurescript/wiki/Google-Closure
    – Andrea
    Commented Mar 15, 2012 at 7:38
  • 1
    What specifically do you have a question about? Commented Mar 15, 2012 at 19:55

2 Answers 2

4

I say you have to sharpen your Clojure experience first, Google Closure after all is a JavaScript library and some other tools.

However, you need you check ClojureScript One:

ClojureScript One will show you how ClojureScript reduces the complexity of web development by allowing you to write applications using one language to unify development across the client and the server

1

To add to the above comments, but Rich Hickey goes into the relationship between ClojureScript and Google Closure tools in his intro of ClojureScript. http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498

Basic gist is in the comments:

ClojureScript is a compiler for Clojure that emits JavaScript ... and is design to emit ... code [that] is compatible with the advanced compilation mode of the Google Closure optimizing compiler.

2
  • Yes, I know that. This is why I asked the question in the first place. What I would like to know is if it makes sense to dive into ClojureScript directly and pick Closure along the way or if I should learn the library in JS first
    – Andrea
    Commented Mar 21, 2012 at 21:18
  • That's a very judgement call. From my perspective, I'd go to ClosureScript and just pickup the Google Closure Tools usage that was relevant as needed. I don't see how the rest of the Google Closure Library is required to be part of it. Commented Mar 22, 2012 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.