JetBrains debuts Kotlin 2.0.0 with K2 compiler performance boost

By Paul Krill

With the newly released Kotlin 2.0.0 language, JetBrains offers the K2 compiler for improved performance and the open source Kotlin dataset for large language (LLM) model creators.

Kotlin 2.0.0 was announced on May 23. With this release, K2 reaches the stable state, having been completely rewritten based on a new architecture. The rewritten compiler boosts performance and daily productivity, JetBrains said. Compilation time is as much as two times faster with Kotlin 2.0.0 versus Kotlin 1.9.20. The new K2 compiler is more consistent with an improved ability to understand code, according to JetBrains.

With the 2.0.0 release, JetBrains also announces an open source Kotlin dataset, which together with the 7B Kotlin Language model helps builders of LLMs and AI-based code generation tools improve the quality of Kotlin code generated. The model and dataset now are available for researchers and others to experiment with and use in their work. Kotlin 2.0.0 also features the ability to monitor GC performance in Kotlin/Native with signposts on Apple platforms. Kotliin/Native compiles Kotlin code in native binaries that can run without a virtual machine. Additionally, Kotlin 2.0.0 introduces a default method for generating lambda functions via invokedynamic. The change reduces the binary size of applications compared to the traditional anonymous class generation.

Kotlin plugins that support Kotlin 2.0.0 are bundled in the latest JetBrains IntelliJ IDEA and Google Android Studio IDEs. Kotlin itself is perhaps best known for its use in Google Android mobile application development. Other features in Kotlin 2.0.0 include:

Along with its Kotlin 2.0.0 unveiling, JetBrains said it had improved the tools experience for Kotlin Multiplatform, for developing cross-platform projects, by offering a single all-in-one tool for Kotlin multiplatform development. A preview of the development environment is available. It understands Apple’s Xcode and supports the Swift language.

© Info World