Re:Macchiato: ClojureScript on the Server
by arohner on Saturday December 03, 2016 @02:34PM
(#13097128)
I see the /snark, but I'll answer seriously.
Most JS code assumes it's targeting either a browser or node.js. Nashorn is very barebones, and can't pass for either. trying to run core.async on Nashorn didn't work for me because it expects either Window.setTimeout (which browsers use) or whatever-node-js uses for timers. I expect a large percentage of the libraries you'd want to use will be similarly affected.
Re:Macchiato: ClojureScript on the Server
by emidln on Saturday December 03, 2016 @11:21PM
(#13098775)
Yes. Recent cljs using the nashorn repl anecdotally performs as well as unprofiled and unoptimized clojure for a bunch of common stuff I've tested. Theoretically you could reexpose the missing parts of the JVM clojure api to cljs on nashorn given that most of the missing parts of clojure are written in java. That would let you have things like the STM if you wanted them.
Re:Macchiato: ClojureScript on the Server
by patrickthebold on Saturday December 03, 2016 @10:57PM
(#13098716)
Obviously turning code into JavaScript at least once is a mandatory requirement for fulfilling the "web" part of "web scale" and running the JavaScript on JVM gives me the "scale" part.
/snark