3 ms·
Author here. Happy to answer any questions or comments.
by aria 14y ago
Author here. Happy to answer any questions or comments.
- willismichael 14y agoI really want to like ClojureScript, particularly since the idea of using the same language all around the app appeals to me, but it's not quite the same language. Have you found this to be a pain in practice? I'm specifically wondering about require-macros and lack of support for ~ and ~@, although I'm also curious if you were bit by any of the other differences between Clojure and ClojureScript.
- aria 14y agoIndeed it's not the same language. I wasn't bit by the macro differences (which are probably the largest non-interop difference) since I tend not to use macros in my Clojure or ClojureScript code. Macros are going to be different since the macro compile host (JVM) is different than the run host (Javascript VM). Other than macros and the VM interop (ugh I think (.-length str) is an eye-sore for property acesss), the core of the language is close enough that I Don't think of it 90% of the time.
- deleted 14y ago[deleted]
- vemv 14y agoI'd say that not having "the whole language, all the time" is only (potentially) a pain regarding the development process/experience itself, not the quality of the resulting programs - which is what matters at the end.
- weareconvo 14y agoIn general, I believe people underestimate the importance of development time, as well as ease of training/hiring new programmers - one language is nearly always better as far as both of these things are concerned (unless that language is something like Malbolge).
- zcam 14y agoWhat ClojureScript libraries are you using? What other "regular" JS framework/libs do you use with ClojureScript (thinking about jQuery, Backbone, angular and the likes)? About dommy, what made you choose DOM vs String generation (knowing the later could be faster in some situations/setups)? And the last one, did you consider EDN? I'd guess you choose json for obvious performance reasons.
- aria 14y agoFrankly at the moment, we're not using any external clojurescript libraries; we've tried many, but none quite meet our needs or the style we really like. We're internally phasing out jQuery selectors in favor of some code that we'll be releasing once we know it's battle-hardened and ready. We don't use an MVC or components type framework, but ideas about how to setup those abstractions are percolating.
- zcam 14y agoI added two more questions while you where writing this reply probably.
- aria 14y agoAh sorry, I didn't see. So the decision about DOM elem vs String is one I'm not 100% sure about, but I think the performance difference is at most like a 10-15% difference which wasn't that compelling to us. So I didn't see a strong reason to go one way or the other and the code I believe is cleaner producing nodes rather than Strings, but I easily could be wrong on both counts. I didn't actually consider EDN. I haven't see enough of a win over JSON to consider it, but that could just be misinformed.
- mingpan 14y agoI've been using Clojure for a while now. Do you have any particular recommendations for resources for getting started with ClojureScript? I tried a while back and got really confused.
- pchristensen 14y agoI haven't used it but here's a 10-part mega tutorial on modern Clojurescript: https://github.com/magomimmo/modern-cljs/ https://github.com/magomimmo/modern-cljs/
- zcam 14y agohttp://himera.herokuapp.com/synonym.html http://himera.herokuapp.com/synonym.html from Fogus is also a good starting point to have an overview of how to do things and what is possible. Next stop: modern-cljs as mentioned by pchristensen.
- lukev 14y agoShameless plug, but I'll do it anyway since it's a direct answer to the question: I'm the (co)author of ClojureScript: Up and Running from O'Reilly. If anyone wants, email me at the address in my profile and I'll get you a discount code.
- No1 14y ago"about a year and a half ago ... a relative absence of development tools for building and debugging apps." I looked at ClojureScript when it was first released, and came to the exact same conclusion. I'm very interested to know how debugging ClojureScript works out for you. From what I remember, the ClojureScript -> JavaScript step generated some code that could be fairly difficult to follow. Also, in your experience, how well does it integrate with other JavaScript libraries?
- piranha 14y agoWhy jQuery, when ClojureScript already comes with a framework? It's easy to wrap it by a thin layer if you don't like the API, but then you get working advanced mode and one external dependency less.