JetBrains has announced the release of Kotlin 1.9. This release introduces many enhancements, a big one being the beta release of the K2 compiler for the JVM.
The K2 compiler is a new frontend compiler that is planned to be released in Kotlin 2.0 as stable. It is a complete rewrite of the original compiler and offers a faster and more extensible architecture, addresses technical debt from the old compiler, fixes bugs, and lays the foundation for future language extensions.
JetBrains plans to make K2 compatible with other compiler plugins so that it can deliver multiplatform functionality.
“Our target is to achieve full beta-quality support for multiplatform projects in K2 concurrently with the stable release of Kotlin Multiplatform,” Sarah Haggarty, Kotlin technical writer at JetBrains, wrote in a blog post.
In addition, a number of previously introduced features have reached the stable designation in this release. These include the replacement of the enum class values function and the ..< operator for open-ended ranges.
New features have also been introduced, such as a new extension function for creating parent directories and a new function for retrieving the contents of a regex group by name.
Other additions in Kotlin 1.9 include a preview of a custom memory allocator, library linkage, a preview of the Gradle configuration cache in Kotlin Multiplatform, and changes for Android target support in Kotlin Multiplatform.
More information is available in the blog post.