:new::kotlin-intensifies-purple::party-parrot: :m...
# announcements
a
🆕K🦜 📣 Kotlin 1.8.20-Beta brings many new features:New Kotlin K2 compiler updatesNew experimental Kotlin/Wasm targetNew JVM incremental compilation by default in GradleUpdate regarding Kotlin/Native targetsPreview of Gradle composite builds in Kotlin MultiplatformImproved output for Gradle errors in XcodeExperimental support for AutoCloseable interface in standard libraryExperimental support for Base64 encoding in standard library 📣 The K2 Compiler is going stable in Kotlin 2.0 We’ve been working on a new frontend for the Kotlin compiler (code-named “*K2*”) for quite a while. The new frontend is already available for preview – we’re continually polishing and stabilizing it and plan to make it the default compiler frontend in a future Kotlin release. We’ve decided to name this future release Kotlin 2.0. Learn more about the release roadmap and what to expect from Kotlin 2.0 Try out the new compiler frontend and give us feedback! Starting with Kotlin 1.8.20-Beta you can enable a preview of the Kotlin 2.0 language version via the regular Kotlin language version flag.
👀 2
2️⃣ 2
🎉 14
.wasm 18
K 13
K 85
❤️ 27
🙌 2
r
Is the stable compiler plugin API still targeted for 2.0? The target version at https://youtrack.jetbrains.com/issue/KT-49508 is 1.10.0, which according to the post above is now 2.0.
d
It won't be ready to 2.0 Stabilization of K2 itself is more important task than stable compiler API But we definitely want to stabilize it in future
🆗 2
i
Kotlin 2.0 is not supporting kapt. huge breaking change!
d
What do you mean? K2 doesn't support kapt yet, and we are working on it
i
d
Yep And there is a word "currently" in the error message
a
“Faster application runtime performance compared to Kotlin/JS and JavaScript because Wasm is a statically typed language.” This does not make sense to me? A statically typed language doesn’t have to be fast at all. The V8 engine is hiiiiighly optimized. WASM is cool but not automatically faster.
p
WebAssembly 🚀
c
wooooo
🦜 2
m
Does Compose work with K2 already in 1.8.20-Beta? Last time I asked in #k2-early-adopters (see thread) the answer was: could be 1.8.20, maybe 1.9.0. Would love to finally try K2! CC @dmitriy.novozhilov
K 3
☝🏾 1
☝️ 2
d
Main major issues from Compose side was fixed in Kotlin only in 1.9, so, unfortunately, no Compose support in 1.8.20
👍🏽 1
👍 4
🫣 1
m
Thanks for the info! 👍
g
We would like to allocate resources for testing of K2, but it's not possible while neither compose nor kapt are supported
1
d
no Compose support in 1.8.20
...just as Gradle Composite support is fixed in
1.8.20
- yearning to use Composite in a Compose project - why do my stars refuse to align 🙃
1.9
is going to be a long wait.
r
We have been running k2 for a kotlin/jvm project for a long time locally and then we disable it in CI. A nice tradeoff if you do not want to use it for release builds
Copy code
val isCiServer = System.getenv().containsKey("CI")

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
    kotlinOptions.useK2 = !isCiServer
}
or in 1.8.20+
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
    kotlinOptions {
       if(!isCiServer) {
           languageVersion = "2.0"
       }
    }
}
👍 1
r
Are there any plans to have traits/mixins in kotlin in the near future? That's one feature I miss over and over again
🚫 1
😞 1
1023 Views