Hacker News new | past | comments | ask | show | jobs | submit login
ClojureScript Synonyms (himera.herokuapp.com)
113 points by fogus on April 24, 2012 | hide | past | favorite | 16 comments



Are there any Clojure web frameworks that really embrace ClojureScript and blur the line between the server and the client like Meteor recently demonstrated? Sorry to be off-topic.


Chris Granger, of Light Table fame, has a few handy libraries. None of these are quite on par Meteor, but they are the basis for Light Table.

https://github.com/ibdknox/fetch - remoting

https://github.com/ibdknox/crate - html generation

https://github.com/ibdknox/jayq - jQuery wrapper

https://github.com/ibdknox/waltz - state machine

Checkout https://github.com/ibdknox/live-cljs for a cool example of using these libraries together.



I took http://synonym.dartlang.org/ as an inspiration ;) This is a work in progress. Suggested additions, modifications, corrections welcome!


This is awesome. I especially love the contrast between first-class namespaces, immutable collections, and destructuring.

Also, towards the bottom: "Ocaml, Haskell style pattern matching is a library. Prolog style relational programming is a library." core.match/core.logic is like Michael Fassbender. It's everywhere! :D


I don't think ClojureScript supports "first-class namespaces" quite yet, does it? Maybe more "first-class" than JS, but at least not the way Clojure does, with functions like ns-publics etc?


Callable Collections -> (map address [:zip street])

Should that be :street instead?

Love the sheet. Got 4 days of vacation on front of me and I'm planning to play with Clojure and ClojureScript during that time. Perfect timing.

Edit: Another one:

Iterators Uniform Iteration For All Types

"JavaScript natives are safely ?______? to the same iteration protocol" - missing word, I guess.

Would create a pull request (is that even polite/acceptable for ridiculously small things and typos?), but maybe the author is following this thread?


Thanks for the feedback. :street is getting fixed, and I fixed the missing "extend". But if you see others please do send pull requests here: https://github.com/fogus/himera


Awesome, when I started ClojureScript, getting even the basics down was a little tricky, but this certainly helps! Thanks.


I wish this existed few weeks ago. It would be awesome if there's something similar to this but with JavaScript/jQuery translations to ClojureScript/Google Closure. In my opinion, that's the hardest part after getting the basics.


Have you checked out jayq or domina? They give you nice wrappers around JQuery and the Google Closure libs and are relatively self explanatory to use if you've messed with any DOM libs before...

https://github.com/ibdknox/jayq

https://github.com/levand/domina


Yes, I did. In the end I stick with Domina for DOM manipulation and Google Closure library for the rest. I decided to skip jQuery (jayq) to experiment on doing things "the ClojureScript way," it's only a personal project after all.


We'll try to add some practical DOM & Ajax examples. Thanks for the feedback.


Note that ClojureScript is only related to the Google Closure project via the compiler. So a demonstration of jQuery to Closure Library API calls would serve an unrelated purpose.


I don't know if the initial announcement still applies today; but I think ClojureScript encourages using Google Closure library for DOM manipulation and event handling[1]:

> The ClojureScript compiler emits JavaScript which follows Google Closure's code conventions, and then invokes the Google Closure compiler to generate compact, optimized JavaScript for delivery to clients. ClojureScript also makes use of the Google Closure library for capabilities such as event handling, DOM manipulation, and user interface widgets.

> It is possible to use ClojureScript with JavaScript libraries other than Google Closure, but those libraries typically do not follow the conventions of the Google Closure compiler and therefore will not be able to take full advantage of its optimizations.

They even have few wrappers to Google Closure Library under the `clojure.browser` namespace[1] (although from my testing, some of them, such as `clojure.browser.event`, is not compatible with ADVANCED_OPTIMIZATIONS.)

[1]: http://clojure.com/blog/2011/07/22/introducing-clojurescript...

[2]: https://github.com/clojure/clojurescript/tree/master/src/clj...


Really helpful, thanks.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: