Skip to content

Instantly share code, notes, and snippets.

@bartojs
Created March 10, 2015 08:27
Show Gist options
  • Save bartojs/ee4115d2da5201096e90 to your computer and use it in GitHub Desktop.
Save bartojs/ee4115d2da5201096e90 to your computer and use it in GitHub Desktop.
cljs hello world
curl -LO https://github.com/clojure/clojurescript/releases/download/r3058/cljs.jar
mkdir -p src/hello
echo '(ns hello.core) (enable-console-print!) (println "Hello world!")' > src/hello/core.cljs
java -cp cljs.jar:src clojure.main -e '(require `cljs.closure) (cljs.closure/build "src" {:output-to "out/main.js"})'
echo '<html><body><script src="out/goog/base.js"></script><script src="out/main.js"></script><script>goog.require("hello.core")</script></body></html>' > index.html
open index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment