joker

Discuss all things joker, the Clojure interpreter/linter on top of Go. https://github.com/candid82/joker
gleisonsilva 2020-01-17T11:25:39.001800Z

Hello! I'm trying to make a HTTP post request using joker.http/send but I'm not figured out yet how to pass the parameters into the :body request map value... has anyone an example of that?

gleisonsilva 2020-01-17T11:26:41.002800Z

In another words -> how to convert a regular Clojure map into a valid content to :body map value?

jcburley 2020-01-17T16:50:39.003200Z

Have you checked out joker.hiccup/html?

jcburley 2020-01-17T20:26:57.003700Z

The latest version, just pushed, squeezes another 2ms or so out of startup time on my MacBook Pro (OS X), though it's barely measurable as an improvement on my Ryzen 3: https://github.com/jcburley/joker/tree/gen-code Build via ./run.sh as usual; the resulting joker executable, also named (via hardlink) joker.fast, is the fast-startup version, while joker.slow is the normal version. I hope to make this PR-able by next Thursday, possibly sooner. Needs more cleanup, but the list of known optimizations to pursue is now empty. (The list could start growing again if somebody analyzes why it's still 2.5x or so slower starting up than a simply command-line-echo program written in Go.) Enjoy!

Candid 2020-01-24T00:56:41.000100Z

James is referring to start up time, not the actual execution speed.

👍 2
Candid 2020-01-17T20:38:43.003800Z

:body is just a string that can be whatever you want it to be

Candid 2020-01-17T20:39:25.004Z

if you want to convert a map to JSON encoded string, look at joker.json namespace.

hlship 2020-01-17T20:46:11.004900Z

Where are we in terms of a REPL (preferably from Cursive)? I'm working on some tricky stuff and decided to develop it in Clojure in Cursive, then copy-and-paste into my Joker code.

hlship 2020-01-17T20:46:22.005200Z

Of course, it is awesome that you can do that!

hlship 2020-01-17T21:25:16.006Z

[ANN] multi 1.1.0 https://github.com/hlship/multi I've enhanced multi with a new defcommand macro that eliminates a lot of tedium in writing commands.

(multi/defcommand configure
  "Configures the system with keys and values"
  [verbose ["-v" "--verbose" "Enable verbose logging"]
   :args
   host ["HOST" "System configuration URL"
         :validate [#(re-matches #"https?://.+" %) "must be a URL"]]
   key-values ["DATA" "Data to configure as KEY=VALUE"
               :parse-fn (fn [s]
                           (when-let [[_ k v] (re-matches #"(.+)=(.+)" s)]
                             [(keyword k) v]))
               :update-fn (fn [m [k v]]
                            (assoc m k v))
               :repeatable true]]
  (do-configure host key-values {:verbose verbose}))

👍 1
hlship 2020-01-17T21:44:39.006400Z

Here's a larger example of defcommand in action: https://github.com/hlship/threaded-conversation/commit/e3227b42c24df39fc57c30c69a9aefe28b8e6218

2020-01-17T21:53:09.006700Z

Cursive can now do Socket REPL but still isn't able to evaluate forms in the Joker REPL. I can see them both connecting. Perhaps you have better luck!