will Kotlin/Native be able to compile to a shared ...
# kotlin-native
k
will Kotlin/Native be able to compile to a shared library usable by a C/C++ codebase in the future?
o
making .a static library is possible, creating dynamic library from bitocde could be made possible as well, however it is unclear why it is important.
k
a static library would be fine. I’m interesting in the possibility of writing library code in Kotlin that can be used on both JVM and Native with the majority of code residing in a common module. But the native side would likely be referenced by C code, not by other native Kotlin code.
o
See how SDL sample for iOS is being done (https://github.com/JetBrains/kotlin-native/blob/master/samples/tetris/build.sh#L24). It doesn't provide a main() function (-nomain), and resulting executable is being linked with the SDL library, which has an entry point.
t
I have two use-cases in mind that would need dynamic libraries: 1) writing Python extension modules, i.e. writing performance-critical parts of Python applications in Kotlin, via the Python C API; 2) writing in-process COM servers, i.e. ActiveX components, which can be used from .NET and various scripting environments on Windows ... which of course depends on Windows support which I'm also hoping for. 🙂
o
this scenario isn't supported by JB, however you may try to link bitcode produced by
konanc
into .so/.dylib , however it may not work properly for you (for example, beware TLS issues)