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
{{ message }}
Repository navigation
NodeJS WASI API throwns an exception when both _start and _initialize are exported #51544
This isn't an issue so much as opening a discussion surrounding this design choice. What basis was used for the decision to throw an exception if both _start and _initialize are defined? I'm asking as one of the authors of a proposal for Go to support exporting functions to Wasm: golang/go#65199. I'm trying to understand more about the patterns and expectations of the ecosystem. Is there any reason these two can't coexist, and the host can call either depending on the users actions? Thanks!
Yep, I think this is fine, I forgot to close this one, but to close the loop, @cjihrig was kind enough to jump in on the Go proposal and explain the rationale. Thanks!
Activity
johanbrandhorst commentedon Jan 22, 2024
This restriction appears to have been added in #33073. CC @cjihrig
guybedford commentedon Feb 20, 2024
Commands and reactors are distinct execution models, so I believe that would have been the intent here. Specifically WASI doesn't define that
_initializeis called for commands (which use_start). See https://github.com/WebAssembly/WASI/blob/main/legacy/application-abi.md#current-unstable-abi for more info.johanbrandhorst commentedon Feb 22, 2024
Yep, I think this is fine, I forgot to close this one, but to close the loop, @cjihrig was kind enough to jump in on the Go proposal and explain the rationale. Thanks!