Fork me on GitHub
#babashka
<
2021-02-23
>
steveb8n08:02:23

when I click the link below I get a 404. Just a heads up… bb --nrepl-server 1667 Started nREPL server at 127.0.0.1:1667 For more info visit https://github.com/babashka/babashka/blob/master/doc/repl.md#nrepl.

borkdude08:02:14

Ah right, that link moved to the http://book.babashka.org. I will change it, thanks

steveb8n08:02:28

@borkdude @cfleming what’s the state of play for using bb --nrepl-server in Cursive? It seems to work for me but for each eval I also get a Cursive exception clojure.lang.ExceptionInfo: Could not resolve symbol: cursive.repl.runtime/completions

steveb8n08:02:50

I can ignore/tolerate this but it would be cool if it could be silenced

borkdude08:02:00

Is this an nREPL middleware?

steveb8n09:02:53

No, vanilla cursive. I’d guess it’s Cursive assuming a CLJ or CLJS env. prob best if we wait for comment from Colin

steveb8n09:02:16

I’m not blocked and have pods working already so I’m good. I just ignore it

steveb8n09:02:31

if it becomes too painful, I’ll switch to Calva

steveb8n09:02:35

I might try creating an nrepl middleware that throws away that specific exception. that would make life a little nicer

borkdude09:02:59

Yeah, the thing is with babashka nREPL is that you (at the moment) can't have middleware, since the nREPL server is pretty much a monolithic thing that supports only the basic nREPL features + the pprint middleware

borkdude09:02:19

We could support defining middleware in a babashka script possibly, but that's not there at the moment

steveb8n09:02:57

Ok. That's definitely my knowledge limit. Let's see what Colin says in (our downunder) morning

cfleming19:02:05

Ugh, I’ve been meaning to look at this, sorry. Cursive should probably either interrogate the REPL at startup to get an idea of the env available, or allow the user to configure it and assume they know what they’re doing.

cfleming19:02:37

Cursive doesn’t use middleware, so it’s not that. I suspect the code it sends over for completion uses features that bb doesn’t offer.

borkdude19:02:04

@cfleming Can Cursive connect to an already started nREPL that hasn't been started by Cursive itself? I would expect the same problem to manifest there

cfleming19:02:22

Yes, it can.

steveb8n22:02:08

I thought this might be the case. I’ll ignore the exceptions for now. It’s worth it because using a REPL for bb is much faster than testing using bb cli

steveb8n22:02:51

fwiw: I am starting the nrepl server in a terminal window and connecting to that. It was trivial to get started, this is a really good DX

borkdude08:02:16

@adam.james Thanks for becoming a sponsor on Github. Would you like to have access to the private sponsors channel?

adam-james12:02:22

Sure, that sounds nice

borkdude16:02:39

@heow Thanks for sponsoring! Would you like to have access to the private sponsors channel?

👍 3
heow16:02:57

does anybody store config info in an environment var, like a hash?

heow17:02:04

export FOO_OPTS='{:name "Alice" :score 10}'

❤️ 3
🤓 3
rwstauner17:02:57

i have at least one project that does that

👍 3
heow17:02:17

great, I was wondering if there is a good reason I don't see it more often

Dig17:02:57

i've noticed that clojure.instant is not included. is it an oversite or there is a reason for it?

borkdude17:02:37

How are you using clojure.instant? bb generally advices to use java.time

Dig17:02:54

some old code that i cut and pated, i guess i can port it to java.time

Dig20:02:33

pst.clj example helped a lot, that zone stuff in java.time is tricky 🙂

borkdude20:02:36

you don't have to use the Zoned stuff if you use the Local stuff right?

borkdude20:02:23

btw this lib also works with babashka: https://github.com/henryw374/cljc.java-time

👍 6
heow20:02:59

cljc.java-time can vouch for it!

steveb8n23:02:55

@borkdude following up from an earlier thread, I can confirm that bb works with aws-vault i.e. aws-vault exec cloudwatch-readonly -- bb --nrepl-server 1667 where cloudwatch-readonly is one of my iam roles

👍 6
steveb8n23:02:55

probably not a big surprise but still good to know as vault is a best practice for AWS access on dev machines