This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-06
Channels
- # babashka (31)
- # beginners (108)
- # calva (6)
- # clj-kondo (62)
- # cljsrn (5)
- # clojure (29)
- # clojure-australia (2)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-uk (7)
- # clojurescript (25)
- # code-reviews (1)
- # datomic (13)
- # deps-new (7)
- # editors (1)
- # emacs (31)
- # figwheel-main (3)
- # garden (4)
- # graalvm (18)
- # helix (10)
- # improve-getting-started (12)
- # jobs (3)
- # lsp (20)
- # malli (12)
- # off-topic (7)
- # polylith (30)
- # re-frame (10)
- # remote-jobs (2)
- # shadow-cljs (18)
- # spacemacs (5)
- # sql (11)
- # tools-deps (10)
- # vim (9)
- # xtdb (1)
a small public service announcement, we're making lambdaisland.uri bb-compatible https://github.com/lambdaisland/uri/pull/22
We looked at this before, at that point it didn't seem like we could make it work because of the interface implementations (IFn and Object), but turns out if we leave those out it's still a pretty useful library
> On babashka implementing interfaces is not supported More specifically: this is supported for only one interface at a time + an optional amount of protocols
@U04V15CAJ I tried doing just the Object (toString [])
implementation, leaving out the IFn
but that didn't work. If that could be made to work that would be fantastic.
ah hmm, I see interfaces aren't supported on records, but only a single one in reify
or alternatively if sci could provide an alternative way to override str
for custom types
@U04V15CAJ is there a guide on how to check if a library is bb-compatible and what are the steps needed to make it compatible if it isn't?
Most of it has to do with the limitation that you cannot create new Java types at runtime in a native image
Gotcha. I'm trying to check if https://github.com/cgrand/xforms is compatible
Looks like it isn't atm 😞
; export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {net.cgrand/xforms {:mvn/version "0.19.2"}}}' -Spath)"
bb -e "
(require '[net.cgrand.xforms :as x])
(x/into [] cat [[1][2]])
"
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Unable to resolve classname: java.util.Comparator
Phase: analysis
# ~ 1 ↵
The next one is:
128: (satisfies? #?(:clj clojure.core.protocols/IKVReduce :cljs IKVReduce) coll))
^--- Could not resolve symbol: clojure.core.protocols/IKVReduce
What are you trying to use it for, for the library itself or is there another lib which depends on it?
I use it heavily in clojure (❤️ xducers) and I'd miss it from my utility belt. It hasn't been updated in a while and has a few https://github.com/cgrand/xforms/pulls, fixing reflection warnings among others so I have been thinking about merging those in my own fork. And when one of my colleagues asked whether it's available in bb I decided to check whether I could patch it so it's compatible. But it sounds like bb itself (or sci?) will need some additions for that, right?
cool. there may be some other dragons, I don't expect this to work soon, but long term it'd be interesting to see what can be done
(after seeing this: https://github.com/cgrand/xforms/blob/62375212a8604daad631c9024e9dbe1db4ec276b/src/net/cgrand/xforms.cljc#L101, this is currently not possible in SCI, reify with multiple classes)
Christophe writes some pretty advanced Clojure... might be worth considering making a spin-off library which implements the functions you use most in a bb-compatible way