4 ms·
How does it interop with the existing Java libraries?
by ghostwriter 4y ago
How does it interop with the existing Java libraries?
- nerdponx 4y agoI can't speak for the JVM backend specifically, but in general Idris 2 code can call arbitrary functions in the backend with the "%foreign" pragma. So hopefully that would be supported for Java, although I don't know how it would work with classes.
- mmhelloworld 4y agoThis file https://github.com/mmhelloworld/idris-jvm/blob/main/libs/base/System/Concurrency.idr https://github.com/mmhelloworld/idris-jvm/blob/main/libs/bas... demonstrates how the interop looks like currently. The `%foreign` directive takes an FFI descriptor to talk to the respective backends. Here you can see few scheme and JVM descriptors starting with "scheme:" and "jvm:" respectively. The JVM descriptors there show constructor calls `<init>`, instance methods `.lock` and static methods `getThreadData`.