# Journey to K2: using the New Compiler in Apollo Kotlin

DevFeed: [Journey to K2: using the New Compiler in Apollo Kotlin](<https://devfeed.tech/articles/journey-to-k2-using-the-new-compiler-in-apollo-kotlin-23435.md>)

Original publisher: [Read original article](<https://www.apollographql.com/blog/journey-to-k2-using-the-new-compiler-in-apollo-kotlin>)

Author: Benoit Lubek

Published: 2024-06-19T08:26:00Z

Content type: article

Language: en

Sources: [Apollo Blog](<https://devfeed.tech/sources/apollo-blog.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [migration](<https://devfeed.tech/topics/migration.md>), [build performance](<https://devfeed.tech/topics/build-performance.md>)

Tags: [build-performance](<https://devfeed.tech/tags/build-performance.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compose](<https://devfeed.tech/tags/compose.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [migration](<https://devfeed.tech/tags/migration.md>), [mobile](<https://devfeed.tech/tags/mobile.md>)

## AI overview

Apollo Kotlin migrated to K2, the rewritten Kotlin compiler frontend released with Kotlin 2. The article describes the migration process, including compilation errors, language differences, compiler bugs, and changes to the Compose compiler and Gradle configuration.

## Source excerpt

Apollo Kotlin is now built with K2, the new compiler that has recently been released with Kotlin 2. Here are a few details on the migration process. What is K2? K2 is a complete rewrite of the Kotlin compiler frontend, " the part of the compiler that parses your code and performs the semantic analysis, data flow analysis, call resolution, and type inference " (source). The result is a faster, more robust and reliable compiler that should also be easier to evolve in the future.