babashka

Bailey Kocin 2026-01-16T17:11:01.449979Z

I would like to use Babashka for some more complicated programs like a nicer TUI or potentially running a GUI app of some kind using a Java library... But I really understand nothing about the GraalVM and Babashka enough to understand what JVM things would work and what would not. Do you all have suggestions on readings I could do for: 1. Learn more about the GraalVM and Babashka as a whole 2. What babashka can do with external Java dependencies (especially those that might rely on Java Native interfaces to do OS independent abstractions)? 3. How to bundle those into an application that can be distributed?

borkdude 2026-01-28T14:45:33.742879Z

@bkocin We have a much better option now for TUIs now See recent conversations in #babashka and this: https://github.com/jline/jline3/issues/1566#issuecomment-3811572430

borkdude 2026-01-28T14:45:47.850479Z

It's still a dev build, but I can release soon

Bailey Kocin 2026-01-28T14:58:26.350889Z

I saw! I was actually considered using Golang with bubbletea because nothing similar in Clojure existed but this is just what I wanted 😃 . Thanks for sharing!

borkdude 2026-01-28T14:59:24.627169Z

this library works with bb (dev): https://codeberg.org/timokramer/charm.clj

borkdude 2026-01-28T14:59:28.018909Z

I'll release soon

❤️ 1
lukasz 2026-01-16T18:06:11.870229Z

I found that compiling JVM Clojure into native-image might be easier than adding Babashka to the mix - it of course depends on what you want to build, but nowadays with clj-easy native-image build files boil down to a script like this: https://github.com/lukaszkorecki/fusion-http/blob/main/example/native-image/build.sh - but again, it really depends on what you're trying to build

Bailey Kocin 2026-01-16T18:19:11.102419Z

Yea back to basics makes sense if I do not understand this stuff in the first place. I understand the concept of native compilation but with Clojure everything is dynamic or uses reflection so I have no idea how that would even work with native compilation.

borkdude 2026-01-16T18:20:29.650069Z

If you want scripting and don't want to get in graalvm binaries, you can use bb with for example bblgum. it does need an extra binary, named gum. https://github.com/lispyclouds/bblgum Some people just use ANSI codes to get colored output etc.

borkdude 2026-01-16T18:21:43.283839Z

One example of a standalone TUI with bb that uses ANSI codes you can find here: https://github.com/yannvanhalewyn/prstack/blob/main/src/prstack/tui/app.clj#L149

lukasz 2026-01-16T18:23:06.966509Z

@bkocin for sure, I've been following this area for a while, but it's only recently that I started using native-image etc. From what I learned it boils down to: • not having reflection warnings • using com.github.clj-easy/graal-build-time for automatically providing Clojure code build information to native-image • that shell script ;-) Not everything will play nicely of course, but majority of issues I've run into where Java libraries - not clojure itself, unless of course you do "fun" things like messing with the class loader, invoking code inside of def etc

Bailey Kocin 2026-01-16T18:24:54.447469Z

I did see Gum! I wanted to try out this Java library https://github.com/mabe02/lanterna (that does OS native stuff with java bindings) which is why I am asking all "what can I do with Babashka and GraalVM" questions

borkdude 2026-01-16T18:25:30.429739Z

I do happen to have a build flag for lanterna

borkdude 2026-01-16T18:25:50.696289Z

but it's not tested recently

Bailey Kocin 2026-01-16T18:26:54.696389Z

Okay so use libraries like this do you usually have to include them in the babashka build or use a pod?

borkdude 2026-01-16T18:27:05.737879Z

I also happen to have a lanterna pod :)

😂 1
Bailey Kocin 2026-01-16T18:28:25.841009Z

Well you are just making my day! Thank you both. I will check out the Lanterna pod first! I still want to try to do some native compiled GUI apps with Clojure so I will definitely dabble with that build script and some libraries I want to try out....

borkdude 2026-01-16T18:28:34.976759Z

bb -e '(load-string (slurp ""))'

🙌 1
Bailey Kocin 2026-01-21T22:23:09.608729Z

The things you all shared with me really helped in my learning of the GraalVM (as well as how babashka is built) so thank you! Using babashka pods seems like the simplest little app I can make so I went that route for now.

❤️ 2
borkdude 2026-01-16T20:54:51.599079Z

Babashka conf update in #babashka-conf