-
Notifications
You must be signed in to change notification settings - Fork 25
Wasm for web #34
Comments
That's definitely what we plan to do, but I can't give you an ETA at the moment. |
As the author of wasm_interop, I second that. The immediate issue is the difference between JS and Wasmer API designs. |
Hopefully we can abstract away the API differences. It's mainly just a question of prioritization. Since this is considered an experimental package, and we don't know how many users we're going to have until we publish, web support wasn't prioritized (especially since we basically have to re-implement the whole package for JS). But the more people request this feature, the sooner we'll start working on it. |
I'm curious @lexaknyazev do you see these API design differences an insurmountable? Does this package need to end up as package:wasmer if so (e.g. would the API need to change significantly to eventually accommodate js compat)? |
Before making any suggestions, I'd list a few outstanding issues:
|
Thanks for the info. Async compilation is also on our todo list. Sounds like we should implement that first. |
Here are my initial thoughts on this after reading through the sources of this package.
WDYT? |
Web users won't use wasmer or FFI or have to install rust (they probably won't even need to run the setup script). Dart packages support conditional importing, so for web we'll have an alternative implementation similar wasm_interop. The key is that the web implementation will have exactly the same interface, so theoretically users shouldn't notice the difference. So the question is whether the JS API is so different that we will run into problems trying to squeeze it into the package:wasm interfaces. From our discussion so far I don't see any such issues (other than async compilation). |
Sure, nothing insurmountable here. In the order of decreasing importance, I'd list the differences as:
All of these (except some edge cases related to |
Not sure if this is useful or not, but since a few days ago Wasmer (in Rust) can be compiled to Javascript. We are working on an article showcasing how to use it. What this implies, is that if necessary even dart-lang/wasm could be eventually be compiled (with your current same syntax) to js :) |
While I don't know the INS and outs of this, I've had the need to use C libraries recently. Adding an automated tool, like ffi gen augmented with maybe behind the hood emscript to have automatic binding for both Web and mobile would be an extremely appealing feature. To me that sounds like a game changer in positioning dart as a language that works well with other languages. Let me give some use cases:
Not to mention all the dev time that go in this problem could instead be channeled here, but that might be wishful thinking |
Bump. I was thinking of using Flutter for app UI and WASM for logic specifically to have it work on both web and desktop... any news? |
I'm still working on properly supporting iOS. I haven't started on web support yet, but that will come next. |
I Was wondering if it is possible to add web support to wasm someway (it uses ffi so assuming it will not support web),
or maybe have source_gen generate interop with something like wasm_interop for web.
This could help package developers as they will not have to maintain 2 packages(package using ffi and package using js interop) and also having just a single file binary file to read from unlike for the ffi would be great!
The text was updated successfully, but these errors were encountered: