This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-24
Channels
- # announcements (2)
- # babashka (39)
- # babashka-sci-dev (1)
- # beginners (30)
- # biff (2)
- # cider (9)
- # clj-commons (5)
- # clj-yaml (30)
- # cljdoc (15)
- # clojars (1)
- # clojure (13)
- # clojure-europe (42)
- # clojure-poland (6)
- # clojure-uk (2)
- # cursive (4)
- # datomic (24)
- # graalvm (12)
- # graphql (7)
- # hyperfiddle (91)
- # lsp (175)
- # malli (3)
- # membrane (9)
- # music (1)
- # off-topic (5)
- # reagent (7)
- # reitit (1)
- # releases (7)
- # rewrite-clj (1)
- # scittle (7)
- # shadow-cljs (3)
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.
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 https://github.com/lambdaisland/nrepl-proxy 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
@UM4CBJVLZ If you do not have a namespace and eval the ns form first, irrc currently it might throw somewhere because some nvm 1 I was wrong and 2 you where asking about "Inspector"nil
namespace is passed
the way it works is that cider makes a eval request with "inspect" "true". https://github.com/clojure-emacs/cider/blob/master/cider-inspector.el#L354 . 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: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/inspect.clj .
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
Btw, cider-nrepl's inspect middleware is just a think wrapper around https://github.com/clojure-emacs/orchard/blob/master/doc/inspector.org
@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.
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
Is babashka.tasks
available to the JVM akin to babashka.fs
?
you can also use the babashka uberjar if you don't want to use the binary for some reason
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% 🙂 )
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?
I guess so yes, essentially renaming babashka.impl.tasks
to babashka.tasks
?
I'm careful to not expose any internal details, so I can still make changes to those
Sounds sensible 🙂
Babashka 0.10.163 is out! Changelogs: https://github.com/babashka/babashka/blob/master/CHANGELOG.md#010163-2022-09-24
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.
I have no idea what went wrong there, but it keeps happening. If someone can find it out, please do. https://github.com/borkdude/homebrew-brew/blob/master/update-babashka