lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
Jon 2018-04-15T06:31:56.000066Z

=>> node out/main.js
/Users/chen/repo/gist/lumo-api/out/main.js:1
(function (exports, require, module, __filename, __dirname) { goog.addDependency("base.js", ['goog'], []);
                                                              ^

ReferenceError: goog is not defined
    at Object.<anonymous> (/Users/chen/repo/gist/lumo-api/out/main.js:1:63)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)
    at bootstrap_node.js:660:3
=>> lumo build.cljs
Assert failed: :nodejs target not compatible with :whitespace optimizations
(not (and (= target :nodejs) (= optimizations :whitespace)))
	 (Object.lumo$closure$check_node_target)
	 Function.lumo.closure.build.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:4430:14)
	 Function.lumo.build.api.build.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:594:31)
	 Function.lumo.build.api.build.cljs$core$IFn$_invoke$arity$2 (evalmachine.<anonymous>:524:29)
	 lumo$build$api$build (evalmachine.<anonymous>:510:29)
	 (evalmachine.<anonymous>:2:22)
	 ContextifyScript.Script.runInThisContext (vm.cljs:50:33)
	 Object.runInThisContext (vm.cljs:152:38)
	 (Object._t)
	 (Object.lumo.repl.caching_node_eval)

=>> lumo build.cljs

Jon 2018-04-15T06:32:11.000050Z

compiling ClojureScript code with Lumo is not good experience

Jon 2018-04-15T06:32:37.000073Z

and the last command just hangs. probably it's because it's slow.

Jon 2018-04-15T06:33:05.000050Z

I don't know how to use it...

Jon 2018-04-15T06:33:47.000030Z

src/app/main.cljs

(println "Hello world!")
build.cljs
(require 'lumo.build.api)

(lumo.build.api/build "src" {:output-to "out/main.js"
                             :optimizations :simple
                             :target :nodejs})

Jon 2018-04-15T06:33:55.000039Z

maybe I'm wrong.

Jon 2018-04-15T06:35:41.000074Z

I thought I could add an example that beginners can compile ClojureScript code to Node.js and run node out/main.js in a few steps. Turned out not as simple as I thought.

dehli 2018-04-15T12:03:25.000046Z

You can compile it using clojure just as easily. That's what I'm doing and it's working well

richiardiandrea 2018-04-15T15:46:48.000100Z

@jiyinyiyong the GCC compiler for js is not as fast as the Java one for sure and there are lot of things that might go wrong. I am compiling with JVM at the moment as well