GithubHelp home page GithubHelp logo

langzhenjun / kotlin-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetbrains/kotlin-native

0.0 2.0 0.0 28.09 MB

Kotlin/Native infrastructure

License: Apache License 2.0

C 2.98% Kotlin 79.06% Java 0.02% Protocol Buffer 0.26% Makefile 0.03% Objective-C 0.03% Groovy 0.97% Shell 0.13% Batchfile 0.14% C++ 16.03% Pascal 0.04% Python 0.04% HTML 0.01% JavaScript 0.17% Objective-C++ 0.09%

kotlin-native's Introduction

official project

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 compile from sources use following steps.

First download dependencies:

./gradlew dependencies:update

Then build the compiler and standard library:

./gradlew dist

To build standard library for cross-targets use:

./gradlew cross_dist

After that you should be able to compile your programs like that:

export PATH=./dist/bin:$PATH
kotlinc hello.kt -o hello

For an optimized compilation use -opt:

kotlinc hello.kt -o hello -opt

For some tests, use:

./gradlew backend.native:tests:run

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

cinterop -def lib.def

See provided samples and INTEROP.md for more details.

Interop tool generates library in .klib library format, see LIBRARIES.md for more details on the file format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.