v0.5 preparations. (#1135)

This commit is contained in:
Nikolay Igotti
2017-12-15 13:25:25 +03:00
committed by GitHub
parent e2040f9b5d
commit 5ad0643154
8 changed files with 45 additions and 19 deletions
+13 -4
View File
@@ -4,9 +4,18 @@ A: Define top level function `fun main(args: Array<String>)`, please ensure it's
in a package. Also compiler switch `-entry` could be use to make any function taking
`Array<String>` and returning `Unit` be an entry point.
Q: What is Kotlin/Native memory management model?
A: Kotlin/Native provides automated memory management scheme, similar to what Java or Swift provides.
Current implementation includes automated reference counter with cycle collector to collect cyclical
garbage.
Q: How do I create shared library?
A: It is not possible at the moment. Currently Kotlin/Native could be used to produce either
_Kotlin/Native_ own library format, which can be statically linked with application
or an executable for target. For example, for Android targets compiler produces shared libraries
by default (as required for _Native Activity_).
A: Use `-produce dynamic` compiler switch, or `konanArtifacts { dynamic {} }` in Gradle.
It will produce platform-specific shared object (.so on Linux, .dylib on macOS and .dll on Windows targets) and
C language header, allowing to use all public APIs available in your Kotlin/Native program from C code.
See `samples/python_extension` as an example of using such shared object to provide a bridge between Python and
Kotlin/Native.