Fork me on GitHub

we have ended up with untracked .clj-kondo/babashka/ folder. Should this be added to gitignore?


if you don't use this config, e.g. for babashka.fs, then you can ignore it

👍 1
Jeffrey Bay20:08:28

this is probably a stupid question, but can you use an arbitrary jar in babashka?


define "use"

Jeffrey Bay20:08:23

add it to deps and have it work

Jeffrey Bay20:08:34

(add it to the classpath?)


yes, you can add it to the classpath or in deps with local/root


should both work

Jeffrey Bay20:08:28

is there a specific place in a manual or a blog post or something that outlines the limitations of the JVM babashka starts up? I've sort of tried to answer it for myself a couple times, but i keep getting distracted by not finding it relatively easily, and going back to just getting stuff done.


What do you mean with "the limitations of the JVM"?

Jeffrey Bay20:08:02

suppose i start a babashka process with an arbitrary jar on the classpath (as mentioned earlier) - what can it not do that you would expect from a "normal' jvm?


is this question about jars and classpaths, or is it about language support differences between bb and clojure?

Jeffrey Bay20:08:13

jars and classpaths; basically, we have a jar that does an operation, and I was thinking about whether i could write a babashka script to wrap and automate it.

Jeffrey Bay20:08:40

I'm trying to build a mental model for what is possible with Babashka, basically.


you can use jars to execute code from, no technical limitations to that.


but there are some limitations to the kinds of clojure code that bb can execute and what clojure can do. Here are the differences:

Jeffrey Bay21:08:08

great answers. thanks so much for all you do!

❤️ 1
Jeffrey Bay21:08:21

actually, i think it is this line: • A pre-selected set of Java classes are supported. You cannot add Java classes at runtime. which most confuses me. Given what you said above about using java jars, could you add more detail on how to interpret this bullet?

Jeffrey Bay21:08:25

is this combined with your statement basically saying that you can have a jar on the classpath, but you can't alter the classloader/dynamically add a generated class the way you could in a raw clojure program?


a jar is basically just a zip file that contains resources. it doesn't matter if these resources come in a jar file or are read from a directory: this is just a file format. jar isn't that interesting.


you can add clojure sources dynamically to the classpath, but adding Java classes has no impact on bb whatsoever, since Java classes need to be built into bb

Jeffrey Bay21:08:55

so our jar that contains a set of java classes?

Jeffrey Bay21:08:20

we'd have to build a custom version of bb to use it?