To improve integration and embedding capabilities of Kotlin/Native we have designed and implemented C language bindings for Kotlin/Native code, i.e any Kotlin application could be compiled into a shared object (.so or .dylib), and all Kotlin public APIs are available from such a shared object in handy OOP-style functions. As an example of using this API we have developed Python native extension using Kotlin/Native code, see
https://github.com/JetBrains/kotlin-native/tree/master/samples/python_extension. We transparently map primitive types and strings to respective C types and vice versa. Non-primitive Kotlin classes are mapped to distinct structures, so that they will not be mistaken when passing as method’s argument. As usual, we’re very interested in hearing positive or negative feedback. This feature will be available as part of upcoming 0.5 release of Kotlin/Native.