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
Currently, Grain seems to emit a wasm binary that imports almost all WASI APIs, regardless of whether they are actually used or not. This means that on a WASM runtime that does not support all WASI APIs, the Grain app will not run, even if the Grain app is actually calling only the WASI APIs supported by that runtime.
Is it possible to improve Grain so that it imports only the APIs that are actually used, instead of always importing all WASI APIs?
I'd also like to note that WASI is making big changes on its API12, so reducing imports will also benefit future compatibility.
For example,
import Process from "sys/process"
Process.exit(1)
This code only calls the proc_exit WASI API through Grain's standard library, but the emitted wasm module imports almost all WASI APIs.
Currently, Grain seems to emit a wasm binary that imports almost all WASI APIs, regardless of whether they are actually used or not. This means that on a WASM runtime that does not support all WASI APIs, the Grain app will not run, even if the Grain app is actually calling only the WASI APIs supported by that runtime.
Is it possible to improve Grain so that it imports only the APIs that are actually used, instead of always importing all WASI APIs?
I'd also like to note that WASI is making big changes on its API12, so reducing imports will also benefit future compatibility.
For example,
This code only calls the
proc_exit
WASI API through Grain's standard library, but the emitted wasm module imports almost all WASI APIs.Footnotes
FS APIs will have big changes https://github.com/WebAssembly/WASI/issues/469#issuecomment-1045251844 ↩
Some APIs will be removed, such as
proc_raise
, which Grain always imports. https://github.com/WebAssembly/WASI/issues/26 ↩The text was updated successfully, but these errors were encountered: