3 ms·
I 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
by account-5 3y ago
I 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."