piannaf’s avatarpiannaf’s Twitter Archive—№ 2,838

                              1. #TouchlabShare with @ankushg from @quizlet getting started. @TouchlabHQ/1304423008770035713
                            1. …in reply to @piannaf
                              Spoiler Alert: KMP works #TouchlabShare
                          1. …in reply to @piannaf
                            It's possible Quizlet was one of the first #KotlinMultiplatform applications in production #TouchlabShare
                        1. …in reply to @piannaf
                          At the time, when KMP first came out, we weren't new to the idea of sharing logic. We were a web-first company, and when we started the mobile apps, there was complicated logic that we were building 3 times. Then we tried sharing JS logic via V8 #TouchlabShare
                      1. …in reply to @piannaf
                        This was before the days of split APKs, etc. V8 was the only thing that was performant enough but it had a huge size on Android. Better on iOS because JavaScriptCore is bundled with iOS. This was even before we were using TypeScript so it was all very brittle #TouchlabShare
                    1. …in reply to @piannaf
                      In 2017 we were at the point where we were going to rewrite Android in Kotlin, then "bam" there was KMP which was still experimental but if it worked, we'd have the best of both worlds. #TouchlabShare
                  1. …in reply to @piannaf
                    We were already sharing code on Web, Android, and iOS, but with KMP we may get full performance on Android and full performance on iOS #TouchlabShare
                1. …in reply to @piannaf
                  From an Android engineer's perspective, there were pros and cons, but we needed to think about the iOS perspective, the web perspective, and the managers' too. There were other options too, like GO compiling JS and native code, ReactNative, etc. #TouchlabShare
              1. …in reply to @piannaf
                We had to think carefully about how solutions would work for everyone. [Shameless Plug: touchlab.co/how-to-evaluate-kotlin-multiplatform-react-native-flutter/]
            1. …in reply to @piannaf
              We had an initial proof of concept. For our usage the external API was pretty straightforward but internal is very complicated: regex, deep stack, modeling the user's knowledge state. With KMP, how would we interact with it from JS, iOS, and Android. #TouchlabShare
          1. …in reply to @piannaf
            All the stuff we currently have in KMP, doesn't use networking, persistence, or concurrency. We are using it in the same logic areas we were using JavaScript. #TouchlabShare
        1. …in reply to @piannaf
          Something we are looking into is using GraphQL. Now that Apollo client supports KMP, it's a serious option now. @tasomaniac/1252713167169507335 #TouchlabShare
      1. …in reply to @piannaf
        Compared to Flutter and ReactNative, where if it doesn't pan out, you'll need to rewrite, but with Kotlin Multiplatform, you don't have that big risk. We knew we'd be writing Android in Kotlin anyway, so the risk was contained on the iOS and JS sides #TouchlabShare
    1. …in reply to @piannaf
      Because KMP is optional, we can choose small parts to try sharing first and mitigate those risks. Also since it's backed by JetBrains, and JetBrains is a tooling company, that lessens the risk, too #TouchlabShare
  1. …in reply to @piannaf
    Aside: Touchlab was talking to a large company where their iOS team discovered Kotlin Multiplatform and they found a usecase where it Kotlin on iOS was more performant than their native iOS code. #TouchlabShare
    1. …in reply to @piannaf
      With the new JS IR in Kotlin 1.4, there is support for Typescript. There are still some things we'd like to see For example: We have consistent enums across all of our platforms, but Kotlin has a different implementation than KotlinJS #TouchlabShare
      1. …in reply to @piannaf
        KotlinJS also has a dead code eliminator similar to Proguard for Android. There could be more work in this area to improve "developer ergonomics" in the JS world HT to @benasher44 for the term benasher.co/kotlin-ios-ergonomics/
        1. …in reply to @piannaf
          Q: What do you think about new declarative UIs? A: There's a really cool project github.com/joreilly/PeopleInSpace from @joreilly which I'm using to learn how KMP works with Compose and SwiftUI #TouchlabShare
          1. …in reply to @piannaf
            It's amazing how the community is growing around #KotlinMultiplatform There's likely going to be a community effort around Compose on iOS if JetBrains doesn't do it first. #TouchlabShare
            1. …in reply to @piannaf
              The nice thing is none of this changes how KMP works for shared code. You can put together a project, share what you want with some targets, share what you want with other projects, and you don't stop moving
              1. …in reply to @piannaf
                Last words: at any point in time, be open that KMP might not be the right tool for the job. Look at what it does well, look at what it does wrong #TouchlabShare