Kotlin/Native v0.8 brings iOS support and library improvements
One step closer to 1.0! Kotlin/Native 0.8 is here and it brings a lot of goodies including better concurrency support, as well as library and iOS support improvements. Let’s have a look at the highlights.
It’s been more than two months since Kotlin/Native v0.7 was released so now it’s time for a new round of improvements.
v0.8 focuses on safer concurrent programming, extending the stdlib functionality and better iOS development support, according to the blog post announcing the new release.
Also, AppCode and CLion Kotlin/Native plugins now work with v0.8.
Let’s have a look at the highlights.
Better concurrency support
As JetBrains’ Nikolay Igotti explained in the blog post, “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.” That’s no longer the case. As of v0.8, extending the notion of freezing on singleton objects, a shared immutable state is allowed.
That’s not all though; another feature that should help improve concurrency support in Kotlin/Native is the atomic values and references. Read more about it here.
More good news! Standard library (kotlin.*) in Kotlin/Native is now “standardized with other platforms using expect/actual mechanism, and mostly (modulo reflection and some synchronization-related operations) matches other Kotlin flavors.” Furthermore, you don’t have to use platform-specific APIs to obtain random numbers anymore now that the standard random number generator and collection shuffling functions are available.
Last but not least, a bunch of other libraries [such as kotlinx.coroutines, kotlinx.serialization, and Ktor HTTP client] are receiving experimental Kotlin/Native support. In short, you can now write an iOS app and Android application sharing the same REST API-related logic.
SEE ALSO: Kotlin 1.2.50 is a sight for sore eyes
iOS support improvements
The team fixed a few problems that prevented publishing to AppStore, a framework initialization problem and supported 32-bit ARM iOS, to allow older devices to be used with Kotlin/Native as well.
Don’t forget to give it a try today and read the blog post announcing Kotlin/Native v0.8 here.