https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
l

Lei Lei

08/10/2022, 11:46 PM
Does anyone know where I can find the source code or documentation about platform libraries, e.g. platform.Foundation.*? I downloaded Kotlin toolchain on Mac, and it seems klib/platform/$target folder contains lots of platform libraries, however I only found
cstubs.bc
file insider, can not find any kotlin bindings, does anyone know how to get kotlin bindings for those platform libraries?
m

mbonnin

08/10/2022, 11:48 PM
l

Lei Lei

08/10/2022, 11:50 PM
Thanks for the quick response!
I am more interested in the corresponding Kotlin bindings, can I use
cinterop
tool to generate Kotlin bindings?
e

ephemient

08/11/2022, 12:09 AM
bindings to Foundation are pre-defined, https://github.com/JetBrains/kotlin/blob/master/kotlin-native/platformLibs/src/platform/osx/Foundation.def as are other standard libraries
d

darkmoon_uk

08/11/2022, 11:49 AM
At the risk of going around in circles... Isn't it the bindings that you found in the target folder?
I wouldn't expect the bindings themselves to be explicitly documented. Take the Kotlin ObjC interop documentation in context with the original iOS API documentation.
l

Lei Lei

08/12/2022, 5:59 AM
I tried to run `cinterop`with Foundation.def, it only generates
cstubs.bc
file, same as the one in Kotlin toolchain. I would like to add IDE support for platform libraries, e.g. code completion, syntax error detection, how can I do that without Kotlin bindings?