4 ms·
Kotlin Multiplatform allows you to work fully native on Android as Kotlin is the main language there. And it also allows to compile to native iOS code and integ
by jurmous 3y ago
Kotlin Multiplatform allows you to work fully native on Android as Kotlin is the main language there. And it also allows to compile to native iOS code and integrate with native iOS Objective-C code or bridge code. (Swift integration is on the roadmap) It also allows you to directly call C code or C libraries. Or it allows to compile to JS and call JS code. So it is more versatile than Flutter and easier to integrate with native code/components. Flutter is more creating its own world with the Dart sandbox and then has to pass messages to communicate with the native world. Kotlin is closer to native output.
Jetpack Compose is the UI library and provides a similar mechanic as React/SwiftUI/Flutter in building declarative UIs. It is already the Android default as Google started to develop this UI library and Jetpacks brought in the multiplatform implementation.
- account-5 3y agoI thought dart/flutter compiled to native code, on whatever platform it was on. And I thought dart could directly call libraries via it's ffi? I'm no expert so I'm likely wrong.
- jurmous 3y agoIf I am correct Flutter compiles to Dart code which compiles to Native code. Above I was more talking about platform integration. As Flutter their own document states everything within Dart is compiled to run like its own enclosed runtime environment. It talks with the native world with messages over channels. https://docs.flutter.dev/platform-integration/platform-channels https://docs.flutter.dev/platform-integration/platform-chann... Within Kotlin however it is possible to directly call the native method. So it looks like Flutter has more overhead for native communication than Kotlin. Here for example a part of a C interop tutorial in Kotlin. You can directly work with data coming from C libraries. https://kotlinlang.org/docs/mapping-primitive-data-types-from-c.html https://kotlinlang.org/docs/mapping-primitive-data-types-fro...
- fyzix 3y agoFlutter apps are written in dart which compiles to native code or js/wasm on web. Dart can interop with swift/obj-C/Java/Kotlin through the use of channels. Dart can interop with C/Rust/C++ directly through FFI[1] [1]: https://dart.dev/guides/libraries/c-interop https://dart.dev/guides/libraries/c-interop
- cangeroo 3y ago"Dart includes both a Dart VM with just-in-time (JIT) compilation and an ahead-of-time (AOT) compiler for producing machine code." "Its web compiler translates Dart into JavaScript."
- LouisCAD 3y ago*JetBrains* brought in the multiplatform implementation, not "Jetpacks"!
- jurmous 3y agoOops, was a mistake. Cannot edit comment anymore.. Thanks!