-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow dart2wasm to interop with other wasm code & provide wasm data structures (e.g. in dart:wasm
)
#55856
Comments
dart:wasm
)dart:wasm
)
is this something akin to building on top of something like wasmtime via their C interop to pick up the ability to run and load wasm modules or is that something you’re thinking about implementing yourselves? Or did I misunderstand the point of this entirely? |
I'm not sure how feasible it is from a Dart compiler/runtime point of view, but in respect to exporting functions, I would love to have the ability to just export one or more global Dart functions to be able to them call them from either JS in a browser environment or even better in a non JS WASM runtime, eg running serverside in wasmer, wasmtime etc, though of course that relies on at least one of those actually getting support for WASM-GC |
Currently with the new JS interop one can expose Dart functions to JS via procedurally setting properties on
Right now dart2wasm relies on JS environment for certain functionality (e.g. regular expressions, weak references, expandos, finalizers, etc). Before we can fully run in non-JS environments we need to find a way to implement them without relying on JS, possibly requiring the pure-wasm runtimes to provide some of those (e.g. weak refs & expandos) or shipping our own regexp compiler. Please subscribe to #53884 for that. |
Currently dart2wasm compiled apps are full apps that have a
main
function which can be invoked - there's no (official) capability to call out to imported wasm functions or export wasm functions to be consumed by other wasm modules.This issue tracks (possibly in a
dart:wasm
):WasmGC interop: For User-defined wasm structs the compiler would need to ensure that the types end up in the right recursion groups in order to ensure they will match with other wasm modules, ensuring interop works.
LinearWasm interop: We'd need to ensure the design is considering a future where multiple linear memories are supported (see https://github.com/WebAssembly/multi-memory).
We may want to expose this in a
dart:wasm
(possibly with same or separatedart:wasmgc
)The text was updated successfully, but these errors were encountered: