A compiler to compile CLJS's compiler...
After reading David Nolen write about compiling ClojureScript in the browser, I wanted to try it out myself. Unfortunately, the article is from 2015 and he covered the topic only from a high level.
This project is to expose cljs/compile-str
to be callable from JS. Inspired by
the Klipse project.
git clone https://github.com/somecho/cljs-compiler-compiler
cd cljs-compiler-compiler
lein cljsbuild once
There will now be a cljs.js
file in /js
. You can then add this as a script
to your html document.
Alternatively, a prebuilt JS script is already packaged in this repo.
cljs.compile("(+ 1 1)")
// returns '((1 + 1))\n'