Open borkdude opened 2 years ago
Hi. I'd vote for sci (and nbb) to be able to support this one day. An example extend-type
that would benefit from supporting native CLJS protocols - https://github.com/logseq/logseq/blob/dddd937b535fe887777d6e330fd75cf503587103/deps/db/src/logseq/db/frontend/entity_plus.cljs#L28-L56
SCI contains some protocols like IDeref that users are able to implement in scripts. However, this comes with some perf overhead. Protocols are currently represented as multi-methods in SCI (this is an implementation detail). It seems in CLJS you're able to add to a protocol at runtime, by manipulating objects.
If SCI, by permission of the SCI users of course, has access to the native protocol, perhaps we can support extending
ILookup
etc in user space without much perf overhead.