-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Dart Extensions #2396
Comments
Here is the relevant code in the dart CLI: |
Assuming we keep this in the embedder, what happens when an import 'dart-ext:' occurs is the following:
In existing extensions, in the _Init method mostly just wires up the native resolver for the Dart code. I wonder if we could formulate extensions differently and support them directly in the VM. I'll investigate this. |
I've moved this to the 2.0 milestone since it doesn't seem like a blocker for a quality first release. |
This is not needed by any near-term customer. The only bug I've seen which might use this is opengl support: #179 iceboxing. |
I'm currency working on an app that needs to use digital signatures, specifically EdDSA. Since there are C implementations which are stable and known to be reliable, I think it would be safer to use FFI, rather than trying to port the algorithm to dart. Especially with WebAssembly becoming widely supported, Flutter would be at a disadvantage if it didn't allow FFI to use native libraries. |
You may be able to use our plugins system to communicate between the Flutter Dart code and platform-specific libraries: https://flutter.io/platform-plugins/ |
#7053 is probably what you want. You can integrate with C code today with Flutter, you just have to bounce through Java/Obj-C first. |
This need will hopefully be covered by FFI work: dart-lang/sdk#34452 and related tooling work in: #7053 |
does the flutter support dart native extension? according to use |
When all plugins are release at once there will be a tag for each of the plugins but each tag will again test all plugins which makes it not optimal.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
https://www.dartlang.org/articles/native-extensions-for-standalone-dart-vm/
We've had at least one request for this. I suspect it's implemented entirely in the
dart
CLI.My understanding is it's just a bit of code to map dart-ext: urls to making a dlopen call and passing the symbols off to the VM. @johnmccutchan
I'm mostly seeking to document how we'd do this in this bug. It's not clear if this is generically useful.
The text was updated successfully, but these errors were encountered: