calopter
calopter

Reputation: 67

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.

Upvotes: 3

Views: 201

Answers (2)

Mike Fikes
Mike Fikes

Reputation: 3527

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.

Upvotes: 2

Marcin Bilski
Marcin Bilski

Reputation: 611

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

Upvotes: 0

Related Questions