Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

il2al: host function rules become two independent conditionals and ignore the new store `s'`

Abierto
#2,279 6 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
ocaml, wasm
Área
compilers

Línea de trabajo

The two host-function rules are in spectec/specification/wasm-3.0/4.3-execution.instructions.spectec around lines 184-198. The translation that emits Either only for condition-free rules is in spectec/src/il2al/translate.ml near line 1155, so start there and compare with how memory.grow is handled. Done means the RES and BOT cases become mutually exclusive alternatives, and the store s' from the RES case is applied, as checked by the --prose output.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I came across this while looking at how il2al uses Either for nondeterminism.

The rules Step/call_ref-hostfunc-res and -div (added in #2210) can both apply:

https://github.com/WebAssembly/spec/blob/8d6a3afa965a28e145110445101338bed947991b/specification/wasm-3.0/4.3-execution.instructions.spectec#L184-L198

--prose gives:

13. If an element of $hostcall((_HOSTFUNC hf), s, val^n) is some RES, then:
  a. Let (RES s' result) be an element of $hostcall((_HOSTFUNC hf), s, val^n).
  b. Execute the sequence $lift_result(result).
14. If BOT is contained in $hostcall((_HOSTFUNC hf), s, val^n), then:
  ...
  1. Steps 13 and 14 are not alternatives, so when both apply the algorithm does both.
  2. s' is never used, so the store is not updated.

I would expect something like this, as for memory.grow (not sure how AL should update the whole store):

13. Either:
  a. Let (RES s' result) be an element of $hostcall((_HOSTFUNC hf), s, val^n).
  b. Update the store s to s'.
  c. Execute the sequence $lift_result(result).
14. Or:
  ...

It seems il2al produces Either only for rules without conditions (translate.ml#L1155).

Note: This might be low priority since neither the document nor the reference interpreter uses this algorithm.

Lenguaje dominante
WebAssembly
Estrellas
3.5k
Forks
540
Merge medio
1 d 6 h
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WebAssembly/spec

Todos los issues de WebAssembly/spec

Issues similares

Más issues de Compilers

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.