Clojurians
#lumo
<
2017-03-13
>

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

vikeri09:03:00

Has lumo implemented slurp? Or do I have to use nodejs’ http lib for get requests?

hlolli09:03:18

@vikeri there's nodejs fs library, someone wrote thin wrapper around them in macchiato/fs, which you can use in Lumo

vikeri09:03:23

Alright, I was thinking about getting url-content and not file content, similar to planck.http/get http://planck-repl.org/planck-namespaces.html

vikeri09:03:11

I solved it manually though, not very elegant but works for now:

(defn parse-response [func]
  (fn [resp]
    (let [body (atom "")]
      (doto resp
        (.on "data" (fn [d]
                      (swap! body #(str % d))))
        (.on "end" #(func @body))))))

(defn get-url [url callback]
  (.get https url (parse-response callback)))

hlolli09:03:01

ahh oops I totally misunderstood the "for get requests" part. Need another coffee...

vikeri09:03:29

Np :slightly_smiling_face:

jonpither14:03:10

Question about this error message: WARNING: No such namespace: roll.core, could not locate roll/core.cljs, roll/core.cljc, or Closure namespace "" at line 1

jonpither14:03:42

It's a bit misleading, because the directory with roll.core is on the classpath, just that I haven't required it..

jonpither14:03:13

if I explicitly require roll.core, then I can execute statements that refer to roll.core vars

jonpither14:03:40

unless I'm missing something :slightly_smiling_face:

jonpither14:03:18

Ah sorry this seems like ClojureScript itself generating the warning, still a bit misleading?

kauko17:03:02

@mfikes Curious, have you compared the speeds of tach lumo or tach planck to doo phantom? I expected the former to be faster, but a quick test gave me 32s, 29, 19s respectively

kauko17:03:39

I only ran one test, cause so many of our tests require a browser environment. I tried commenting them out, but gave up :stuck_out_tongue:

anmonteiro17:03:51

@kauko self-hosted CLJS is supposed to be faster on JavaScriptCore

anmonteiro17:03:00

Lumo is just faster to start up

anmonteiro17:03:15

Planck may actually be faster to compile + run source

kauko17:03:01

Alright. I was mostly surprised how fast phantom started up compared to the two

kauko17:03:10

I would've expected it to be slower

mfikes18:03:32

@kauko Tach doesn't yet expose the capability to turn on compilation caching in Lumo and Planck. Perhaps if that were added then subsequent runs of tests would be quicker.

mfikes18:03:53

I'll add an issue to Tach to make that possible.

kauko18:03:02

Nice :slightly_smiling_face:

mfikes18:03:44

I suspect the root cause of what you are seeing is compilation latency, so the above would likely address it.