babashka 2026-03-18

I've been sitting on the idea of implementing a tool to automatically create self-executing binaries for Babashka scripts. Yesterday, I finally decided to act on it, and I was positively surprised to discover https://github.com/babashka/babashka/wiki/Self-contained-executable#caxa! And it looks better than what I had in mind. Very cool. This community rocks even more than Babashka itself.

Caxa is not the preferred way to do it

What I had in mind was a "built-in command" in Babashka itself.

To specify which platforms to target.

But I thought maybe that was not wanted, as it would bloat Babashka.

But it would be a more "batteries-included-approach" and a bit "anti-Clojure ethos."

That's not my point. The caxa method was initially a way to produce self-contained executables, but the uberjar way is the recommended approach right now (same wiki page you pointed to but earlier section).

👍 1
📝 1

Right, I see. Thanks for pointing that out! I just saw the Caxa section was added fairly recently.

I was aware of the other approach (I'm the one who bookmarked it to this channel 🙂)

the caxa section is older

Right, I see that now! ChatGPT Voice mode did me dirty 🙂

1

IIRC, what's beautiful about that preferred way is the fact, that you simply binary-concatate the bb binary <for your OS of choice> + your uberjar. Therefore creating binaries for your tool is a trivial and super-fast github pipeline, no need to run it on "target OS". The pipeline just builds your uberjar once and then simply merges it with a bunch of pre-made babashka binaries.

👍 3

"We ride together... BB for life" - Bad Boys II #cljs-tui

❤️ 5