News

K2 Compiler, Kotlin/Wasm, and Tooling Announcements at the 2021 Kotlin Event

The Kotlin 2021 Premier Online Event has come to an end! It began with a keynote presentation that covered a variety of major announcements, and it continued with a series of talks, each dedicated to an individual piece of news: the new K2 compiler, tooling, backend development frameworks, cross-platform solutions, and more.

All of the recordings are now available on our YouTube channel. Let’s take a quick look at all the exciting topics presented:

If you would like to receive more information like this on a regular basis, you can subscribe to the Kotlin news and get a digest of the recently published blog posts in your inbox twice a month!

New K2 Kotlin compiler

The new Kotlin compiler now has a name: K2, after the second highest mountain in the world!

While the keynote provided us with an update on the team’s progress, a presentation by Simon Ogorodnik and Mikhail Glukhikh (Tech Lead and Team Lead, respectively, for Kotlin Compiler Core) provided more information about the motivation behind creating the new K2 compiler, how the compiler is organized internally, and the differences between the compiler’s frontend and backend. They also talked about performance and what makes the new K2 compiler faster than the current Kotlin compiler. 

Kotlin for WebAssembly – demoed for the first time!

“The team behind Kotlin for Web keeps the long-term future of Kotlin and its interplay with Web technologies in mind. This is why we have gone all in on Kotlin for WebAssembly!” – Sebastian Aigner, explaining the motivation behind the creation of Kotlin/Wasm 

Kotlin for WebAssembly will provide users with a powerful tool for writing code that is optimized for load-time efficiency, size, and predictable speeds. It will allow you to use your favorite language – Kotlin – and its familiar concepts to write code that can interact with JavaScript applications

Watch this video from Sebastian Aigner and Svyatoslav Kuzmich for a general overview of the current state of the Kotlin/Wasm compiler backend, including a live demo!

Kotlin Symbol Processing (KSP)

Google, in close collaboration with JetBrains, has been working on Kotlin Symbol Processing (KSP), a new tool for building lightweight compiler plugins and doing metaprogramming in Kotlin.

KSP offers direct access to Kotlin language constructs, and it supports Kotlin Multiplatform out of the box. It is now stable, and some well known Annotation processors, such as Room and Moshi, have already been ported to KSP.

In this talk, Jeffrey van Gogh and Ting-Yuan Huang (Tech Lead and Software Engineer, respectively, with the Android Studio team at Google) describe why they built KSP and explain the design principles they used. They also demonstrate how to use processors written in KSP and how to write your own processors, and they describe the roadmap for KSP moving forward. 

Kover – the new code coverage plugin for Kotlin

Kover is our new Gradle plugin that measures code coverage for Kotlin code built with the Kotlin/JVM compiler. It works with all Kotlin language constructs, including inline functions. You can use it locally by executing a Gradle task, or you can measure coverage as part of your CI pipeline.

In this talk, Leonid Startsev, Software Developer for Kotlin Libraries, describes the main features of Kover and explains how to set it up in your project. You won’t have problems with coverage any more!

Fun fact: Kover is a homophone of the Russian word for “carpet” (ковер), which is why we had that motley pattern in the background during the announcement of the tool in the keynote.

Qodana – better support for static analysis in your Kotlin projects.

There has been high demand for a Kotlin static analyzer from JetBrains ever since Kotlin was first introduced. Qodana, our code quality monitoring platform, now brings the intelligence of an IDE into your Continuous Integration workflow. 

In this presentation, Anton Arhipov, Kotlin Developer Advocate at JetBrains, demonstrates how to get started with Qodana for Kotlin, how to integrate Qodana with TeamCity and GitHub Actions, and how to use third-party linters with Qodana.

Additional resources

That is it for the compiler and tooling news from the Kotlin 2021 Premier Online Event. Want to catch up on more announcements and insights from the event? Check out these additional materials: 

  1. Kotlin 2021 Premier Online Event YouTube Playlist
  2. KMM Beta Roadmap Highlights
  3. Kotlin 2021 Event Keynote Highlights
  4. Meet the Kotlin Mascot (and help us to choose a name for it!)
image description