Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Use Dart VM FFI #12

Closed
kozw opened this issue Jan 26, 2019 · 7 comments
Closed

Use Dart VM FFI #12

kozw opened this issue Jan 26, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@kozw
Copy link
Contributor

kozw commented Jan 26, 2019

The Flutter 2019 roadmap lists better support for C/C++ libraries from Flutter, including direct calls to C/C++ from Dart. This is of major importance for flutter_sodium. The current implementation uses platform channels with Java and Swift interop.

Not only is the runtime performance sub-optimal, there's a lot of code to write and maintain. Not to mention the fact that the Android version is still lacking in features compared to iOS due to a dependency on incomplete 3rd party libraries (#7)

As soon as native C interop is available, flutter_sodium should take advantage of it. You can track the Dart issue and read more in the FFI vision document. Looks like an initial version is planned somewhere in Q1 2019.

@kozw kozw mentioned this issue Mar 27, 2019
@kozw kozw self-assigned this Apr 7, 2019
@kozw kozw added the enhancement New feature or request label Apr 7, 2019
@filleduchaos
Copy link

Hello @kozw - is there any work being done on this now that dart:ffi is in preview? I see there's an ffi branch, but it hasn't been touched in 6 months. I'm open to contributing if you're short on time/resources :)

@kozw
Copy link
Contributor Author

kozw commented Oct 15, 2019

Not at the moment no, indeed due to limited time and resources. I'm not sure the current ffi branch even compiles with the latest preview bits. Feel free to start creating pull requests.

@cbenhagen
Copy link

@kozw Maybe you could team up with Marvin Hannot? (https://gitlab.com/MagicGuitar/dart-sodium)

@MarvinHannott
Copy link

As far as I know, the FII doesn't work (yet) with AOT compilation. And calls aren't asynchronous like calls to Flutter's MethodChannel. But if you think my work is of any help, please feel free to use it.

@cbenhagen
Copy link

FFI does now work with AOT. See dart-lang/sdk#35765 and dart-lang/sdk#37295.

@canewsin
Copy link

canewsin commented Mar 8, 2020

@cbenhagen is there any documentation on usage ?

@kozw
Copy link
Contributor Author

kozw commented May 11, 2020

Porting flutter_sodium to FFI has recently been started. Track its progress in #35. Closing this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants