-
Notifications
You must be signed in to change notification settings - Fork 503
Description
There has been ongoing confusion about the role of the Wasm start function, what it can do, and how it is different from the exported _start or *start* function convention used in some environments -- see e.g. WebAssembly/design#1160 and links from that discussion. In the 2019/09/17 meeting, the CG hence voted in favour of renaming the notion of start function.
This is almost entirely an editorial change to the spec, except for a corresponding adjustment of the text format (see below).
I propose to rename it to "initialization function" (or "init function" for short); accordingly, the respective section in the binary format would then be called the "init section". That better fits its ability to run initialisation code for a module's state that is guaranteed to be executed before the module becomes available (similar to a class constructor in OO). It also corresponds closely to the notion of init sections in other binary formats.
For the text format, we will then want to allow using the keyword init instead of start to declare this function. There are three options for this change and what to do with the original syntax:
- Remove the
startkeyword immediately, requiring existing code to be adjusted. - Deprecate the
startkeyword, but keep it for a while until existing code has been adapted. - Keep
startindefinitely as a synonym for backwards compatibility.
Note that the start keyword is one of the more exotic features of the Wasm text format, and probably not used a lot outside test code.
Thoughts?