Replies: 2 comments
-
|
The current state of affairs: "supported" generally means: not supported from source, but when you insert your own definterface an a SCI configuration, it will work, e.g. like this: Since the
If things can be improved, I'm open to it of course. If docs are behind, PRs are welcome to bring things up to date! |
Beta Was this translation helpful? Give feedback.
-
|
Hi, thank you for the response, this answers some of my questions but not others. My intention insofar as passing Similarly for Personally I'm much more interested in a solution to being able to reify on multiple types than Java interfaces in particular, is my intuition correct that this is solvable for non-babashka uses and is not currently solved? What the status on that? Moreover, I don't entirely follow your explanation on the prior work in this direction. I understand ofc why it's too much too load all interfaces and then their permutations in the babashka native image, but I don't understand why we'd need all the permutations when we only really care about ones composed under Moreover moreover, personally I use babashka for tasks and (working on) using it as a little repl session manager over JVM repls, and besides this there's the (probably much more common) use case of developing code in a JVM env and then compiling it down to a native image. In these situations, I have This still ofc wouldn't let us do this stuff on runtime in a native image, but it would let us do this stuff not in native images, as well as in the process of building one, and thereby use "dynamic" SCI to build (even incrementally) better more bespoke "native" SCIs. Edit: To clarify I don't mean to push for a solution specifically or even declare a problem necessarily (past the docs as mentioned which I'd be glad to patch as mentioned), moreso throwing some ideas and questions at you, some of which I imagine there are existing answers for and some which I imagine might not, and therefore proposing naive solutions naively. Mostly I'm just trying to delineate the state of affairs as mentioned. Thank you for your work and patience! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The README mentions that
definterfaceis not supported and thatdeftypehas limited support with no further elaboration. The Babashka book details this a bit further https://book.babashka.org/#differences-with-clojure but is somewhat inconsistent with the README, saying there's "nodeftype" at all. I take it this meansscihas a limiteddeftypewhile Babashka doesn't have one at all?definterface, being a Java-specific thing, makes sense insofar as not being implemented natively insci, but is there any good reason not to be able to pass indefinterfacein SCI-on-JVM? Is this possible already, and thereby we'd be able to run Java-specific Clojure code on SCI-on-JVM by bindingdefinterfaceto the session? If so that's great, and should likely be documented somewhere (I can see why enabling it by default on the JVM would be weird/undesired, although it would simplify the existing code, such as here https://github.com/babashka/sci/blob/master/src/sci/impl/records.cljc#L19 which errors out given an interface only on the JVM, which is the one place we havedefinterfaceanyway).deftypeto my understanding is mostly complicated because it fully relies on JVM constructs for its machinations, and there isn't really any way even inclojure.coreto take a value and get a set of everything itsatisfies?, which explains the one limitation (listed, again, in the Babashka book and not in thescidocs anywhere) is thatreifyonly supports one type? Is this the case forsciin general? Is this the "limited support" described by theREADME? Are there other ways it's "limited?"In a broader sense, is full/better
deftypeand/ordefinterfacesupport planned? I can think of a few ways involvingmeta-in-reifyand/or a macro generating a composition ofdeftypes to potentially address this, but the immediate issue is that the current state of these things is not apparent in the docs anywhere. If I understand it I'd be glad to send a PR for the README.Beta Was this translation helpful? Give feedback.
All reactions