forked from JetBrains/kotlin-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nikolay Igotti
committed
Apr 3, 2017
1 parent
a553768
commit ac37d95
Showing
6 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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` | ||
* `opengl` - OpenGL/GLUT teapot example | ||
* `socket` - TCP/IP echo server | ||
* `tetris` - Tetris game implementation (using SDL2 for rendering) | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
Q: How do I run my program? | ||
|
||
A: Define top level function `fun main(args: Array<String>)`, please ensure it's not | ||
in a package. | ||
in a package. | ||
|
||
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 | ||
or an executable for target. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters