beginners

Anthony Franco 2026-04-02T19:26:48.648539Z

What's the right way to create a library (at all) and then what is the right way to create a library that is compatible for import with both Clojure JVM and Babashka?

borkdude 2026-04-02T19:32:36.205949Z

If you want to ensure it's compatible with babashka, I'd recommend running its tests with babashka

🧠 2
borkdude 2026-04-02T19:33:18.399559Z

You can use reader conditionals #?(:bb 1 :clj 2) or use a macro like:

(def bb? (System/getProperty "babashka.version"))
(defmacro if-bb [then else] (if bb? then else))

🙌 1
borkdude 2026-04-02T19:33:46.844669Z

Creating a Clojure library is as simple as putting a Git(hub) repo up and adding a deps.edn

👀 1
Anthony Franco 2026-04-02T19:37:41.311609Z

Fattest thank you possible @borkdude, all questions sated!

Alex Miller (Clojure team) 2026-04-02T19:41:34.202059Z

should probably also mention that this should be done in a .cljc file extension.

seancorfield 2026-04-02T19:59:53.204689Z

https://clojure-doc.org/articles/ecosystem/libraries_authoring/ might be good reading.

👀 1
seancorfield 2026-04-02T20:00:23.475689Z

(it doesn't tackle the cross-dialect aspect, but it seems you got that answered above)