Surprisingly, wabt depends on fs under the hood, which is obviously not available inside a browser.
I'm working on an online compiler which translates source code into WAT, so precompilation on the server side is not possible.
Any ideas?
1 Answer
If that helps, the Wasm reference interpreter can readily be build into a plain JS library that can encode and decode the Wasm text format.
wat2wasm.wabtandwat2wasmpackages is that they requirefs. So mb they just send wat to server and receive wasm from it. If it is possible to usewabtinside a browser, can You provide a code snippet? Thanks.view-source:https://webassembly.github.io/wabt/demo/wat2wasm/)