An experimental Clojure(ish) to Javascript compiler.
Docs: http://zk.github.com/cljs
-
lein new cljs-test -
Add a
:cljsentry to your project.clj:(defproject... :cljs {:source-path "src/cljs" :source-output-path "resources/public/js" :source-libs [some-ns.app] :test-path "test/cljs" :test-output-path "resources/testjs" :test-libs [app-test]})
-
Verify the above paths exist.
-
Add
[cljs "0.3.0"]and[lein-cljs "0.2.1"]to your:dev-dependencies. -
Then
lein depsandlein cljs watch. This will start the watcher, which will automatically recompile your cljs libs when cljs source files change. -
You now have the ability to use lisp full-stack (kind of), begin global domination.
See http://github.com/zkim/cljs-contrib, specifically:
-
project.cljfor info on the:cljsopts map. -
Clone the repo and open
resources/border-layout.htmlandresources/panel.htmlin your browser. This will give you an idea of how to use the compiled cljs output.
Be sure to include underscore.js in a script tag before including any compiled cljs output.
- Integrate Google's Closure Compiler for minifying
- Integrate js-test-driver for testing
-
REPL -- Browser stuff from https://github.com/ivan4th/swank-js & comm from swank-clojure
-
Macros
-
TCO -- Possible with CPS? http://eriwen.com/javascript/cps-tail-call-elimination/
Copyright (C) 2010-2011 Zachary Kim
Distributed under the Eclipse Public License, the same as Clojure.
