Fork me on GitHub

Hello folks. I'm using babashka by starting it with bb --start-nrepl and connecting from CIDER. Everything works fine except the inspector. When I try to inspect a var, issues an error "Inspector error for: [...]". Is this a know limitation or issue of babashka + CIDER or am I missing something? I've read the documentation but couldn't find anything. Thanks in advance.


What is "the inspector", can you tell more in detail what you are doing?


Of course: 1. Start babaska with bb --nrepl-server 2. Open a babashka file in emacs 3. cider-connect-clj to localhost and port 4. connection stablishes ok 5. I can evaluate forms (ns, defs, defns) as I usually do in Clojure projects. The inline evaluation overlay works just fine (for example: "(+ 1 2) => 3" in the same buffer). Everything is just fine until here, same experience as normal clojure development. 6. When I call cider-inspect on that same sexp, (C-c M-i in my key mapping), pops a new cider-inspect buffer with the text "Inspector error for 3". Thanks for your interest and quick answer.


I'm not sure what cider-inspect does, I'd have to reverse engineer that using to find out. Perhaps you could check what the messages are that are being sent back and forth between JVM Clojure vs bb? Then we'd know what to implement. Could be some special op. /cc @U051BLM8F @U02CV2P4J6S


With that info in hand, feel free to create an issue at babashka.nrepl


Will look into it, thanks.


@UM4CBJVLZ If you do not have a namespace and eval the ns form first, irrc currently it might throw somewhere because some nil namespace is passed nvm 1 I was wrong and 2 you where asking about "Inspector"


the way it works is that cider makes a eval request with "inspect" "true". . The "value" response, then is an alist with inspect data. babashka currently has no concept of {:inspect true} , it returns a normal eval result value, then further in the code there is an error. Here is inspect.clj in cider-nrepl: . The golden fix might be e.g. a pod with the whole cider middleware


You can also use portal for inspecting deeply nested data structures. It works with bb


The bb nrepl doesn't support all CIDER specific things, but perhaps we can make some middleware pluggable in user space


@U04V15CAJ Portal is a great alternative, works like a charm! Again, thanks.

👍 2

Btw, cider-nrepl's inspect middleware is just a think wrapper around


@U051BLM8F Thanks. Is the inspector also supported in other environments like Calva and neovim?


Not sure. The functionality is certainly not CIDER-specific, but I have no idea of someone has implemented so far or not. @U0ETXRFEW mentioned today he's interested in adding this in Calva.


I've been interested in adding it to Calva for a long time. And lately I've spoken to several users who wish Calva had it. It's going to happen when I or someone else find a time slot large enough to allow some focus.

👍 1

I just wanted to bump this. I love cider inspect and not having it is something that makes me trade babashka for clojure.


I was looking into making cider middleware work on bb. Will make a discussion issue on github soon

😃 2
Adam Helins11:09:43

Is babashka.tasks available to the JVM akin to babashka.fs?


Not currently, but I think it could be


you can also use the babashka uberjar if you don't want to use the binary for some reason

Adam Helins11:09:07

It would help for writing code that reliably run on both the JVM and BB (often the case, but that would bring us closer to 100% 🙂 )


What are you specifically looking for, the task runner as a command line thing?

Adam Helins11:09:23

Mostly access to ...tasks/shell and ...tasks/clojure from the JVM


I see. I think we could just expose that namespace in the babashka project, would this be enough?


then you can depend on babashka as a dependency

Adam Helins11:09:33

I guess so yes, essentially renaming babashka.impl.tasks to babashka.tasks?


well, for starters, just exposing those two functions

👌 1

I'm careful to not expose any internal details, so I can still make changes to those

Adam Helins11:09:49

Sounds sensible 🙂


ok issue welcome


and / or pr

👍 1

I’m getting an error upgrading on my MacBook Air M2:

λ brew upgrade babashka
==> Upgrading 1 outdated package:
borkdude/brew/babashka 0.9.162 -> 0.10.163
==> Downloading 
==> Downloading from 
######################################################################## 100.0%
Error: SHA256 mismatch
Expected: 3ba11a506a98400913d72be2294adf2ff66a87a8dc1b791569e4368e39921165
  Actual: 21379368c0b9674a1656e9786191e6e496ab57b08242e621fa76b76e93056d1f
    File: /Users/john/Library/Caches/Homebrew/downloads/fb06d9f5a6347b7c18e37e1e83edc294811cb176c4c7c3b5f3b024080e6e2fd3--babashka-0.10.163-macos-aarch64.tar.gz
To retry an incomplete download, remove the file above.


Darn, again


Yep, works. Thanks!


I have no idea what went wrong there, but it keeps happening. If someone can find it out, please do.


Btw, the newest bb now also supports -Sdeps like the clojure CLI. This can come in handy if you want to e.g. change the :mvn/local-repo during a CI build