Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.91 KB

DISTRO_README.md

File metadata and controls

45 lines (31 loc) · 1.91 KB

Kotlin/Native

Kotlin/Native is a LLVM backend for the Kotlin compiler, runtime implementation and native code generation facility using LLVM toolchain.

Kotlin/Native is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible (such as iOS, embedded targets), or where developer is willing to produce reasonably-sized self-contained program without need to ship an additional execution runtime.

To get started with Kotlin/Native take a look at the attached samples.

  • csvparser - simple CSV file parser and analyzer
  • gitchurn - program interoperating with libgit2 for GIT repository analysis
  • libcurl - using of FTP/HTTP/HTTPS client library libcurl
  • nonBlockingEchoServer - multi-client TCP/IP echo server using co-routines
  • opengl - OpenGL/GLUT teapot example
  • socket - TCP/IP echo server
  • tensorflow - simple client for TensorFlow Machine Intelligence library
  • tetris - Tetris game implementation (using SDL2 for rendering)
  • win32 - trivial Win32 application
  • androidNativeActivity - Android Native Activity rendering 3D graphics using GLES2

See README.md in each sample directory for more information and build instructions.

Kotlin/Native could be used either as standalone compiler toolchain or as Gradle plugin. See GRADLE_PLUGIN.md for more details on how to use this plugin.

Compile your programs like that:

export PATH=kotlin-native-<platform>-<version>/bin:$PATH
kotlinc hello.kt -o hello

For an optimized compilation use -opt:

kotlinc hello.kt -o hello -opt

To generate interoperability stubs create library definition file (take a look on samples/tetris/tetris.sdl) and run cinterop tool like this:

cinterop -def lib.def

See INTEROP.md for more information on how to use C libraries from Kotlin/Native.

See RELEASE_NOTES.md for information on supported platforms and current limitations.