Fork me on GitHub

Hi. I am starting to play with babashka and I am wondering if it’s possible to use REPL + calva with it.


@include i think it may be possible to use bb with calva - may be #calva folks can help with details?


@sogaiu yes maybe. I was able to connect but the behavior is a little bit weird. I think calva expects a initial full namespace load (send to repl) but I have a shebang 🙂 . tomorrow I will ping them; it’s already late here 🙂 thank you anyway.

👍 8

it should work. Can you describe ”a little bit weird” some? 😃


@pez hi sorry for the delay .) so I can write expressions directly to the repl but I cannot send selected forms from the editor to the repl via any shortcut. I think is is related with the problem I mentioned above. I can’t send the namespace in first place. I don’t get an error or any other message. my babashka has an initial shebang on top and maybe this is confusing calva/repl.


ok I see I can create a barebones clj project/structure and call this namespace via bb cmdline, this way I don’t need that shebang and I bet calva/repl will work just fine.


@include shebangs should just work fine with any Clojure environment


the Clojure reader ignores shebangs


so if Calva doesn't support that, something weird is going on (cc @pez)


I hope Calva doesn't have problem with it. Can you share a bit more about what the file looks like?


@bozhidar ah ok; nice to know that! clj n00b here 🙂 who will pick and migrate a couple of scripts from bash to clj to learn.


@pez just a simple mkdir -p foo ; touch foo/test.clj ; code foo/test.clj (it‹s not a conventional “project/structure”. Then I have a shebang as I mentioned #!/usr/bin/env bb and the a simple def symbol and it’s println. I am not able to jack-in a repl.


There is no jack-in for babashka, yet. You'll need to start it manually: bb --nrepl-server localhost:1667, then connect.

👍 4

I should document this a bit... Anyway, when you connect you choose Project type: Generic, and then tell Calva which port you bound babashka's nrepl server to (1667 in this case). (I also suggest not sending stuff to the REPL window, but instead rely on inline evaluations, but that is a matter of style, maybe).


This method is also suggested here: Although this document does not go into detail how to connect from each individual editor. PR welcome for Calva 🙂

👍 8

thank you @pez and @borkdude. I just jumped right ahead to play with babashka assuming some defaults I had in my mind 🙂


OT: “First thing first. The and Calva has some friction between them. Expect it to be a bit painful.” ah ok 🙂



😄 4

I vaguely remember somebody building some static site renderer style thing with graal and/or bb — is that a thing and does anybody know what I’m thinking of?