Sebastian Sellmair

Sebastian Sellmair

@sellmair.dev

Software Engineer @ JetBrains Working on all things Kotlin. KMP | Intellij | Compose

548 followers58 following148 posts

Something big might happen to the Kotlin Multiplatform Ecosystem 👀 We were never too happy about how Kotlin publishes and resolves KMP libraries. It takes up significantly more space than it has to, produces a ton of artifacts and Maven modules, and is just... complex!

View full thread

But downloading KMP libs never utilized my network fully. Why? Because we had to request 10K .pom and .module files from the repository sequentially and then download many small .klib files. Network latency prevented my bandwidth from being actually used 😫

Something big might happen to the Kotlin Multiplatform Ecosystem 👀 We were never too happy about how Kotlin publishes and resolves KMP libraries. It takes up significantly more space than it has to, produces a ton of artifacts and Maven modules, and is just... complex!

View full thread

Obviously, all of this is just a prototype, and I cannot predict when (or even if) we will be able to ship this, but I love seeing that a team like Kotlin is able to react quickly. Hope you enjoyed me sharing this ✌️ Have fun, continue building KMP libs. We got you.

Appendix: I personally predict that such a new library format will speed up Gradle IDE sync drastically, and it is not for the reason you might think when reading the previous messages (publication size). I do have f*in fast network wherever I work...

Something big might happen to the Kotlin Multiplatform Ecosystem 👀 We were never too happy about how Kotlin publishes and resolves KMP libraries. It takes up significantly more space than it has to, produces a ton of artifacts and Maven modules, and is just... complex!

View full thread

What I really love about the new .kar proposal is that it simplifies the conceptualization of KMP libraries. I still dream about being able to just download a single binary, use kotlinc, compile against what I just downloaded, and get something useful out of it.

Something big might happen to the Kotlin Multiplatform Ecosystem 👀 We were never too happy about how Kotlin publishes and resolves KMP libraries. It takes up significantly more space than it has to, produces a ton of artifacts and Maven modules, and is just... complex!

View full thread

How did we achieve these high levels of compression? We know that .klib files for each target are pretty, pretty similar to each other. Using a clever ordering of our zip entries and xz compression allows us to encode many klibs almost for free.

Clever means: Instead of just putting zip entries in the order you would walk the FileSystem, we put the "bodies.knb" file for linuxX64 right next to the "bodies.knb" file for macosX64, right next to the "bodies.knb" of the iosX64, and so on.

Something big might happen to the Kotlin Multiplatform Ecosystem 👀 We were never too happy about how Kotlin publishes and resolves KMP libraries. It takes up significantly more space than it has to, produces a ton of artifacts and Maven modules, and is just... complex!

View full thread

We measured the publication of kotlinx-coroutines to clock in at ~22 MB spread across all platforms. When publishing just a single kotlinx-coroutines-*.kar.xz file, we were able to push the size of the entire publication down to 1.2 MB 🤙

We also measured the entire Ktor publication. Kotlin 2.5 will produce ~431 MB of artifacts. Using our new .kar publication format pushed this down to 62 MB 🙏

Something big might happen to the Kotlin Multiplatform Ecosystem 👀 We were never too happy about how Kotlin publishes and resolves KMP libraries. It takes up significantly more space than it has to, produces a ton of artifacts and Maven modules, and is just... complex!

Recent events surrounding Maven Central forced us to finally address this and restart efforts we had developed but paused. This week, Pavel Kunyavskiy and I tried to distill some of the core ideas for simplifying the publication into one single concept, and I am very excited!

Let me share the '.kar' (Kotlin Archive) file format 🙇‍♂️! A single binary you can publish, which shall carry everything necessary to build your project! While this is a prototype, I really would like to share some of our early measurements! 🥳

Sebastian Sellmair reposted

Compose Hot Reload is now stable and bundled with Compose Multiplatform since v.1.10.0! 🎉 This deep dive by @sellmair.dev and Azat Abdullin walks through the engineering behind Compose Hot Reload and how it works under the hood. For the curious among you 👀 https://kotl.in/hotreload100

kotl.inThe Journey to Compose Hot Reload 1.0.0 | The Kotlin BlogCompose Hot Reload has been promoted to stable. The blog post provides a high-level overview of how Compose Hot Reload works under the hood.

Compose Hot Reload 1.1.0-alpha03 just released, and it's pretty hot. 🔥 github.com/JetBrains/co... - New, more advanced re-initialisation for statistics ↪️ - Up to 10x reload speeds by default 🏃🏽‍♀️ - Significantly reduced runtime memory usage 💾

github.comRelease v1.1.0-alpha03 · JetBrains/compose-hot-reloadRelease summary We introduced a new re-initialisation mode for static variables. Enable it by setting compose.reload.staticsReinitializeMode=AllDirty and share your feedback! We sped up incrementa...

Sebastian Sellmair reposted

So, today I found out about a secret, unsafe, internal property that makes Hot Reload waaaay faster. Like lightning fast. Even in a real project, not just with Hello World. We're currently discussing if y'all are ready for this yet - we'll probably add it to guidance later.

View full thread

It was such an amazing and fun project. I hope others might enjoy it as much as I did, but it's time for me to turn my head towards other problems and projects that we have in Kotlin.

We even have almost all features and changes ready for a 1.1 release. The first alpha is available, and we encourage you to try it out! 🤙 iOS hot reload has a proof of concept, and we hope to find enough time to productize it now 📲

However, while looking almost nostalgically at the project, I would like to announce that I transferred the ownership and maintenance of 'Compose Hot Reload' to dedicated teams at JetBrains, and I have found other people who will drive the project forward 🥹

I said it once, I'll say it again: You might think you're doing your project a favor by always upgrading to the latest AGP version. What you do instead is break the project for everyone who has not downloaded the latest IDE. This is pain

Sebastian Sellmair reposted

Casey Muratori pretty much sums up how I feel about LLMs for coding: "The AI will always be useless for me. I physically can't get what I want from programming when AI is involved, because what it is doing is robbing me of the experience that I wanted to have and the knowledge that I wanted to get"

Oh, I did not expect to have so much fun building the IDE tooling/integration for Compose Hot Reload 😍 See the small floating toolbar when a session is present, even allowing you to reset your UI state!

Sebastian Sellmair reposted