Wasm/ESM integration and additional start/main functions
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, wasm
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- WebAssembly
- Estrellas
- 458
- Forks
- 40
- Merge medio
- 10 d 37 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de WebAssembly/esm-integration
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
WebAssembly/esm-integration#122 ·
-
Supporting WebAssembly.JSTag importPosiblemente ocupada @guybedford la tomó hace 190 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
WebAssembly/esm-integration#120 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
WebAssembly/esm-integration#119 ·
-
String Constants BikeshedAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
WebAssembly/esm-integration#118 · 10 comentarios ·
-
Worker imports & memory sharingAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
WebAssembly/esm-integration#112 · 9 comentarios ·
Todos los issues de WebAssembly/esm-integration
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
DAE2 crashes on call.without.effects with a non ref.func expressionPosiblemente ocupada @stevenfontanella la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
WebAssembly/binaryen#9404 ·
Los mantenedores suelen responder en 1 día
-
area:compiler effort:S impact:med platform:windows type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
area:Analysis enhancement
Dificultad 1/5 1-3 horas Aptitud para principiantes 69/100
facebookresearch/atlas-lean#5118 ·
Los mantenedores suelen responder en 1 día
-
C-bugfix
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Quantinuum/hugr#3354 ·
Los mantenedores suelen responder en 1 día