Repository navigation
Define a start method - #495
Conversation
|
IIUC this isn't the same thing as what @lukewagner suggested in #398 (comment) ? |
|
Yes exactly, he asked me to do a PR, so here it is: #398 (comment) |
|
lgtm, thanks! |
|
I expected something more concrete, mentioning |
|
Added an example for JF |
There was a problem hiding this comment.
Could you explain what this would do?
|
lgtm with small explanation. Thanks! |
As spec'd in: WebAssembly/design#495 And discussed in: WebAssembly/spec#231 This will make it simpler and more uniform to add a start entry point. s2wasm is the right place to add start because it'll eventually need to do other basic setup, e.g. put code in start to setup the stack, as dschuff is doing in: #179 Or rather, the linker is the right place and s2wasm happens to act as our linker right now.
As spec'd in: WebAssembly/design#495 And discussed in: WebAssembly/spec#231 This will make it simpler and more uniform to add a start entry point. s2wasm is the right place to add start because it'll eventually need to do other basic setup, e.g. put code in start to setup the stack, as dschuff is doing in: #179 Or rather, the linker is the right place and s2wasm happens to act as our linker right now.
|
We've started some discussion about how this should integrate with emscripten in emscripten-core/emscripten#4218 It's not really clear from the current text in the design repo how it should work with the web embedding. e.g. when you instantiate the module, is the VM expected to call the start function automatically (if so, when? before I think it should be put under the control of the JS code. For example (as a strawman) the instance object returned by |
|
oh oops, I meant to post this in #398, not in this PR. |
Adding the definition of a start method that would be a top-level module statement.