Skip to content

NodeJS WASI API throwns an exception when both _start and _initialize are exported #51544

Closed

Description

@johanbrandhorst

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!

Activity

  1. johanbrandhorst commented on Jan 22, 2024

    @johanbrandhorst
    Author

    This restriction appears to have been added in #33073. CC @cjihrig

  2. added
    uvwasi-agendaIssues and PRs to discuss during uvwasi team meetings.
    on Jan 26, 2024
  3. guybedford commented on Feb 20, 2024

    @guybedford
    Contributor

    Commands and reactors are distinct execution models, so I believe that would have been the intent here. Specifically WASI doesn't define that _initialize is called for commands (which use _start). See https://github.com/WebAssembly/WASI/blob/main/legacy/application-abi.md#current-unstable-abi for more info.

  4. johanbrandhorst commented on Feb 22, 2024

    @johanbrandhorst
    Author

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    uvwasi-agendaIssues and PRs to discuss during uvwasi team meetings.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions