Kotlin 1.7.20 advances K2 compiler - IT SPARK Media

Kotlin 1.7.20 advances K2 compiler

[ad_1]

JetBrains has published the production release of Kotlin 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.

The production version was unveiled on September 29. With Kotlin 1.7.20, a new ..< operator enables the 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 SAM (single abstract method) with receiver 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.

A 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.

Kotlin 1.7.20 was preceded by the release of Kotlin 1.7.0 in June and Kotlin 1.7.10, a bug fix release, in July.

Copyright © 2022 IDG Communications, Inc.

[ad_2]

Source link

Leave a Comment

x