Wasm/ESM integration and additional start/main functions
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, wasm
调研方向
Start by reviewing the Wasm/ESM integration MVP semantics and the linked WebAssembly design issue, Node.js WASI change, and command-style program discussion. Compare initialization patterns across Wasm toolchains and host environments, including the start and _start functions and exported memory. Done means a documented design for whether and how a custom section can standardize these behaviors.
由索引模型根据 Issue 内容生成。
描述
When starting up a Wasm module or application, it's often not enough to call the Wasm start function. Often, there's some kind of external code driving it, maybe generated by the toolchain or otherwise present in the host environment.
One idea from https://github.com/WebAssembly/design/issues/1160 to reduce the need for this sort of "driver" code was to make Wasm/ESM integration call a secondary "_start" function, after the exports are initialized, to permit the driver module to have the Wasm exports before functions that it exports to Wasm are run. However, there are some cases which don't quite meet this model:
- Before calling the WASI
_startfunction, the exported memory could be passed into WASI https://github.com/nodejs/node/pull/27850/files#diff-ab9c666b48467c7030bd93aac6d06eb2R184 - For command-style programs, we may want to have a difference between running a command and using it https://github.com/WebAssembly/esm-integration/issues/30
I suspect, if we examine more systems, we'll find more kinds of mismatches or subtle cases where more behavior is needed.
The goal for this issue is to compile patterns from various Wasm toolchains and environments, and see what would make sense to standardize. This standard initialization behavior could be used both in JS and outside of JS environments, in common between the two.
I'd like to see if we can coalesce on the design of a new custom section to declaratively specify this initialization behavior. I think it will make sense to do on top of the basic Wasm module semantics, with the start function being invoked atomically with module initialization before exports are made available, as explained by @rossberg.
I think the MVP Wasm/ESM integration semantics make sense as is, and any further behavior will be a v2 that layers on top. If you disagree, I'd love to understand better why in this thread, so we can make it clear to potential implementers of Wasm/ESM integration whether this is stable.
cc @lukewagner @guybedford @xtuc
- 主要语言
- WebAssembly
- 星标
- 458
- 派生
- 40
- 平均合并
- 10 天 37 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WebAssembly/esm-integration 的其他 Issue
-
难度 5/5 一周以上 新手友好度 30/100
WebAssembly/esm-integration#122 ·
-
Supporting WebAssembly.JSTag import可能已有人在做 @guybedford 于 190 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
WebAssembly/esm-integration#120 ·
-
难度 5/5 一周以上 新手友好度 35/100
WebAssembly/esm-integration#119 ·
-
难度 5/5 一周以上 新手友好度 25/100
WebAssembly/esm-integration#118 · 10 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
WebAssembly/esm-integration#112 · 9 条评论 ·
查看 WebAssembly/esm-integration 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
DAE2 crashes on call.without.effects with a non ref.func expression可能已有人在做 @stevenfontanella 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
WebAssembly/binaryen#9404 ·
维护者通常 1 天内回复
-
area:compiler effort:S impact:med platform:windows type:bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
area:Analysis enhancement
难度 1/5 1-3 小时 新手友好度 69/100
facebookresearch/atlas-lean#5118 ·
维护者通常 1 天内回复
-
C-bugfix
难度 2/5 1-3 小时 新手友好度 82/100
Quantinuum/hugr#3354 ·
维护者通常 1 天内回复