Fork me on GitHub

Hello @borkdude , I've been using Babashka for scripting at home and loving it. Recently I decided to convert two scripts at work into BB (a Python script and a lein plugin) and ran into an incompatible libraries problem: 1. the python script stores data in Redis. I used carmine in my Clojure code, which is incompatible with bb 2. the lein plugin uses library, which is incompatible with bb. My question is: Where I can find resources on "making a library compatible with bb" ? I'd love to know how to debug further in such situations and how to possibly add bb support for incompatible libraries.


@h0bbit A tools.namespace fork that is compatible with bb is maintained here: which only uses clojure built-ins and does not rely on tools.reader. As for Redis, I'm not sure what is necessary to make that work with bb. In general bb cannot load custom Java classes, they have to be explicitly added, but as long as a library uses standard JDK classes and pure Clojure, it should mostly work (or you can ask me when something is missing). To work around the "foreign class" constraint, one can also consider making a babashka pod. See for available pods (sql, etc.). One common limitation is deftype since that is often relying on combining multiple Java interfaces which bb cannot do since you cannot create new Java classes at runtime in a graalvm native image. bb does support defrecord.


Great! Thanks, I'll check out babashka/tools.namespace. Thank you for the immediate response.


@h0bbit There is also #nbb for SCI on Node.js which may also allow you to do some Redis stuff


This was the script I wanted to write @borkdude : bb-components in :) It finds all the 'components' that are affected by a set of code changes. A 'component' is a namespace with a -main function in it. It's a handy way to make sure everything is tested in a monolithic code-base. babashka/tools.namespace worked wonderfully.


So here's the fork of clojure.spec with minimal changes for babashka: If you are interested, please try it out with babashka from master (see #babashka-circleci-builds) .

👏 2