lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
stbgz 2017-07-28T19:52:23.957515Z

@mrg look at https://github.com/eginez/calvin I have a command that does that

👍 1
hlship 2017-07-28T22:22:08.508591Z

Started playing with Lumo today. Fun stuff.

hlship 2017-07-28T22:25:54.568589Z

Can cljs.core.async run inside Lumo? I was hopefull, but now I'm seeing this:

~/workspaces/github/active-status > lumo  -D walmartlabs/active-status:0.1.16,org.clojure/core.async:0.3.443 -r
Lumo 1.6.0
ClojureScript 1.9.671
Node.js v8.1.3
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=> (require 'com.walmartlabs.active-status)
No such namespace: java.util.concurrent.locks.Lock, could not locate java/util/concurrent/locks/Lock.cljs, java/util/concurrent/locks/Lock.cljc, or Closure namespace "java.util.concurrent.locks.Lock" in file cljs/core/async/impl/ioc_macros.clj
         (new)
         Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1935:200)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2482:92)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:2481:92)
         (NO_SOURCE_FILE <embedded>:5802:520)
         Object.lumo.repl.load_other (NO_SOURCE_FILE <embedded>:6201:380)
         lumo.repl.load (NO_SOURCE_FILE <embedded>:6205:106)
         Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5804:390)
         Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5815:277)
         (NO_SOURCE_FILE <embedded>:5816:141)

cljs.user=> 

hlship 2017-07-28T22:28:23.607004Z

That makes it feel like I can compile with the JVM to create JS I can load into Node, but not quite get what I want in terms of running entirely inside Lumo.

anmonteiro 2017-07-28T22:37:52.752677Z

@hlship https://github.com/mfikes/andare

anmonteiro 2017-07-28T22:40:31.791110Z

Glad you're using -D too

hlship 2017-07-28T22:45:04.856795Z

Missing something ...

15:43:03 ~/workspaces/github/active-status > lumo  -D andare:0.7.0 -r
Lumo 1.6.0
ClojureScript 1.9.671
Node.js v8.1.3
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=> (require '[cljs.core.async :as as])
No such namespace: cljs.core.async, could not locate cljs/core/async.cljs, cljs/core/async.cljc, or Closure namespace "cljs.core.async"
         (new)
         Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1935:200)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2482:92)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:2481:92)
         (NO_SOURCE_FILE <embedded>:5802:520)
         Object.lumo.repl.load_other (NO_SOURCE_FILE <embedded>:6201:380)
         lumo.repl.load (NO_SOURCE_FILE <embedded>:6205:106)
         Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5804:390)
         Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5815:277)
         Function.cljs.js.ns_side_effects.cljs$core$IFn$_invoke$arity$6 (NO_SOURCE_FILE <embedded>:5867:251)

cljs.user=> 

anmonteiro 2017-07-28T23:12:07.221698Z

@hlship is andare in your local maven repo?

anmonteiro 2017-07-28T23:12:17.223745Z

Lumo doesnt download the jars

hlship 2017-07-28T23:12:37.227771Z

Oh. That would make a difference.

hlship 2017-07-28T23:35:48.502430Z

I don't think its going to be fast enough for my needs. At least 10 seconds to load my namespace. core.async is pretty heavy weight!

mfikes 2017-07-28T23:38:02.526220Z

@hlship If using Andare, make use of Lumo's cache capability

mfikes 2017-07-28T23:39:50.545589Z

-K or -k (see lumo -h)

hlship 2017-07-28T23:40:15.550657Z

I'm hitting some kind of bug:

16:34:51 ~/workspaces/github/active-status > lumo -D andare:0.7.0  -D walmartlabs/active-status:0.1.16 -D io.aviso/pretty:0.1.35 -r
Lumo 1.6.0
ClojureScript 1.9.671
Node.js v8.1.3
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=> (require 'com.walmartlabs.active-status)
Could not parse ns form com.walmartlabs.active-status in file com/walmartlabs/active_status/cljs_macros.clj
	 (new)
	 Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1935:200)
	 Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2482:92)
	 (NO_SOURCE_FILE <embedded>:5863:108)
	 cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5838:464)
	 (NO_SOURCE_FILE <embedded>:5835:384)
	 Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5793:38)
	 Object.cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5835:41)
	 (NO_SOURCE_FILE <embedded>:5857:20)
	 cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5838:464)

Invalid :refer, var cljs.core.async/go does not exist in file com/walmartlabs/active_status/cljs_macros.clj
	 (new)
	 Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1935:200)
	 Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2482:92)
	 Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:2481:92)
	 Object.cljs.analyzer.check_uses (NO_SOURCE_FILE <embedded>:2813:281)
	 Function.cljs.analyzer.check_use_macros.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2820:383)
	 (NO_SOURCE_FILE <embedded>:2824:409)
	 (NO_SOURCE_FILE <embedded>:1058:486)
	 Function.cljs.core.update_in.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1058:499)
	 Object.cljs.analyzer.check_use_macros_inferring_missing (NO_SOURCE_FILE <embedded>:2823:451)

cljs.user=>
But cljs-macros doesn't use anything core.async:
(ns ^:no-doc com.walmartlabs.active-status.cljs-macros)

(defmacro with-output
  [out & body]
  `(binding [*out* ~out]
     ~@body))

hlship 2017-07-28T23:44:44.598645Z

Next bad thing:

Cannot write RegExp
	 Object.com.cognitect.transit.impl.writer.marshal (NO_SOURCE_FILE <embedded>:5144:288)
	 Object.com.cognitect.transit.impl.writer.emitMap (NO_SOURCE_FILE <embedded>:5137:255)
	 Object.com.cognitect.transit.impl.writer.marshal (NO_SOURCE_FILE <embedded>:5144:129)
	 (NO_SOURCE_FILE <embedded>:5137:409)
	 cljs.core.PersistentHashMap.forEach (NO_SOURCE_FILE <embedded>:1384:215)
	 Object.com.cognitect.transit.impl.writer.emitMap (NO_SOURCE_FILE <embedded>:5137:286)
	 Object.com.cognitect.transit.impl.writer.marshal (NO_SOURCE_FILE <embedded>:5144:129)
	 (NO_SOURCE_FILE <embedded>:5137:409)
	 cljs.core.PersistentHashMap.forEach (NO_SOURCE_FILE <embedded>:1384:215)
	 Object.com.cognitect.transit.impl.writer.emitMap (NO_SOURCE_FILE <embedded>:5137:286)
I take it the cache is an EDN representation of the parsed source? And the Regular expression I have there is causing trouble.

hlship 2017-07-28T23:45:38.607758Z

I can't believe my code is the first that uses a ClojureScript regexp literal? Could it be something else?