Photo by Louis Tsai / Unsplash

Kotlin 1.7.20: Better K2 Compiler

Programming Aug 9, 2022

JetBrains has published a beta of Kotln 1.7.20, a planned upgrade to the programming language that introduces an operator for creating open-ended ranges and includes more work on the high-performing K2 compiler, which is still in development.

A new ..< operator previewed in the beta enables creation of open-ended ranges. While Kotlin already has the .. operator to express a range of values, the ..< operator acts like the until function and helps with defining the open-ended range. Research has shown that the new operator does a better job at expressing open-ended ranges and making it clear that the upper bound is not included.

For the K2 compiler, which is in an alpha state, work continues on stabilization, with support added for plugins including all-open, no-arg, and jvm-abi.gen, as well as Parcelize and AtomicFU. The alpha version of the compiler works only with JVM projects and does not support Kotlin/JS, Kotlin/Native, or other multi-platform projects.

Go Lang 1.19: Refines Generics and Memory Model
Go 1.19, the latest version of Google’s Go (Golang) programming language, has reached production availability. The update improves recently added generics and debuts an enhanced memory model. With Go Language version 1.19, released August 2, generics development focused on addressing subtle issues…

The Kotlin 1.7.20 beta was published July 31. Directions on getting started with Kotlin can be found at kotlinlang.org. Other capabilities in Kotlin 1.7.20:

  • Generic inline classes are introduced as an experimental feature for the JVM. With this capability, the underlying type of JVM classes can be a type parameter.
  • The new Kotlin/Native memory manager is enabled by default, with this release bringing further stability and performance improvements. The memory manager moves to a beta stage and paves the way to promoting Kotlin Multiplatform Mobile, an SDK for iOS and Android development, to beta as well. Previously, the older memory manager made writing concurrent, asynchronous code complicated and prevented adoption of the SDK because of concurrency limitations. The new memory manager overcomes these limitations.
  • Standard library API changes include new types and operations introduced in the kotlin.ranges packages.

The beta of Kotlin 1.7.20 was preceded by the release of Kotlin 1.7.0 in June.

Tags

Traven West

Traven is the lead author for programming and cybersecurity topics. He also dives into application development, web development, and Linux.