Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin Multiplatform. Why and How?

Kotlin Multiplatform. Why and How?

By : Deny Prasetyo (Jasoet), Sr Software Engineer, Gojek
Live : https://youtu.be/cQIS9u8ur_Y?t=830

Tweet

More Decks by Android Enthusiast Jakarta

Other Decks in Technology

Transcript

  1. @Jasoet > Deny Prasetyo • 10+ years experience as a

    engineer and trainer. • Kotlin, Go, and Cloud Native Technology Enthusiast • Cloud Automation Tech Lead, Infrastructure Engineering, Gopay Indonesia • Kotlin Indonesia organizer
  2. What is Not? ➔ Not a Java Killer! ➔ Not

    a new Platform! Just a Language! @Jasoet
  3. Modern Language ➔ Null Safety ◆ Null are part of

    type system ➔ Mutability Protection ◆ Mutability notation is a requirement. ◆ You must choose val or var. ➔ The Magical Fun ◆ Normal Function ◆ Higher order function and Lambda ◆ Inline fun ◆ Function Literal with Receiver ◆ Extension Function (Kotlin’s white Magic) ➔ Class and Object ◆ Class @Jasoet ◆ Inheritance ◆ Data Class ◆ Object Notation (the real form) ◆ Companion Object ◆ Sealed Class ◆ Destructuring ◆ Enum Class ➔ Safety Belt ◆ `is` operator ◆ Smart Cast ◆ Unchecked Exception (No more “Exception Driven Programming”) ◆ Type Alias ➔ Coroutine
  4. Features • Regular Loops • Regular Exception Handling • Regular

    High Level Operator ◦ let, apply, forEach, filter, map, use, etc
  5. They all support Kotlin! • Spring Boot (https://start.spring.io/) • Eclipse

    Vertx (https://vertx.io/) • JetBrains Ktor (https://ktor.io) • Quarkus (https://quarkus.io/) • Micronaut (https://micronaut.io/) • Oracle Helidon (https://helidon.io)
  6. Kotlin/Native Kotlin as LLVM language frontend • Compile to Native

    • Interoperability with C and Objective-C • Flexible • Garbage Collector • Support Multiple Target Platform https://kotlinlang.org/docs/mpp-supported-platforms.html
  7. How its works? • Language, and platform-specific libraries and tools

    • Common code ◦ language, core libraries, and basic tools. Works everywhere on all platforms ◦ Ktor, Koin • Interoperability ◦ Access platform specific code and leverage all capabilities ◦ Natively integrated. Smooth interop. • Code sharing ◦ Optional sharing. Low risk. No big decisions. ◦ Code sharing, not cross-platform