tinygo-org/tinygo-site

Using WebAssembly: wasm_exec.js

jzabinski-dolios opened this issue · 1 comments

The documentation says:

Execution of the contents require a few JS helper functions which are called from WebAssembly. We have defined these in tinygo/targets/wasm_exec.js.

The file path is ambiguous: it could be referring to the file's location in the TinyGo repository, or to the location in the locally installed instance of TinyGo. It would be helpful to be explicit about the file's various locations. Maybe something like this:

Execution of the contents require a few JS helper functions which are called from WebAssembly. We have included the file in the local TinyGo installation. It can be found in [path/to/TinyGo]/targets/wasm_exec.js. It can also be found in the TinyGo repository at https://github.com/tinygo-org/tinygo/blob/release/targets/wasm_exec.js.

Fair point. Both files are the same for the same TinyGo version. So generally you should copy it from your local TinyGo installation but it doesn't matter much.

If you want, you can make a PR to make this clear. The source file is here: https://github.com/tinygo-org/tinygo-site/blob/release/content/docs/guides/webassembly.md