Skip to content

Commit 6e71902

Browse files
author
alfredo-toledano
committed
doc(docs.topics.native.platformLibs): add notes
1 parent 6c253fd commit 6e71902

File tree

1 file changed

+28
-32
lines changed

1 file changed

+28
-32
lines changed
Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
11
[//]: # (title: Platform libraries)
22

3-
To provide access to user's native operating system services,
4-
Kotlin/Native distribution includes a set of prebuilt libraries specific to
5-
each target. We call them **Platform Libraries**.
3+
* Kotlin/Native
4+
* **Platform Libraries**
5+
* == prebuilt libraries
6+
* specific / EACH target
7+
* -- provide access to -- user's native OS services
68

79
### POSIX bindings
810

9-
For all Unix- or Windows-based targets (including Android and
10-
iOS targets) we provide the POSIX platform lib. It contains bindings
11-
to platform's implementation of the [POSIX standard](https://en.wikipedia.org/wiki/POSIX).
11+
* POSIX platform lib
12+
* uses
13+
* 👀| ALL Unix- or Windows-based targets (ALSO included Android & iOS)👀
14+
* ❌NOT available | [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly)
15+
* == bindings -- to -- platform's implementation of the [POSIX standard](https://en.wikipedia.org/wiki/POSIX)
16+
* how to use it?
1217

13-
To use the library, just import it:
18+
```kotlin
19+
import platform.posix.*
20+
```
1421

15-
```kotlin
16-
import platform.posix.*
17-
```
18-
19-
The only target for which it is not available is [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly).
20-
21-
Note that the content of `platform.posix` is NOT identical on
22-
different platforms, in the same way as different POSIX implementations
23-
are a little different.
22+
* `platform.posix`'s content != / platforms
23+
* Reason: 🧠== differences / POSIX implementations 🧠
2424
2525
### Popular native libraries
2626
27-
There are many more platform libraries available for host and
28-
cross-compilation targets. Kotlin/Native distribution provides access to
29-
OpenGL, zlib and other popular native libraries on
30-
applicable platforms.
31-
32-
On Apple platforms, `objc` library is provided for interoperability with [Objective-C](https://en.wikipedia.org/wiki/Objective-C).
33-
34-
Inspect the contents of `dist/klib/platform/$target` of the distribution for the details.
27+
* Kotlin/Native
28+
* provides access to
29+
* OpenGL,
30+
* zlib
31+
* others
32+
* _Example:_ | Apple platforms, `objc` library -- is provided for -- interoperability with [Objective-C](https://en.wikipedia.org/wiki/Objective-C)
33+
* see the contents of `dist/klib/platform/$target`
3534
3635
## Availability by default
3736
38-
The packages from platform libraries are available by default. No
39-
special link flags need to be specified to use them. Kotlin/Native
40-
compiler automatically detects which of the platform libraries have
41-
been accessed and automatically links the needed libraries.
37+
* platform libraries' packages are available by default
38+
* == NO need special link flags to use them
39+
* Reason: 🧠 Kotlin/Native compiler -- automatically detects the -- platform libraries / have been accessed -> links the libraries
4240

43-
On the other hand, the platform libs in the distribution are merely
44-
just wrappers and bindings to the native libraries. That means the
45-
native libraries themselves (`.so`, `.a`, `.dylib`, `.dll` etc)
46-
should be installed on the machine.
41+
* platform libs | distribution == wrappers & bindings to the native libraries
42+
* == native libraries themselves (`.so`, `.a`, `.dylib`, `.dll` etc) -- should be -- installed | machine

0 commit comments

Comments
 (0)