*3eed0609b2- (tag: build-1.4.0-dev-3251) Brought back mppKlibs guard lost in rebase (vor 4 Stunden) <Alexander Gorshenev> *36ebbc49f4- KotlinExpressionMover: trailing comma support (vor 5 Stunden) <Dmitry Gridin> *72c8b38864- KotlinExpressionMover: convert to Kotlin (vor 5 Stunden) <Dmitry Gridin> *bca9242492- KotlinExpressionMover: rename .java to .kt (vor 5 Stunden) <Dmitry Gridin> *56064f2a92- JoinLines: add tests (vor 5 Stunden) <Dmitry Gridin> *feaa53c4f2- Formatter: shouldn't format property chains (vor 5 Stunden) <Dmitry Gridin> *522eeae062- (tag: build-1.4.0-dev-3240) FIR2IR: standardize expression with smart cast conversion (vor 6 Stunden) <Mikhail Glukhikh> *d1fac6dce1- FIR2IR: declare receivers for all accessors of extension properties (vor 6 Stunden) <Mikhail Glukhikh> *8c155578f7- FIR2IR: generate both dispatch & extension receiver without 'else if' (vor 6 Stunden) <Mikhail Glukhikh> *4f6fe1d0ca- [FIR]: fix translation of top-level property accesses like array.indices (vor 6 Stunden) <Juan Chen> *c9658eb6e4- (tag: build-1.4.0-dev-3237) Adjust tests due to keep imports for extension functions used in kdoc (vor 6 Stunden) <Vladimir Dolzhenko> *afd71d3d19- Adjust tests due to "Remove argument" quick fix for TOO_MANY_ARGUMENTS (vor 6 Stunden) <Vladimir Dolzhenko> *b047d78580- (tag: build-1.4.0-dev-3236) Minor: update testData for IR bytecode text and unmute test (vor 7 Stunden) <Dmitry Petrov> *0b9fc1541d- (tag: build-1.4.0-dev-3235, tag: build-1.4.0-dev-3233) [NI] Don't try inferring variables for effectively empty system (vor 7 Stunden) <Mikhail Zarechenskiy> *fe71d5256c- (tag: build-1.4.0-dev-3231, tag: build-1.4.0-dev-3222) [Minor] Refactor IR Suspend Main code to not use intrinsic (vor 20 Stunden) <Kristoffer Andersen> *a3d85e108f- (tag: build-1.4.0-dev-3218) JVM_IR: keep `suspend fun` return type in IrCalls (vor 23 Stunden) <pyos> *d982203d56- (tag: build-1.4.0-dev-3209) [JVM_IR] Handle big arity suspend functions in existing lowering. (vor 27 Stunden) <Mads Ager> *e406669190- (tag: build-1.4.0-dev-3206) Invert if condition intention: don't add unnecessary 'continue' (vor 29 Stunden) <Toshiaki Kameyama>
Kotlin/Native
Kotlin/Native is an LLVM backend for the Kotlin compiler, runtime implementation, and native code generation facility using the LLVM toolchain.
Kotlin/Native is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible (such as iOS or embedded targets), or where a developer is willing to produce a reasonably-sized self-contained program without the need to ship an additional execution runtime.
Prerequisites:
- install JDK for your platform, instead of JRE. The build requires
tools.jar, which is not included in JRE; - on macOS install Xcode 11
- on Fedora 26+
yum install ncurses-compat-libsmay be needed - on recent Ubuntu
apt install libncurses5is needed
To compile from sources use following steps:
First, download dependencies:
./gradlew dependencies:update
Then, build the compiler and libraries:
./gradlew bundle
To build with experimental targets support compile with -Porg.jetbrains.kotlin.native.experimentalTargets.
The build can take about an hour on a Macbook Pro. To run a shorter build with only the host compiler and libraries, run:
./gradlew dist distPlatformLibs
To include Kotlin compiler in composite build and build
against it, use the kotlinProjectPath project property:
./gradlew dist -PkotlinProjectPath=path/to/kotlin/project
It's possible to include in a composite build both Kotlin compiler and Kotlin/Native Shared simultaneously.
After that, you should be able to compile your programs like this:
export PATH=./dist/bin:$PATH
kotlinc hello.kt -o hello
For an optimized compilation, use -opt:
kotlinc hello.kt -o hello -opt
For tests, use:
./gradlew backend.native:tests:run
To generate interoperability stubs, create a library definition file
(refer to samples/tetris/.../sdl.def), and run the cinterop tool like this:
cinterop -def lib.def
See the provided samples and INTEROP.md for more details.
The Interop tool generates a library in the .klib library format. See LIBRARIES.md
for more details on this file format.