babashka

Sophie Bosio 2025-11-10T11:40:43.105369Z

Hi! I was hacking at a Babashka script and found myself wanting to use the CIDER debugger on a function, but got java.lang.Exception: No reader function for tag dbg. Is there some trick to using the #dbg reader macro that I'm missing, or is not supported today? And if it's not supported, is it something you'd like PRs for in Edamame etc.? 😊 Not necessarily saying I'd be able to implement it, but I might take a crack at it!

borkdude 2025-11-10T11:52:00.668949Z

Edamame is just the parser. Adding a a debugger involves more than just adding a reader tag unfortunately (which can be done in user space as well, by just adding something to *data-readers* )

borkdude 2025-11-10T11:52:42.852509Z

Currently no CIDER middleware is supported. A rewrite of the babashka nREPL server is needed to make it more compatible with CIDER middleware from source dependencies

Sophie Bosio 2025-11-10T12:00:32.689659Z

Ah, I see! That sounds like quite a big overhaul! Thanks for the quick reply in any case 😊 I got around it without using the debugger by splitting up my function a bit more and working incrementally, which is maybe the best solution to my problem regardless 😉

borkdude 2025-11-10T12:01:20.729169Z

You can also use the regular JVM tooling with all the libraries from babashka when you print out a deps.edn with bb print-deps, that may also work

➕ 1
Sophie Bosio 2025-11-10T12:03:16.763149Z

Oh, neat! Thanks, I'll keep that in mind next time! 🙌

lambdam 2025-11-10T13:14:14.456539Z

Hello, First, thanks for this wonderful tool. I try to find a way to have a babashka dev environment that I can send to a Linux machine that doesn't have internet access and with the malli library available. 1. I explored the classpath option. I created a bb.edn with malli as a dependency and then ran bb print-deps --format classpath . The problem is that I get all the libs, not the ones that aren't included in bb. I had to bb print-deps --format classpath | tr ":" "\n" > with.txt , then remove the bb.edn file and run bb print-deps --format classpath | tr ":" "\n" > without.txt and diff the two files to have the list of jars used only by malli. When I managed to have it working with this command: rlwrap bb --classpath $(find jars -name "*.jar" | tr '\n' ':') (running bb and then (require 'malli.core) is working). First question: is there a way to achieve this in a much simpler way? Getting all jars that are in the project (declared with bb.edn) but not in bb itself and then packaging everything so that it can be sent to a remote machine without internet or simply shared with some colleagues? 2. I explored the option of compiling bb with malli included. I added it as a dependency in the project.edn and compiled bb as indicated in https://github.com/babashka/babashka/blob/master/doc/build.md. But... I didn't seem to work. malli isn't accessible when running bb . When seeing the content of the feature flag folder, it's more complicated than that right? 3. I tried to create a static binary but even with export BABASHKA_STATIC=true , it doesn't seem to produce a static binary (`ldd bb` isn't empty). I found the export BABASHKA_MUSL=true but then the compilation fails complaining about a missing static version of zlib, which I didn't manage to find. Am I missing something for producing static binaries? Thanks a lot 🙏

borkdude 2025-11-10T13:16:17.845879Z

@dam What you need is an uberjar. With malli in your bb.edn, make an uberjar like this:

bb uberjar my-uber.jar
Then you can invoke on your linux machine:
bb --classpath my-uber.jar ...

lambdam 2025-11-10T13:18:44.373719Z

Thanks a lot. And concerning compiling bb from scratch with additional dependencies, is it easily feasible and/or documented (may be I missed it)? Or it's not really accessible in a hacky way?

borkdude 2025-11-10T13:20:32.257729Z

yes, you can do this, but you need to include the right SCI configuration for malli. why would you do this btw, it's way more work? https://github.com/babashka/babashka/blob/master/doc/build.md#feature-flags

lambdam 2025-11-10T13:23:49.060479Z

When knowing the Clojure ecosystem, yes. But when (hypothetically) promoting a new tool to colleagues, having a self contained static binary with all libraries included is an advantage.

lambdam 2025-11-10T13:24:30.155329Z

But for my own use, static bb from Github releases + custom uberjar is perfect. Thanks a lot.

borkdude 2025-11-10T13:26:57.533029Z

You can make a self-contained executable from an uberjar, like this: https://github.com/babashka/babashka/wiki/Self-contained-executable

👍 2
borkdude 2025-11-10T13:27:29.676849Z

even from the static linux ones

lambdam 2025-11-10T13:28:19.286029Z

Oh great. I missed this page from the Wiki. Thanks 🙏