Fork me on GitHub
#babashka
<
2020-04-10
>
borkdude10:04:51

Who'da thought: just tried bb 0.0.81 on Windows 10 and babashka.curl worked out of the box!

C:\Users\borkdude\Downloads>bb -e "(:status (curl/get """"))"
200

😎 24
borkdude10:04:40

I didn't even know Windows shipped with curl these days

sogaiu10:04:57

nice that it works -- i think we discussed that windows had curl a bit back though 🙂

borkdude10:04:11

so going with curl seems to be a really good choice then, cross-platform

sogaiu10:04:28

yes, that is true

nate17:04:56

Thanks for adding shutdown hooks! I have a script that launches a repl using clojure and when I hit ctrl-c the jvm process would run away with an io error. Adding a shutdown hook to kill the jvm process works like a charm.

borkdude17:04:39

good to hear!

👍 4
borkdude18:04:26

I ran into a problem with babashka.curl, the header parsing from the same stream as the effective response sometimes leads to problems. That's why it's now moved to dumping to a tempfile and then parsing that. But curl won't write the header file before you start reading the input stream. It basically waits for you to consume it and then starts the request it seems. That's why I did this: https://github.com/borkdude/babashka.curl/blob/ee4ff3d5e2405ca636ed9090318f8fa8eca0a30f/src/babashka/curl.clj#L134 But maybe that can be improved. It feels like a stupid workaround.

👍 4
borkdude18:04:34

Hmm, the issue is course that you don't know when curl is done writing that file. So maybe this is the correct way, because if you can consume the first byte, the headers must already be there.

wilkerlucio21:04:26

has somebody here connected Cursive REPL to babaskha? I tried with nrepl, but that generates tons of errors, and with socket repl the connection doesn’t start, so I wonder if someone figure how to make this integration works

borkdude22:04:35

@wilkerlucio It might help starting it with BABASHKA_DEV=true bb --nrepl-server to see what messages it receives

borkdude22:04:07

I've heard reports from vim-iced and Calva that the nREPL server works for them and I've tested CIDER and lein repl :connect myself

borkdude22:04:42

The socket repl is pretty simple so I'm surprised that doesn't work, but maybe Cursive assumes something about bb that it doesn't have

wilkerlucio22:04:05

I was doing some googling, I got to make it work using: https://github.com/mfikes/tubular

wilkerlucio22:04:36

this thread explains why it doesn’t work with socket connection in Cursive out of the box: https://groups.google.com/forum/#!msg/cursive/GfbTm-Tut4M/r2VRlaCsBAAJ

borkdude22:04:15

That's a nice link to put in the README maybe

👍 4