Clojurians
#lumo
<
2017-07-28
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

stbgz19:07:23

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

hlship22:07:08

Started playing with Lumo today. Fun stuff.

hlship22:07:54

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=> 

hlship22:07:23

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.

anmonteiro22:07:31

Glad you're using -D too

hlship22:07:04

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=> 

anmonteiro23:07:07

@hlship is andare in your local maven repo?

anmonteiro23:07:17

Lumo doesnt download the jars

hlship23:07:37

Oh. That would make a difference.

hlship23:07:48

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!

mfikes23:07:02

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

mfikes23:07:50

-K or -k (see lumo -h)

hlship23:07:15

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]
     [email protected]))

hlship23:07:44

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.

hlship23:07:38

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