4 ms·
I work on ClojureScript - so I'm obviously biased. I think there are very deep seated assumptions in even the best designed JavaScript libraries. Because of th
by swannodette 14y ago
I work on ClojureScript - so I'm obviously biased.
I think there are very deep seated assumptions in even the best designed JavaScript libraries. Because of this I think there will tend be impedance an mismatch between Clojure and the API that JS libs present. If you're willing to spend a little bit of time upfront - I believe macros & protocols can likely eliminate at least the tedium you'll find at the interop barrier.
Still, I'm hopeful for pure ClojureScript libs that show how expressive Clojure can be for client side development if you approach the problem without the usual JS assumptions.
One example, I recently returned from the Clojure Conj where I saw Conrad Barski's (Land of Lisp) presentation on functional DOM programming - impressive stuff and worth checking out if people are curious what an idiomatic client side ClojureScript library might look like - http://github.com/drcode/webfui http://github.com/drcode/webfui
EDIT: I don't mean JS libs in general (simple functional libs integrate great!) but the various MVC frameworks mentioned in the post.
- pbiggar 14y agoI don't understand this. We use Clojure for our startup - we occasionally drop down to Java for some libraries (EC2 comes to mind). If I were to use clojurescript, I'd want to drop down to JS too. So why is clojurescript being designed without taking that - the thing that allowed clojure be so successful - into account?
- swannodette 14y agoThe post was mostly about challenges around integrating with popular JS MVC frameworks. I think the overall ClojureScript JS integration story is as about as good as Clojure and Java.
- pbiggar 14y agoI was responding to this line "Still, I'm hopeful for pure ClojureScript libs that show how expressive Clojure can be for client side development if you approach the problem without the usual JS assumptions.", which is what I don't understand. I havent used coffeescript, but from the article and your comment, it doesn't sounds like the integration is as good - the Java/Clojure integration is really very very good in practice.
- pbiggar 14y agoTypo, too late to edit: s/coffeescript/clojurescript/
- sgrove 14y agoI wrapped/integrated handlebars templates last weekend, and after understanding how the google Closure library/compiler does things, it took ~15 minutes to have it working beautifully (using basically the same technique as jayq). For a lot of the libraries, it's not a big deal. For others, I assume that the imperative style that's so pervasive in JS makes it more difficult to use in cljs without lots of tedious macros. I'm slightly optimistic that the google Closure library, as much as I dislike the style of it, may actually end up imposing just enough structure and reasonable common practices that cljs and other languages can really interop nicely.
- kinleyd 14y agoThanks swannodette, both for your work on ClojureScript and for the link to Conrad Barski's webfui. I had noted the dates for Clojure Conj 2012 and Conrad's talk but obviously time passed by swiftly. I look forward to the videos of Clojure Conj 2012 going up soon.