Hacker News new | ask | show | jobs
by sigil 5453 days ago
Great article! The only thing I'd do differently is just serve up the js as a static file instead of using code transformation. That seems likely to break for non-trivial amounts of js.
2 comments

I beg to differ. I've used ClojureJS (a Clojure to JavaScript translator) for building a non-trivial web app front end, and the result has not only been robust but also a pleasure to build (from a Lisp programmer's point of view).

[Disclosure: I'm the author of the ClojureJS library]

Interesting. What's the site, and is the original Clojure source before -> js transformation published somewhere?
We're not launched yet (but, close). I'll definitely post about it when we're live. I'm not sure how much of the Clojure (subset) code we'll publish, but I'll write more about our process and experience once we're launched.
Yeah, Generate the data (JSON) that the javascript will work with, don't generate the javascript. That way we can have easy to serve, easy to cache static javascript.
Generated JavaScript can be served and cached just like static .js files. It doesn't have to be embedded in the HTML.