iOS Libraries Mobile Native Releases

Kotlin/Native v0.8 released

We’re happy to announce the release of Kotlin/Native v0.8! The focus of this release is on:

  • safer concurrent programming
  • extending the stdlib functionality
  • better iOS development support.

Also, numerous bug-fixes and optimizations were implemented in this release.

AppCode and CLion Kotlin/Native plugins were updated to work with v0.8, along with minor performance and usability improvements.

Binaries can be downloaded from the following links: macOS, Linux, Windows

A Linux Snap package is also available.

GitHub release page is here.

Better concurrency support.

Before v0.8, Kotlin/Native applications were keeping the singleton object state local to a particular thread of execution, so the state of singleton objects on different threads could be non-synchronized. Now, extending the notion of freezing on singleton objects, we allow a shared immutable state.

For example, following code

will read the configuration file and can provide a Config.width property later on.  The Config file will be read once per process execution, and is available to any thread or worker. Once published, the object is frozen, and cannot be modified anymore (modification attempts will throw an InvalidMutabilityException).

Another feature intended for better concurrency support in Kotlin/Native is the atomic values and references. For example, to extend the above sample of a program-wide configuration by adding a potentially updateable program icon, we could do

Note, that operation is atomic, and icon data stored in an AtomicReference itself is frozen. This way we can ensure that the data updates are atomic, and all the other clients see a consistent state.

Library improvements.

With the release 0.8 standard library (kotlin.*) in Kotlin/Native is finally standardized with other platforms using expect/actual mechanism, and mostly (modulo reflection and some synchronization-related operations) matches other Kotlin flavors. Also, the standard random number generator and collection shuffling functions are now available, so there is no need to use platform-specific APIs to obtain random numbers anymore.

Other important JetBrains-provided libraries, like kotlinx.coroutines, kotlinx.serialization, and Ktor HTTP client are getting experimental Kotlin/Native support, which means it is possible to write an iOS app and Android application sharing the same REST API-related logic.

iOS support improvements.

We are working hard on making Kotlin/Native a viable iOS development technology, so in this release, we fixed few annoying problems preventing publishing to AppStore, a framework initialization problem and supported 32-bit ARM iOS, so that older devices can be used with Kotlin/Native as well.

Let’s Kotlin

Comments below can no longer be edited.

15 Responses to Kotlin/Native v0.8 released

  1. Avatar

    Nick Apperley says:

    July 12, 2018

    What is missing from the Kotlin Native libraries is a “Embedded Web Server” library, which can be included in a Kotlin Native server-side app that provides the following:

    Starts up quickly and has a low resource footprint (very important for Serverless and backend software testing)
    Has a low maintenance cost (memory is managed via ARC with cyclic collector and “Kotlinic” APIs are provided)
    Supports HTTP/HTTPS, serving static assets (images, text, JS etc), and Web Sockets
    Concurrency is done via Kotlin Coroutines
    The Web Server can be deployed to amd64 (eg Linux), ARMv7 (eg Raspberry Pi), and ARMv8 platforms

    • Avatar

      Louis CAD says:

      July 12, 2018

      Can’t Ktor do this? It’s getting Kotlin/Native support soon

    • Avatar

      Benny says:

      July 13, 2018


  2. Avatar

    Nikolay Igotti says:

    July 12, 2018

    Well, ktor( has builtin webserver and library team is working on adding Native Support there. Another option would be writing lightweight wrapper on top of microhttpd, like in

    • Avatar

      Benny says:

      July 13, 2018

      As far as i can see Ktor currently is hardly a match for PHP ( ), let alone other implementations.

      The problem with 3th party web servers tends to be that the support is not guaranteed unlike the language itself.

      With Go, you are sure that the build in HTTP server will run perfectly every time.
      When looking at D and its external 3th party web server Vibe.D, that tends to be hit or miss more often.

      • Avatar

        Nikolay Igotti says:

        July 13, 2018

        Those are perf characteristics of of Ktor/JVM, Ktor/Native may behave differently.

      • Avatar

        Nick Apperley says:

        July 14, 2018

        Take another look at the benchmarks. Ktor performs better is some areas (DB access with Single and Multiple queries, Plaintext) than PHP, while there are other areas where PHP is faster (JSON serialization, Fortunes, Data updates).

  3. Avatar

    ALB says:

    July 13, 2018

    Have you released a CLion plugin for Kotlin Native 0.8 for Windows? If not, when do you expect to do so?

    • Avatar

      Vyacheslav Karpukhin says:

      July 18, 2018

      The plugin with support for Windows is expected to be published in the next few weeks.

  4. Avatar

    Will Rubin says:

    July 14, 2018

    Wondering if there’s any SWAG as to when 1.0 will be ready?

  5. Avatar

    Bernd says:

    July 14, 2018

    Are there any plans to support Kotlin/Native (and Kotlin JS) in Eclipse? It would be great to have a fully supported multiplatform project in one IDE.

  6. Avatar

    Juancho says:

    July 15, 2018

    “Ktor HTTP client are getting experimental Kotlin/Native support”

    How can I access this experimental code so I can play with it?

  7. Avatar

    Bart says:

    July 19, 2018

    Are there any docs on how to select compile target with Kotlin/Native? I mainly have Linux/MIPS and Linux/ARM32 but documentation seems rather scarce in general at the moment to say the least.

Discover more