Disallow `[method]...` naming unless the resource was defined in the same context
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- wasm
- Área
- compilers
Línea de trabajo
Start with the two component examples in this issue and the linked wasm-tools issue #2731; then locate the wasmparser validation and tests that accept these patterns. The rule for when methods may be attached is unresolved, so done means defining that rule and updating validation and tests without breaking the existing wit-component pattern unintentionally.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Currently wasmparser accepts this component:
(component
(import "a" (instance $a
(export "r" (type (sub resource)))
))
(alias export $a "r" (type $r))
(import "b" (instance
(export "r" (type $x (eq $r)))
(export "[method]r.f" (func (param "self" (borrow $x))))
))
)
But arguably this is a bad idea. This isn't representable in WIT at all and there aren't any actual users of this AFAIK, so I think it would be best to disallow this. In essence only the resource definition should be able to attach methods, because otherwise you could have different instances define the same method and it'd be ambiguous of what to call.
More problematically, however, wasmparser also accepts this:
(component
(type (component
(import "a" (type $a (sub resource)))
(export "r" (type $x (eq $a)))
(export "[method]r.f" (func (param "self" (borrow $x))))
))
)
and this is how wit-component works for any component which exports a resource in an interface. This means that this pattern is widely used meaning that the rule of "must be on the definition" would break a lot of components today.
Ideally wit-component would generate a component that looks like htis:
(component
(type (component
(import "a" (type $a (sub resource)))
(export "r" (type $x (eq $a)) (type (sub resource))) ;; note the type ascription here
(export "[method]r.f" (func (param "self" (borrow $x))))
))
)
but wasmparser does not yet implement that today (https://github.com/bytecodealliance/wasm-tools/issues/2731)
I'm also a bit stuck on what "must be next to the definition" means. For example a resource could be declared, then exported, and then methods must be on the type introduced by the export. In that sense some aliases work, but some don't. Hence, the issue here!
- Lenguaje dominante
- WebAssembly
- Estrellas
- 1.4k
- Forks
- 134
- Merge medio
- 3 d 19 h
- PR fusionados (30 d)
- 8
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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/component-model
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
WebAssembly/component-model#609 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 4 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
WebAssembly/component-model#769 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
`use` for `implements` interfaceAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
WebAssembly/component-model#768 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
WebAssembly/component-model#753 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 4 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
WebAssembly/component-model#752 · 13 comentarios · 1 reacción ·
Los mantenedores suelen responder en 4 días
Todos los issues de WebAssembly/component-model
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