Kotlin Native plugin loading mechanism

Is there a way of implementing a plugin mechanism in Kotlin Native? I’m aware that there is no Kotlin Native equivalent of Java’s Class.forName(). I have considered implementing something using C-interop and dlopen()/dlsym(), but that is limited to types with C mappings and I want plugin authors to be able to write multi-platform plugins in Kotlin Common.

Is it possible to dynamically load a Kotlin Native library at runtime, without resorting to C-interop?

dlopen in combination with -fPIC should be working, as you told, you already doing it

platform.posix in kotlin native already have dlfcn.h you don’t have to cinterop it yourself, you can use dlopen to load .so files or similar files using those functions

platform.windows in kotlin native already have windows.h you don’t have to cinterop it yourself, you can use LoadLibrary function to load the .dll files

similarly
platform.android in kotlin native already have dlext.h
platform.posix in kotlin native will work for IOS and OSX also

You can refer all these cinterop here Kotlin Native GitHub