Fork me on GitHub
#babashka
<
2023-07-16
>
Stephan Renatus18:07:18

non-urgent curiosity question regarding what pods are for: creating wrappers for libraries of other languages (like Go) and making them available neatly packaged for bb, I get that. What I don’t understand is why there are pods for JVM, or even clojure libraries like https://github.com/babashka/instaparse-bb. Please, someone tell me what I’m missing here

borkdude18:07:57

instaparse-bb is there because instaparse's clojure code does not run in bb

Stephan Renatus19:07:49

💡 ah. so the pod uses the “JVM-clojure”, and that’s that. thanks

borkdude19:07:17

no, the instaparse-bb library uses the instaparse pod which is compiled to native binary for fast startup, it does not use a jvm

🙌 2
Stephan Renatus19:07:10

😳 thanks again. that’s cool.

borkdude19:07:31

other examples of "jvm compiled to native pods" can be found here: https://github.com/babashka/pod-registry

Stephan Renatus19:07:20

OK since I’m asking so many questions already — is this correct: BB is using SCI, and it’s using graal’s native-image, isn’t it? so the libs we’re talking about work with graal compiling them to a native binary because graal is JVM compatible where SCI is not (not 100% I mean)?

borkdude19:07:04

SCI only supports executing a subset of Clojure from source.

borkdude19:07:30

Another way is to include instaparse as a built-in library in babashka, this works

borkdude19:07:59

but since I don't want to include the whole ecosystem, since this would result in longer compile times and a bigger bb binary, pods are another way to get the same functionality

Stephan Renatus19:07:07

ah ok. sorry, it’s just all those intricacies I’ve not fully wrapped my head around (yet)

Stephan Renatus19:07:43

and I like pods. 😄 (and this helps me appreciate them even more.)

😃 2
didibus04:07:29

The java interop must be provided to sci so it can use it. bb provides the most common amount of it, but not all of java. Some clojure libs use either directly or transitively some parts of java not included in bb and thus not exposed to its sci interpreter. That does not mean those libs use java code that cannot be native compiled. So they can still be bundled as a pod.

thanks2 2