You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I have a js library that is already using an emscripten generated wasm file and I try to componentize that, given spider monkey supports wasm, can I "just" bundle the existing wasm as if it were any other resource (like a jpeg)?
The text was updated successfully, but these errors were encountered:
Because the component model supports core imports equally, and components can embed any number of other components or modules, in theory it should just become another core module embedded in the outer component.
There are some techniques we have in mind to support this kind of use case, it will just involve some tricks to properly handle.
So no, it's not just bundled like a jpeg, it would be wrapped specially within the component model constructs so that instead of running that Wasm on a virtual WebAssembly runtime, it would just punch through to the outer Wasm runtime and run on that.
I can imagine how this would work for components embedded in components, but will this be possible for a "emscripten generated wasm file" (which was my way of saying "not a component" or more realistically a third party wasm file, which I don't have any intimate knowledge about)?
If I'm understanding your scenario correctly, then the answer is yes - if you are componentizing JS which depends on core Wasm, as a component, then the final component should be possible to work using these techniques since components can depend on and instantiate core wasm. And this (hypothetical) technique would automatically inline that core wasm and its bindings regardless.
It would rely on being able to statically analyze the JS to determine where Wasm is being instantiated though. But that should be possible to automatically pick up for standard instantiation code patterns in JS.
Say I have a js library that is already using an emscripten generated wasm file and I try to componentize that, given spider monkey supports wasm, can I "just" bundle the existing wasm as if it were any other resource (like a jpeg)?
The text was updated successfully, but these errors were encountered: