I'm using my ported version of Hiccup [1] to ClojureScript for a while
now and share most of my templates between Clojure on the server, and
ClojureScript on the client side with good sucess. It can sometimes
get a little bit hairy to share code between the 2 platforms, but I
hope something like Common Lisp's feature expressions [2] will make it
into Clojure and ClojureScript soon. When this arrives, life will be a
lot better ...<p>Just for fun, I benchmarked my Hiccup port against the other candidates.<p>Compilation Mode: Whitespace
{:crate 7.076333333333333, :jquery 1.4643333333333333, :dommy 2.1186666666666665, :hiccup-str 1.985, :hiccup-node 2.3476666666666666}<p>Running Hiccup and Dommy in advanced mode get's the time towards unoptimized jQuery.<p>Compilation Mode: Advanced (Crate and jQuery don't run in advanced mode)
{:dommy 1.3436666666666666, :hiccup-str 1.0293333333333334, :hiccup-node 1.3506666666666665}<p>One thing to note: The original Prismatic tests were building jQuery
Nodes and appended them to an UL element. Building strings and
appending those to the node speeds the whole thing up a little bit
further [3]. In the above benchmark :hiccup-node uses DOM nodes to
append to the root, :hiccup-str uses Javascript strings.<p>I can only agree. Using a Hiccup like template system in Clojure is very nice.<p>[1] <a href="https://github.com/r0man/hiccup/tree/clojurescript" rel="nofollow">https://github.com/r0man/hiccup/tree/clojurescript</a>
[2] <a href="http://dev.clojure.org/display/design/Feature+Expressions" rel="nofollow">http://dev.clojure.org/display/design/Feature+Expressions</a>
[3] <a href="https://github.com/r0man/dommy/tree/hiccup" rel="nofollow">https://github.com/r0man/dommy/tree/hiccup</a>