简体   繁体   中英

Clojurescript self compilation for node

I've been following along the clojurescript self compilation news, including most recently http://www.yogthos.net/posts/2015-11-12-ClojureScript-Eval.html

Would a similar approach work with nodejs as a target? Although the bootstrapped REPL is very cool, I'm interested in compiling (or otherwise making executable) cljs files with node. I'm hoping this would make writing and running clojure(script) scripts on old / embedded hardware a less painful experience in terms of JVM startup time and memory consumption. Is this a reasonable hope? How would I go about producing such an executable from cljs source? Thank you for your input.

Check out https://github.com/kanaka/cljs-bootstrap

This can easily be installed via npm install -g cljs-repl . After doing that you can run a *.cljs file via cljs foo.cljs .

I suppose it should work with node.js w/o problems but do you need self-hosting at all? How about compiling it locally and shipping compiled js (with optimization set to none)?

If it is an option, this may be helpful: https://github.com/bhauman/lein-figwheel/wiki/Node.js-development-with-figwheel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM