Skip to content

wit-bindgen support for wasm start #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kulakowski-wasm opened this issue Jun 24, 2022 · 2 comments
Closed

wit-bindgen support for wasm start #262

kulakowski-wasm opened this issue Jun 24, 2022 · 2 comments

Comments

@kulakowski-wasm
Copy link
Contributor

@sunfishcode is the discussion in WebAssembly/WASI#19 relevant to this one?

@kulakowski-wasm kulakowski-wasm changed the title Support for wasm start wit-bindgen support for wasm start Jun 24, 2022
@sunfishcode
Copy link
Member

It is, though a lot of the discussion there reflects the uncertainty at the time about the relationship between a wasm module and the outside environment. Many of the questions now have answers in the component model.

The conceptual interface to the outside world is a component interface. But there's also a conceptual inner core module which implements a lowered form of the component interface through an adapter layer, for now using the Canonical ABI.

So for the start function: Unlike the discussion in WebAssembly/WASI#19, we now know that components are acyclic, so the outer component can use the start function for running main functions (Yay!). But like the discussion in WebAssembly/WASI#19, the inner core module will still need to export its linear memory and have a cyclic linking relationship with the Canonical ABI, so we won't be able to use the wasm start function in the core module.

So we'll need the Canonical ABI to define a core-module exported function that is called at the logical time when the component start function is called. The call will happen after the core module is initialized and its exports are available.

We'll need to pick a name for this function, and the main task there is to simply pick something nicer than _start 😉 .

@alexcrichton
Copy link
Member

I'm going to close this for the same reasons as I mentioned in #263 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants