-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
[proposal][wasm][ffi] AOT wasm interoperability #160735
Comments
@iapicca What are you asking for? Being able to call into WASM code from a native backend? Or being able to compile Dart to WASMGC and calling into WASM from Dart when Dart is being compiled to WASM? What use case do you want to solve? (My current thinking is that if you have native code, then it can be compiled to a dynamic library for the native backends, and to wasm (via emscripten) for web backends. And then we need support for calling WASM code from the WASMGC backend possibly via |
to be able to call WASM code on all platforms supported by Flutter
yes, on all platforms
Given that AFAIK at the time of writing Dart compiles to WASM only for flutter web, then yes
to be able to call WASM code on all platforms supported by Flutter (see above)
I don't assume native code as a starting point, Yes, there is a need for a runtime and picking one will be an interesting choice to make
I'm sure it could work, but it feel a bit "artisanal", no offense. @dcharkes you mention the use of wasm package that is discontinued
I'm essentially proposing to replace it (or resurrect it) |
I'm also interested in this. WASM could be a good library. You could just use wasm packages like npm packages and use it on all platforms. I'm also interested if this could also be in a secure environment, to allow something like a plugin system inside a flutter app. |
I don't think this is possible on all platform, basically ios forbid it (and some android as well?) |
I would just keep it to the developer. |
In the issue description I specify the need for a native asset, |
Some statements on this issue are incorrect. Wasmer did support AOT at the moment of discontinuation, and you can already run Wasmer in iOS and Android. Quoting from the original comment:
The main issue was that the compiled module AOT was not cross-platform (for example, you could not reuse the same compiled module for x86 Windows in ARM64 iOS). This problem exists in any sandalone Wasm runtime that is not Wasmer at the moment. That specific issue is, however, solved since the interpreter support we added in Wasmer 5.0. |
@syrusakbary
am I missing something? |
I continue to maintain an opinion that direct first party interoperability with Wasm across all surfaces supported by Dart should not be part of Dart (or Flutter) SDKs. It should exist as a third party package / tooling. And we should make sure to accommodate the needs of such package tooling in low level capabilities of the platform. It does seem to me that native assets (and associated build/link/packaging hooks) should be good enough for people to be able to build and publish their version of So my suggestion here would for people interested in this sort of thing - to start designing, building and experimenting, and provide feedback to the Dart and Flutter teams. I have heard various pitches trying to explain why Dart/Flutter should have this and none of them are persuasive enough (or have sufficient ecosystem momentum behind them):
|
I don't think this is relevant to the tools team right now since it's a proposal for a larger Dart / Flutter feature, so I'm going to remove the |
Use case
wasm interoperability would offers great value to flutter's framework
I'm sure the team is aware of this [1, 2] given that there used to be a labs.dart.dev's package wasm
that was discontinued in summer 2023;
according to this comment such decision was caused by 3 technical obstacles:
as of today there is visible momentum towards the clearing of the main obstacles
Proposal
Track the clearing of technical blocker for a
wasm
implementationand if/when these blockers are cleared resume/re-work the deprecated package:wasm
cc @devoncarew @mit-mit @liamappelbe @hydai
The text was updated successfully, but these errors were encountered: