On Wed, Apr 22, 2020 at 9:29 PM Tianqi Chen <[email protected]> wrote:
> Dear Developers: > > https://v8.dev/blog/emscripten-standalone-wasm provides an excellent > description about how to compile a stand-alone WASM via emcc. > However, in the case of the syscalls still needs emscripten defined files, > we will still need an emscripten generated file, and that means > we will need to interact with the WASM via the emscripten Javascript > wrapper, e.g. Module.wrap, and call > > Recently we start to look into directly build our js interface on top of > the WASM js API. > I am wondering if it is possible to directly interact with the wasm module > generated by emscripten via the standard WASM js interface, > but still make these additional emscripten syscalls available. > > In particular, I am looking for something like > > > emcc -O3 mylib.c -o mylib.js -s STANDALONE_WASM > > > Then > > const binary = require('fs').readFileSync('mylib.wasm'); > > // this line ontains the emscripten defined syscalls as a imports > // that can be passed to the WebAssembly interface. > imports_with_emscripten_sycalls = getEnv("mylib.js"); > > WebAssembly.instantiate(binary, imports_with_emscripten_sycalls); > > > No, this is currently not possible. I think it would be cool feature though. I'm not sure how much work it would be to modify the generated JS to work in this way. I'm guessing a fair amount.. > Thank you! > > TQ > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/4dda2146-9bb7-4d5e-abc9-adeb505ef029%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/4dda2146-9bb7-4d5e-abc9-adeb505ef029%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29AAMY5-CQ5S7gYQ6MD1Bp3Y5hpBYrMNFc14w3zh3V8hw%40mail.gmail.com.
