JetBrains has simply launched Kotlin 2.0, which it says is a serious replace to the programming language. It was introduced at KotlinConf 2024, occurring Might 22-24, which is an occasion filled with talks about utilizing Kotlin.
“In the present day we’re excited to launch Kotlin 2.0 with a secure K2 compiler, which is multiplatform from the bottom up, understands your code higher, and compiles it twice as quick,” Egor Tolstoy, undertaking lead for Kotlin at JetBrains, wrote in a weblog publish.
One of many major highlights of this launch is that it features a secure model of the K2 compiler, which is a whole rewrite of Kotlin’s authentic compiler that unifies all platforms supported by Kotlin, and gives a sooner and extra extensible structure, addresses technical debt from the outdated compiler, fixes bugs, and lays the inspiration for future language extensions.
In keeping with JetBrains, round 15,000 builders have already used K2, and Meta has already migrated massive parts of its codebase to it.
“The on a regular basis ardour of the Kotlin group continuously motivates us to enhance the language, and at the moment, we’re proud to take an enormous step ahead for the entire Kotlin ecosystem and launch Kotlin 2.0. The brand new compiler structure was constructed to allow us to evolve the language a lot simpler, we will introduce new options sooner and in a constant and platform-agnostic method,” stated Tolstoy.
In keeping with JetBrains, the K2 compiler is essential for multiplatform Kotlin, and to that finish, Kotlin 2.0 additionally introduces a number of new options and enhancements for Kotlin Multiplatform (KMP).
Kotlin now gives first-party help for Compose Multiplatform, and the Jetpack Compose compiler (which powers Compose Multiplatform) now ships with Kotlin as of this launch.
This launch additionally introduces an improved tooling expertise for Kotlin Multiplatform. It now absolutely understands Xcode initiatives and gives full help for Swift.
Google has additionally began recommending builders change to KMP and it gives KMP help in a number of in style Android libraries, and has migrated a few of its personal apps to it as properly, corresponding to Google Docs.
Waiting for the longer term, upcoming plans for Kotlin that the staff is now engaged on embody information recognition and deconstruction, growing abstraction, high-performance clear code, and bettering the library writer expertise.
“Kotlin 2.0 considerably boosts your each day productiveness. It brings a sooner, smarter, and extra sturdy compiler, in addition to even higher help for Kotlin Multiplatform initiatives. As a Kotlin developer, you get greater than only a fashionable, concise, and protected language. You even have entry to a flexible ecosystem with highly effective frameworks corresponding to Ktor and Compose Multiplatform, and mixed with JetBrains IDEs, Kotlin 2.0 gives an distinctive developer expertise, empowering you to construct modern, performant, and dependable functions for all platforms,” Tolstoy wrote.
Kotlin 2.0 is now accessible within the newest model of IntelliJ IDEA and Android Studio. A full record of latest options will be discovered within the language’s launch notes.