This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I am trying to use ring.middleware.params in Babashka. This was already asked and answered on https://clojurians-log.clojureverse.org/babashka/2023-05-01. But I don't understand even the basics of this. Do I have to download the jar file somewhere or compile it somehow for GraalVM? Can Babashka use jar files, that are made for the JVM? I know, the Babashka Book writes about dependencies and jar files. But what does this mean? Can I really load a jar file, from the JVM into Babashka? Do I not have to install a JVM? Is the Maven available in Babaskha? When searching in Google for GraalVM I find only information about the Native Image Builder. But as far as I understood, the thing that comes out of the native image builder is native and does not use the concept of classpaths. Do I have to run the Native Image Builder myself for libraries that I want to use in Babashka? Or do I have to create my own babashka version? Sorry, many questions... I have the impression, that I miss some small piece of information, which everybody else knows. Where am I wrong?
you can specify deps in bb.edn
just like someone would do for normal Clojure in deps.edn
You will need Java but only one time to load the dependencies from maven and calculate the classpath. Once that is done, you won't need Java.
Indeed that works now. But how is this possible? Are Jar files not byte code? Does bb include an interpreter for JVM byte code? Does GraalVM has this feature? I would have expected, that I have to build my own native shared library.
In case you want to consider ring.middleware.params for future Babashka versions, just for information: It was easy to isolate it from ring-core. The jar file is 12,7k and does not have other dependencies.
I noticed that back in 2020 there was some issue with the uberscript namespaces being in the wrong order & that was fixed, but I'm seeing that symptom with some code I have locally. Are there known issues or limitations to the dependency sorting?
@U053S2W0V btw, if you have a script that is executable (by any name) and there is an adjacent bb.edn
to that script with the dependencies, you can now execute that script from anywhere on your system, without having to use bbin
or an uberscript, whatsoever