Fork me on GitHub
#babashka
<
2022-08-30
>
dpsutton16:08:21

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

borkdude17:08:41

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?

borkdude20:08:09

define "use"

Jeffrey Bay20:08:23

add it to deps and have it work

Jeffrey Bay20:08:34

(add it to the classpath?)

borkdude20:08:51

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

borkdude20:08:56

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.

borkdude20:08:10

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?

borkdude20:08:57

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.

borkdude21:08:40

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

borkdude21:08:40

but there are some limitations to the kinds of clojure code that bb can execute and what clojure can do. Here are the differences: https://book.babashka.org/#differences-with-clojure

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?

borkdude21:08:39

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.

borkdude21:08:28

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?