Then while looking for an answer as to how soon this problem is likely to be resolved I discovered this thread which was another level of disappointment. The original post is undiplomatic, perhaps even inflammatory, however the response indicates a level of befuddling clueless-ness.
The reason I think these are reasonable requests is that Coffeescript seems to manage to do both. Before Coffeescript maybe Clojurescript’s idiosyncrasies would have been forgiveable but being late to the party as well as being less well-mannered makes the defiance in the response seem poorly judged.
I remain open-minded though and would be willing to give Clojurescript a second go once the dust has settled a bit.
18 thoughts on “Why I’m finding Clojurescript underwhelming”
> I noticed Clojurescript in Github before the big announcement and thought it was an interesting idea.
Just a quick point. The previously named ClojureScript was a different project by Chris Houser. To add to the confusion, Chouser is also a key contributor to the new ClojureScript. 🙂
> decision not have the code run on OpenJDK
I’m not sure that “decision” describes the reason. I think “bug” would be more accurate. I am not intimately aware of the problem(s) preventing its use on OpenJDK, but I think that someone has already solved this and it is not likely to be a persistent problem.
> a level of befuddling clueless-ness
I would be interested to know your basis for this characterization.
I doubt you will be happy with the answers, but I can think of two:
> You also do want to be able to use really good existing frameworks like jQuery
I believe that JQuery libraries are accessible via ClojureScript. Do you instead mean that ClojureScript should have used JQuery as its target runtime?
> Before Coffeescript
Coffeescript is awesome and in many ways blazed the trail for ClojureScript, but they are very different languages and what is kosher for one may not apply to the other.
In answer to your two questions: “befuddling clueless-ness”, “clueless-ness” because I think it is (or at least the view is coming from a point so far from what I see as the point of Clojurescript that I must be completely failing to understand the purpose of Clojurescript); “befuddling” because what I see is smart people acting foolishly in an unexpected way.
As regards the use of jQuery as a target runtime, I’m not really sure what the purpose and relationship of Google Closure is to Clojurescript. Looking at the examples it seemed to be joined at the hip, but if I can, for example, treat a jQuery selector as a lazy sequence I would be happy. The use of Google Closure in the examples is, for me, is highly unattractive compared to my existing jQuery/Coffeescript code.
Realistically I suspect that my use of Clojurescript will most probably be to do client-side computation rather than DOM manipulation.
> understand the purpose of Clojurescript
> what I see is smart people acting foolishly in an unexpected way
I’ve tried to follow that thread but lost track over the past few days. It became apparent early on that it wasn’t going well however, so for better or worse I’ve abstained from engaging. It’s unfortunate that the dialogue on the Clojure group has turned you off to ClojureScript itself.
> purpose and relationship of Google Closure is to Clojurescript
The Rationale and Closure pages try to outline that relationship. Maybe they would help clarify? https://github.com/clojure/clojurescript/wiki/Rationale and https://github.com/clojure/clojurescript/wiki/Google-Closure
> unattractive compared to my existing jQuery/Coffeescript code.
JQuery integration is not a priority of ClojureScript, but that’s not to say that some brilliant soul will not solve it. As far as I can tell there is no reason that JQuery and ClojureScript cannot co-exist, it’s just that it hasn’t been done yet. But honestly, ClojureScript is not attempting to oust JQuery nor Coffeescript. If they work well for your needs then it would be hard to present a case that you should change.
Nothing I have read (including these comments) tell me which one of these options (or something else) Clojurescript is shooting for.
Thanks for the links. I had read them but I tried to closely read them again to see if I had not been skim reading first time round. I have to say that they don’t help me personally. And that the documentation generally around Clojurescript has also been underwhelming.
As you say if it’s not floating my boat then maybe I’m just not the target audience despite being a Clojure fan in general.
I really don’t understand the point of jQuery here. ClojureScript is a “Language”, not a DSL for DOM API. Google Closure is a suitable target to build language and related abstractions and API, because it gives a robust low-level SDK to do that stuff.
If you like jQuery so much, feel free to build a library/wrapper on the top of ClojureScript+jQuery. Why want ClojureScript to be piggy-backed on jQuery?
Closure is being presented as a necessary part of Clojurescript though (I might be right or wrong in this perception but it is the way I am understanding the proposal). Why do I prefer jQuery over Closure? Because for me jQuery-based code is simpler and more elegant than Closure code. There are aspects of Closure that I like, obviously, but the way the library is generally presented is as a non-modular lump of many, many things makes it unappealing.
You’re right that I could do the bridge myself but as the post points out, why would I do that when I already having a working environment that gives me compact functional-like code?
> Why do I prefer jQuery over Closure? Because for me jQuery-based code is simpler and more elegant than Closure code.
I do agree, however this point is not really relevant.
I use jQuery every day and love it, but to me the day that I can do everything I need to do in ClojureScript and not *have* to use jQuery or any js library will be a great day!
I’m not a huge fan of DOM(HTML)-less apps so I can see that I’m not necessarily in the demographic for this.
“Why not jQuery for ClojureScript? I hate Closure!” is same as saying “Why not SWT for Clojure? I hate Swing!”.
Personally, ClojureScript allows me to:
1.) Write powerful scripts on portable devices (for example, using SL4A on Android)
2.) Write quick scripts in Clojure that can run fast via node.js
3.) Deliver powerful client-side functionality to drive an application
4.) Brings Clojure into a realm where I can use it to develop next-generation applications on HTML5/JS
I’d like to discuss points 3 and 4 more.
I love jQuery and I use it often (you’re foolish not to use it if you’re building consumer-web stuff). I don’t see myself doing jQuery based stuff in ClojureScript, but it is very easy to do so (https://gist.github.com/1098417). What I see is using ClojureScript to enhance the overall client-side experience, deliver client side templates, and handle most of my data marshaling. I plan on still using jQuery for UI effects and complex DOM manipulation, but I’d still like to give the goog.ui pieces a try.
For what it’s worth though, the JS that gets generated is more or less canonical: it follows the module pattern, the namespace pattern, uses closures to block access, etc.
Additionally, I’m working on a library to marry Closure’s HTML5 support and the rest of HTML5 spec for ClojureScript. With such a library, next generation apps will be a breeze and will be as optimized as possible.
To follow on:
2.) The inclusion of the Closure library is to create a performant, complete/rich/deep, ecosystem of library support in a single package. This results in very little effort of porting things from Clojure to ClojureScript, and makes the experience in both dialects uniform.
Because of these abilities, all of ClojureScript compiles down (after compression) to 4 Kb. This is the same size as a memory-mapped file (file descriptor) on your operating system. That’s what the toolchain buys you.
For now, if you don’t want to deal with Google Closure you don’t have to. You can use it with jQuery. People are already doing this. The only thing that you can’t do if you use jQuery is optimize your code. Since you are already happy not doing this with CoffeeScript and jQuery then it shouldn’t be a problem for you.
The Google Closure library is prominent now because ClojureScript has been released very early. This was done so that others could get involved. Explaining the use and purpose of Google Closure is essential at this early stage. Early adopters will start to build libraries on top of it so that people like you won’t have to deal with it some day.
Personally, I love jQuery. I use it in every project. My first question when I heard about ClojureScript was “How do I use it with jQuery?”. Now I am thinking about how I can build something in ClojureScript to replace it. Others are as well.
The promise of ClojureScript for web development is that people who like Clojure will be able to use one language to do everything. They will even be able to run the same source code on the server and client.
Thanks for giving me a clear answer to my questions. I haven’t been able to find this kind of mission statement elsewhere in the documentation.
Pingback: Clojurescript: is it any better yet? | Echo One