lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
2017-06-20T18:00:21.157196Z

I wonder if the cacheing mechanism is in any way configureable. Like chache once and whenever a macro is defined after that, lumo will reject its change, or setting compilation level to none (if its other than none), not very important, just sometimes evaluating macros can take up to a minute, just one (big) macro.

anmonteiro 2017-06-20T18:00:57.173634Z

@hlolli not exactly sure what you’re saying there

anmonteiro 2017-06-20T18:01:12.179676Z

Lumo will currently invalidate the cache for a file if that file changes

2017-06-20T18:02:49.220779Z

ok for example I just made this macro now

(defmacro define-fx
  [fx-name string-inject-fn param-vector]
  `(letfn [(param-key# [param-num#]
             (keyword (str "p" param-num#)))]
     (defn ~(symbol fx-name)
       [~(symbol "&") {~(symbol "keys") keys-vector# :as fx-env#}]
       (let [fx-env# (merge ~(apply hash-map param-vector) fx-env#)]
         (fn [aL# aR# param-cnt#]
           (let [param-vector-keywords# ~(filter keyword? param-vector)
                 param-nums# (range (inc param-cnt#)
                                    (inc (+ param-cnt# (count param-vector-keywords#))))
                 param-val-list# (partition 2 (interleave (map param-key# param-nums#)
                                                          param-vector-keywords#))
                 fx-name-key# (keyword ~fx-name)]
             ;; Swap parameter name for p-field number
             [(apply ~string-inject-fn aL# aR#
                     (map (fn [s#] (str "p" s#)) param-nums#))
              ;; Make a map of {:px [:fx-name :param-name]}
              ;; and {[:fx-name :param-name] value}
              (merge (reduce (fn [init# val#] (assoc init# (first val#)
                                                     [fx-name-key# (second val#)]))
                             {} param-val-list#)
                     (reduce (fn [init# val#] (assoc init# [fx-name-key# (second val#)]
                                                     (get get-env# (second val#))))
                             {} param-val-list#)
                     {:param-cnt (last param-nums#)})]))))))
takes ca. 30 secs to load. These are two seperate questions. That invalidate mechanism, is it possible to turn it off, so that even in situations the file has changed, lumo will not recache.

2017-06-20T18:04:36.264838Z

Maybe it would render all useage of lumo repl unuseable, in that case, I wont push that question further 🙂

anmonteiro 2017-06-20T18:06:11.303399Z

so.. if you don’t wanna use the cache, don’t pass the -K/-k flag

2017-06-20T18:06:45.317852Z

oh, I thought lumo would do it anyway, just if it would be automatic or not 🙂 nice I try that!

anmonteiro 2017-06-20T18:07:02.324641Z

caching is opt-in

anmonteiro 2017-06-20T18:07:05.325671Z

not opt-out

anmonteiro 2017-06-20T18:07:20.331849Z

it’s off by default

2017-06-20T18:07:24.333452Z

I could cache once, and use small -k to point to a pre-cached directory, and it wont recache?

anmonteiro 2017-06-20T18:08:01.347739Z

if the file has changed from the cached version, it will recompile & re-cache

2017-06-20T18:08:09.350848Z

ok

anmonteiro 2017-06-20T20:06:11.112151Z

@moxaj are you still thinking about working on the tagged literal stuff?

moxaj 2017-06-20T20:11:26.229002Z

@anmonteiro sure! I was abroad for a few days, so no progress was made

anmonteiro 2017-06-20T20:11:55.239702Z

no pressure

anmonteiro 2017-06-20T20:12:09.244819Z

just wondering if I should add it to my queue or not 🙂

moxaj 2017-06-20T20:16:49.349577Z

if your hands are empty, i'm not going to fight for it 🙂 otherwise, I can give it another shot tomorrow

anmonteiro 2017-06-20T20:17:16.359619Z

@moxaj you’re welcome to do it. happy to provide any guidance should you need it

moxaj 2017-06-20T20:19:01.399230Z

alright. later then

2017-06-20T21:55:13.391255Z

any caveats to connecting to the socket repl, trying this js snippent

//client.js
var io = require('socket.io-client');
var socket = io.connect('<http://localhost:5555>',
			{reconnect: true});

// Add a connect listener
socket.on('connect', function (socket) {
  console.log('Connected!');
});


socket.emit(`(println "Hello Lumo!")`)
nothing prints on either side (telnet works, so its running).

anmonteiro 2017-06-20T22:11:59.661767Z

you might not be redirecting streams in http://socket.io?