babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
solf 2021-02-12T06:18:49.481900Z

It seems I stumbled upon a bug: when using babashka as an nrepl server, printing something will correctly send the output to the nrepl client, however printing something inside something lazy-evaluated will instead send the result to babashka process itself:

borkdude 2021-02-12T13:54:27.483100Z

fixed on master

borkdude 2021-02-12T13:54:30.483300Z

thanks for reporting

solf 2021-02-13T09:39:53.491300Z

Great, thanks!

solf 2021-02-12T06:22:54.482200Z

I created an issue in babashka/nrepl

martinklepsch 2021-02-12T14:36:40.484900Z

I’m running into a strange issue where a var can’t be found in a required namespace but when running that namespace directly, things are fine:

bb -cp bb-src -m mkl.atom
clojure.lang.ExceptionInfo: Could not resolve symbol: posts/sort-posts [at /Users/martinklepsch/code/03-personal/martinklepsch.org/bb-src/mkl/view.clj, line 197, column 16]

bb -cp bb-src -m mkl.view
; => works fine

martinklepsch 2021-02-12T14:37:12.485Z

note how the error occurs in view.clj but then running mkl.view is doing just fine

borkdude 2021-02-12T14:38:22.485200Z

can I test this locally somehow?

martinklepsch 2021-02-12T14:43:39.485400Z

yes, I can push it

borkdude 2021-02-12T14:52:09.485800Z

hmm, if I add a (prn (resolve 'mkl.posts/sort-posts)) in the mkl.view namespace then I get nil when invoking that through -m mkl.atom :/

borkdude 2021-02-12T14:53:16.486Z

and when I put a side effect in the mkl.posts ns I don't see it, so it seems it's not getting loaded somehow

martinklepsch 2021-02-12T14:55:18.486200Z

yeah that matches what I’ve seen. I’ve observed something similar when loading these namespaces through the REPL as well but initially discarded it as flakyness in one of the intermediate layers

borkdude 2021-02-12T15:02:52.486400Z

I'll take a deeper looking after the meeting I'm having

martinklepsch 2021-02-12T15:04:17.486600Z

cool, no rush. Interestingly when deleting the :require mkl.view from the mkl.atom namespace it still fails with the same error

borkdude 2021-02-12T15:51:53.486800Z

@martinklepsch I think I found it. I think you have a circular reference

borkdude 2021-02-12T15:52:10.487100Z

mkv.view requires mkv.posts and vice versa

borkdude 2021-02-12T15:52:19.487300Z

of course sci could give a better error here

martinklepsch 2021-02-12T15:52:57.487500Z

ahh!

borkdude 2021-02-12T15:53:08.487700Z

Removing [mkl.view] from mkl.posts did the trick

borkdude 2021-02-12T16:00:19.487900Z

Thanks for sponsoring :)

❤️ 1