With v0.6 we brought Kotlin/Native multiplatform projects support, so same Gradle build could be used for different Kotlin backends, such as JVM, Native and JS. See this repository for usage example.

Also, we finally provide an ability to create Kotlin/Native programs aimed for embedded targets, such as STM32-based microcontrollers (using Zephyr Project kernel). Note that support is still experimental so your mileage may vary, and there are some shortcomings around C interoperability, which will be fixed in upcoming releases.

One interesting feature of v0.6 is support for transparent collections interoperability in -produce framework operational mode. It means, one could transparently use Kotlin’s List, MutableList, Set, MutableSet, Map and MutableMap as Objective-C/Swift collections, such as NSList, NSMutableList, NSSet, NSMutableSet, NSDictionary and NSMutableDictionary respectively, when compiling Kotlin code to the framework.

An important goal of this release was to improve usability and stability of the compiler, so we fixed a number of known bugs and Kotlin/JVM incompatibilities.

And finally, a plugin for CLion 2018.1 with support for Kotlin/Native v0.6 is available. Due to certain technical reasons, it’s not possible to automatically update to the new version this time, so you need to manually install it from here.

18 Responses to Kotlin/Native v0.6 is Here!

Congrats! Any word on when we’ll get debug support for setting breakpoints on Kotlin code in the IDE when using any sort of code-share with iOS? That’s the only thing now stopping my team from diving in (now that multi-platform is supported).

This should already be working when you set breakpoints in Xcode. Just do something like “br set -f KotlinFile.kt -l 42” in LLDB console, or add the kotlin files to the project (don’t include in any targets) and set the breakpoints from UI.

I’ve mistakenly assumed that Xcode would allow to set breakpoints even on unknown files, but apparently it doesn’t. I apologize for the confusion. Looks like the only way to do it from Xcode UI is to step into the Kotlin code from Swift/Objective-C.

It works in AppCode. You can set breakpoints in the Kotlin file and the Swift source and debug away. The only thing that doesn’t seem to work though is the pretty printing using the kotlin_lldb.py util from the variables consoles. This does work in XCode, although rather slowly.

Update: When I tested AppCode previously, I had CLion open with breakpoints set in Kotlin. There was some sort of cross-application settings that must have enabled the breakpoints in the AppCode project for the Kotlin source files which made it appear to work, although after closing CLion and restarting, I was not able to set breakpoints in Kotlin files within AppCode out-of-box.

However I did get it to work. AppCode allows you to set File Type associations so you can set *.kt as a source file in your Settings. For example, I associated Kotlin as Assembly. After this tweak, AppCode allows my to set breakpoints in Kotlin files and have full support for Objective-C and Swift debugging. The disadvantage with this method is you’ll have to disregard the code editor parsing since the Kotlin language is not currently supported in AppCode.

I’m guessing this will be coming soon to AppCode. Glad to see that it is so close fully working! AppCode isn’t XCode, but it is a great tool if you enjoy working with JetBrains product UIs.

Wow, awesome. I came in to software engineering from embedded programming. It is wonderful to see you guys make me able to have fun with embedded programming. I always wanted to spend some time on embedded programming but writing code based on assembly/C/C++ is super time consuming. Hope to see Raspberry Pi support in future versions…

Although kotlin can run on the STM32! That is incredible! ! ! “There are some shortcomings around C interoperability, which will be fixed in upcoming releases.” I need to be stable on kotlin for stm32 before I use it! Can you provide other RTOS support? For example, FreeRTOS, Rt-Thread, etc., you need to provide an RTOS port interface , we will port it!!