nbb

2022-12-20T03:07:11.990999Z

I’m trying to use clojure.core.match in nbb - is that possible? It looks like @borkdude added it to Babashka at some point but not sure if that means it gets into SCI or just impl’d at the Babashka level. I added it to my deps.edn and see that it’s downloaded but I get `Message: Could not find namespace: clojure.core.match Could not find namespace: clojure.core.match` when I try to require it

borkdude 2022-12-20T10:27:35.547859Z

The clojure.core.match namespace for CLJS is exposed as cljs.core.match but this dependency relies on macros being loaded in a JVM (`.clj` extentensions) so you can't run it from source in nbb right now

borkdude 2022-12-20T14:51:20.607319Z

Published a new version of nbb with upgraded SCI which has interop improvements. Here we're comparing clojure.math/sin called in SCI 1M times vs the interop version:

user=> (require '[clojure.math :as math])
nil
user=> (time (dotimes [i 1000000] (math/sin 1)))
"Elapsed time: 155.598000 msecs"
nil
user=> (time (dotimes [i 1000000] (Math/sin 1)))
"Elapsed time: 148.164333 msecs"
nil
Previous version:
user=>  (time (dotimes [i 1000000] (Math/sin 1)))
"Elapsed time: 592.297750 msecs"
nil
user=>  (time (dotimes [i 1000000] (math/sin 1)))
"Elapsed time: 150.626542 msecs"
nil

3
🚀 3
🎉 3