babashka 2025-07-31

hi! this is not exactly a babashka question but i'm not sure where else to ask. i am getting this error when clojure tries to print another unrelated error:

Exception in thread "main" java.lang.IllegalArgumentException: Multiple methods in multimethod 'simple-dispatch' match dispatch value: class babashka.process.Process -> interface clojure.lang.IPersistentMap and interface clojure.lang.IDeref, and neither is preferred
i think this is because there is a bug in babashka.Process's toString impl? i am not quite sure how to debug it

require the namespace babashka.process.pprint and the problem will go away

in your host

that tells the clojure runtime to give precedence to babashka.pprint, i guess?

yes that fixed it

you can check the source to see what it does :)

😄 1

why is it a separate namespace? why not include it in babashka.process?

I wanted to make babashka.process not force users to load clojure.pprint in their runtime

oh i see, because this could be an SCI guest and now Graal has to include it in the native image?

clojure.pprint can cause quite large graalvm binaries because there's dynamic find-var usage here: https://github.com/clojure/clojure/blob/da1c748123c80fa3e82e24fc8e24a950a3ebccd9/src/clj/clojure/pprint/pprint_base.clj#L148

this is also why I have some patches for clojure.pprint in babashka

👍 1