clojure-lite
Disclaimer: this is a super-immature toy project :bowtie:
clojure-lite
compiles an extremely small subset of clojure to JavaScript. That's pretty much all it does. Have fun!
It currently lets you:
- define and refer variables
- define and call functions
Other quirks:
- the standard library is limited to
+
,-
,*
, and/
- there's only one type:
number
Example
is compiled to:
const __lib = {};__lib'*' = { return args;};let PI = 3141592653589793; { return __lib'*'PI radius radius;};
Usage
Programmatic:
$ npm install clojure-lite --save
const cl = ; const compile = _; const code = ;
CLI:
$ npm install -g clojure-lite
$ echo '(def answer 42)' | cl > code.js