K/N for mobile developers (including libraries' snippets)

7d67eb78fab223823acad6714cd2d3ca?s=47 Enrique López Mañas
October 21, 2019
12

K/N for mobile developers (including libraries' snippets)

7d67eb78fab223823acad6714cd2d3ca?s=128

Enrique López Mañas

October 21, 2019
Tweet

Transcript

  1. 2.

    Ego Slide • Freelance Dev • Google Developer Expert •

    KotlinWeekly publisher • @eenriquelopez • Mainly Android Kotlin, Backend Kotlin, iOS (mostly Swift)
  2. 6.
  3. 7.
  4. 16.

    Kotlin/Native - Uses LLVM (5.0) - Provides runtime guarantees -

    Exceptions, memory management - Interop with C/Objective-C (Swift) - Platform libraries (POSIX, Apple Frameworks, Win32, DOM, etc)
  5. 18.

    The compiler -Shares Front-end with Kotlin/JVM and Kotlin/JS - Written

    in Java and Kotlin - Produces bitcode via LLVM API
  6. 19.

    Memory Management - ARC with Cycle Collector - When working

    pure Kotlin,don’t worry about memory management - Weak references supported - Memory sharing model - Different threads have disjoint object graphs - Object subgraphs can be transferred between threads - Immutable objects can be shared
  7. 20.

    Interoperatibility - Interoperatibility with C, Objective-C and Swift - Kotlin

    can call C/Objective-C and vice-versa - Kotlin can extend Objective-C classes and vice-versa - Memory management aware of Objective-C runtime
  8. 21.

    Mapping - Numbers are kept - Strings converted - Kotlin

    declarations wrapping C entities (functions, struct, unions, etc.) are auto- generated - Objective-C OO concepts (classes, protocols, blocks) are represented as matching Kotlin entities (classes, interfaces, lambdas) - For Objective-C, Kotlin code can be compiled to a framework
  9. 22.

    Kotlin Library - Hold collection of code for reusability and

    sharing - Own format: ‘klib’ extension, which holds metadata and bitcode - Tool for creating and storing libraries in repositories
  10. 32.

    ktor - Web application framework -Domain Specific Language (DSL) syntax

    for web apps-Kotlin coroutines for asynchronous programming -Can be used on web, iOS and Android -Provides a unified toolset with a single language, like Node.js but with type-safety and build-concurrency.
  11. 33.
  12. 34.
  13. 35.
  14. 36.
  15. 37.
  16. 47.
  17. 48.
  18. 49.
  19. 66.

    The future Hard to make predictions, easier to bet safe

    “I don’t know what will happen in 10 years, but there will be people asking in SO about regular expressions, and there will be another JS framework ”
  20. 68.

    Flutter vs Kotlin/Native? Flutter - custom UI Widgets Kotlin -

    more performant Kotlin - better ecosystem
  21. 69.

    Recommendations - Use it with caution - Shared components -

    Keep versioning in mind - Do not compromise 100% of a project
  22. 70.

    Further resources Kotlin Slack (kotlinlang.slack.com) Touchlab resources (https://github.com/touchlab) Kotlin Weekly

    (http://kotlinweekly.net) K/N documentation (https://kotlinlang.org/docs/ reference/native-overview.html)
  23. 71.