Skip to content

Commit 163b13f

Browse files
feat: new page describing compatibility issues with native interoperability (#4866)
1 parent 78fe2de commit 163b13f

11 files changed

+242
-40
lines changed

docs/kr.tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
<toc-element toc-title="Native">
182182
<toc-element accepts-web-file-names="basic-kotlin-native-app.html,kotlin-native-with-clion.html,targeting-multiple-platforms.html,native-gradle.html,native-command-line-compiler.html" topic="native-get-started.md"/>
183183
<toc-element topic="native-definition-file.md"/>
184+
<toc-element toc-title="C and Objective-C library import" topic="native-c-interop-stability.md"/>
184185
<toc-element toc-title="C interop">
185186
<toc-element topic="native-c-interop.md"/>
186187
<toc-element topic="mapping-primitive-data-types-from-c.md"/>

docs/topics/components-stability.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
The Kotlin language and toolset are divided into many components such as the compilers for the JVM, JS and Native targets,
44
the Standard Library, various accompanying tools and so on.
5-
Many of these components were officially released as **Stable**, which means that they were evolved
5+
Many of these components were officially released as **Stable**, which means that they were evolved
66
in a backward-compatible way following the [principles of _Comfortable Updates_ and _Keeping the Language Modern_](kotlin-evolution-principles.md).
77

8-
Following the _Feedback Loop_ principle, we release many things early for the community to try out,
8+
Following the _Feedback Loop_ principle, we release many things early for the community to try out,
99
so a number of components are not yet released as **Stable**.
10-
Some of them are at a very early stage, some are more mature.
10+
Some of them are at a very early stage, some are more mature.
1111
We mark them as **Experimental**, **Alpha** or **Beta** depending on how quickly each component evolves
1212
and the level of risk users take on when adopting it.
1313

@@ -16,22 +16,22 @@ and the level of risk users take on when adopting it.
1616
Here's a quick guide to these stability levels and their meaning:
1717

1818
**Experimental** means "try it only in toy projects":
19-
* We are just trying out an idea and want some users to play with it and give feedback. If it doesn't work out, we may drop it any minute.
19+
* We are just trying out an idea and want some users to play with it and give feedback. If it doesn't work out, we may drop it any minute.
2020

21-
**Alpha** means "use at your own risk, expect migration issues":
22-
* We intend to productize this idea, but it hasn't reached its final shape yet.
21+
**Alpha** means "use at your own risk, expect migration issues":
22+
* We intend to productize this idea, but it hasn't reached its final shape yet.
2323

24-
**Beta** means "you can use it, we'll do our best to minimize migration issues for you":
25-
* It's almost done, user feedback is especially important now.
26-
* Still, it's not 100% finished, so changes are possible (including ones based on your own feedback).
27-
* Watch for deprecation warnings in advance for the best update experience.
24+
**Beta** means "you can use it, we'll do our best to minimize migration issues for you":
25+
* It's almost done, user feedback is especially important now.
26+
* Still, it's not 100% finished, so changes are possible (including ones based on your own feedback).
27+
* Watch for deprecation warnings in advance for the best update experience.
2828

2929
We collectively refer to _Experimental_, _Alpha_ and _Beta_ as **pre-stable** levels.
3030

3131
<a name="stable"/>
3232

3333
**Stable** means "use it even in most conservative scenarios":
34-
* It's done. We will be evolving it according to our strict [backward compatibility rules](https://kotlinfoundation.org/language-committee-guidelines/).
34+
* It's done. We will be evolving it according to our strict [backward compatibility rules](https://kotlinfoundation.org/language-committee-guidelines/).
3535

3636
Please note that stability levels do not say anything about how soon a component will be released as Stable. Similarly, they do not indicate how much a component will be changed before release. They only say how fast a component is changing and how much risk of update issues users are running.
3737

@@ -61,13 +61,13 @@ A stable component may have an experimental subcomponent, for example:
6161
* a stable command-line tool may have experimental options.
6262

6363
We make sure to document precisely which subcomponents are not **Stable**.
64-
We also do our best to warn users where possible and ask to opt them in explicitly
64+
We also do our best to warn users where possible and ask to opt them in explicitly
6565
to avoid the accidental use of features that have not been released as stable.
6666

6767
## Current stability of Kotlin components
6868

6969
> By default, all new components have Experimental status.
70-
>
70+
>
7171
{style="note"}
7272

7373
### Kotlin compiler
@@ -103,7 +103,7 @@ to avoid the accidental use of features that have not been released as stable.
103103
| kotlinx-datetime | Alpha | 0.2.0 | |
104104
| kotlinx-io | Alpha | 0.2.0 | |
105105

106-
### Kotlin Multiplatform
106+
### Kotlin Multiplatform
107107

108108
| **Component** | **Status** | **Status since version** | **Comments** |
109109
|------------------------------------------------|------------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
@@ -112,15 +112,15 @@ to avoid the accidental use of features that have not been released as stable.
112112

113113
### Kotlin/Native
114114

115-
| **Component** | **Status** | **Status since version** | **Comments** |
116-
|----------------------------------------------|------------|--------------------------|-----------------------------------------|
117-
| Kotlin/Native Runtime | Stable | 1.9.20 | |
118-
| Kotlin/Native interop with C and Objective-C | Beta | 1.3.0 | |
119-
| klib binaries | Stable | 1.9.20 | Not including cinterop klibs, see below |
120-
| cinterop klib binaries | Beta | 1.3.0 | |
121-
| CocoaPods integration | Stable | 1.9.20 | |
115+
| **Component** | **Status** | **Status since version** | **Comments** |
116+
|----------------------------------------------|------------|--------------------------|--------------------------------------------------------------------------------|
117+
| Kotlin/Native Runtime | Stable | 1.9.20 | |
118+
| Kotlin/Native interop with C and Objective-C | Beta | 1.3.0 | [Stability of C and Objective-C library import](native-c-interop-stability.md) |
119+
| klib binaries | Stable | 1.9.20 | Not including cinterop klibs, see below |
120+
| cinterop klib binaries | Beta | 1.3.0 | [Stability of C and Objective-C library import](native-c-interop-stability.md) |
121+
| CocoaPods integration | Stable | 1.9.20 | |
122122

123-
> For details about Kotlin/Native targets support, see [](native-target-support.md).
123+
For more information about the level of support for different targets, see [](native-target-support.md).
124124

125125
### Language tools
126126

docs/topics/native/apple-framework.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[//]: # (title: Kotlin/Native as an Apple framework – tutorial)
22

3-
> The Objective-C libraries import is [Experimental](components-stability.md#stability-levels-explained).
3+
> The Objective-C libraries import is in [Beta](native-c-interop-stability.md).
44
> All Kotlin declarations generated by the cinterop tool from Objective-C libraries
55
> should have the `@ExperimentalForeignApi` annotation.
66
>
77
> Native platform libraries shipped with Kotlin/Native (like Foundation, UIKit, and POSIX)
88
> require opt-in only for some APIs.
99
>
10-
{style="warning"}
10+
{style="note"}
1111

1212
Kotlin/Native provides bidirectional interoperability with Swift/Objective-C. You can both use Objective-C frameworks
1313
and libraries in Kotlin code, and Kotlin modules in Swift/Objective-C code.

docs/topics/native/mapping-function-pointers-from-c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</p>
1010
</tldr>
1111

12-
> The C libraries import is [Experimental](components-stability.md#stability-levels-explained). All Kotlin declarations
12+
> The C libraries import is in [Beta](native-c-interop-stability.md). All Kotlin declarations
1313
> generated by the cinterop tool from C libraries should have the `@ExperimentalForeignApi` annotation.
1414
>
1515
> Native platform libraries shipped with Kotlin/Native (like Foundation, UIKit, and POSIX)
1616
> require opt-in only for some APIs.
1717
>
18-
{style="warning"}
18+
{style="note"}
1919

2020
Let's explore which C function pointers are visible from Kotlin and examine advanced C interop-related use cases of
2121
Kotlin/Native and [multiplatform](gradle-configure-project.md#targeting-multiple-platforms) Gradle builds.

docs/topics/native/mapping-primitive-data-types-from-c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</p>
1010
</tldr>
1111

12-
> The C libraries import is [Experimental](components-stability.md#stability-levels-explained). All Kotlin declarations
12+
> The C libraries import is in [Beta](native-c-interop-stability.md). All Kotlin declarations
1313
> generated by the cinterop tool from C libraries should have the `@ExperimentalForeignApi` annotation.
1414
>
1515
> Native platform libraries shipped with Kotlin/Native (like Foundation, UIKit, and POSIX)
1616
> require opt-in only for some APIs.
1717
>
18-
{style="warning"}
18+
{style="note"}
1919

2020
Let's explore which C data types are visible in Kotlin/Native and vice versa and examine advanced
2121
C interop-related use cases of Kotlin/Native and [multiplatform](gradle-configure-project.md#targeting-multiple-platforms)

docs/topics/native/mapping-strings-from-c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</p>
1010
</tldr>
1111

12-
> The C libraries import is [Experimental](components-stability.md#stability-levels-explained). All Kotlin declarations
12+
> The C libraries import is in [Beta](native-c-interop-stability.md). All Kotlin declarations
1313
> generated by the cinterop tool from C libraries should have the `@ExperimentalForeignApi` annotation.
1414
>
1515
> Native platform libraries shipped with Kotlin/Native (like Foundation, UIKit, and POSIX)
1616
> require opt-in only for some APIs.
1717
>
18-
{style="warning"}
18+
{style="note"}
1919

2020
In the final part of the series, let's see how to deal with C strings in Kotlin/Native.
2121

docs/topics/native/mapping-struct-union-types-from-c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</p>
1010
</tldr>
1111

12-
> The C libraries import is [Experimental](components-stability.md#stability-levels-explained). All Kotlin declarations
12+
> The C libraries import is in [Beta](native-c-interop-stability.md). All Kotlin declarations
1313
> generated by the cinterop tool from C libraries should have the `@ExperimentalForeignApi` annotation.
1414
>
1515
> Native platform libraries shipped with Kotlin/Native (like Foundation, UIKit, and POSIX)
1616
> require opt-in only for some APIs.
1717
>
18-
{style="warning"}
18+
{style="note"}
1919

2020
Let's explore which C struct and union declarations are visible from Kotlin and examine advanced C
2121
interop-related use cases of Kotlin/Native and [multiplatform](gradle-configure-project.md#targeting-multiple-platforms)

docs/topics/native/native-app-with-c-and-libcurl.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
[//]: # (title: Create an app using C interop and libcurl – tutorial)
22

3+
> The C libraries import is in [Beta](native-c-interop-stability.md). All Kotlin declarations
4+
> generated by the cinterop tool from C libraries should have the `@ExperimentalForeignApi` annotation.
5+
>
6+
> Native platform libraries shipped with Kotlin/Native (like Foundation, UIKit, and POSIX)
7+
> require opt-in only for some APIs.
8+
>
9+
{style="note"}
10+
311
This tutorial demonstrates how to use IntelliJ IDEA to create a command-line application. You'll learn how to create
412
a simple HTTP client that can run natively on specified platforms using Kotlin/Native and the libcurl library.
513

0 commit comments

Comments
 (0)