אליהו הדס
11/18/2024, 2:16 PMArtem Olkov
11/20/2024, 1:50 PMwill it only be in one direction?So yes, current solution will only allow the export of Kotlin symbols into swift codebase.
Jeffrey Macko
12/11/2024, 9:24 PMCLOVIS
12/11/2024, 10:07 PMswift-java
runs a JVM alongside Swift, and uses JNI to communicate between each other. This is a very different approach to the Kotlin bridge, where Kotlin is compiled to LLVM bytecode, which is the same as Swift. At runtime, there is no memory boundary, both languages are running using the exact same technology.Artem Olkov
12/13/2024, 9:09 AMJavaKit, which allows using Java from Swift
something similar for KotlinWell, allow me to talk a little bit about the differences The work you are referencing aims to allow programs to talk between JVM and Swift managed environments. If we take a look at sources of JavaKit - we will discover, that as an input for translation they accept compiled
.jar
. So, no, JavaKit does not allow using Java-lang from swift, it allows using Java Archives from swift. That in turn mean, that anything producing valid JAR file would be interoperable(but only one way) with swift through JavaKit. Including, I guess, Kotlin/JVM.
Notice, that not a single test case is written for jar files built with non-Java sources as input, but nevertheless - it should still be possible.
Main idea behind previous paragraph is that work you are referencing aims to befriend Java VM with natively compiled Swift.
The project of Swift-Export does not target Kotlin/JVM. It currently targets Kotlin/Native, as it is the backend used by iOS developers.