Disallow `[method]...` naming unless the resource was defined in the same context
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- wasm
- Ambito
- compilers
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- WebAssembly
- Stelle
- 1.4k
- Fork
- 134
- Merge medio
- 3g 19h
- PR unite (30g)
- 8
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/component-model
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
WebAssembly/component-model#609 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
WebAssembly/component-model#769 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
WebAssembly/component-model#768 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
WebAssembly/component-model#753 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
WebAssembly/component-model#752 · 13 commenti · 1 reazione ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di WebAssembly/component-model
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
DAE2 crashes on call.without.effects with a non ref.func expressionForse già presa @stevenfontanella l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WebAssembly/binaryen#9404 ·
I maintainer di solito rispondono entro 1 giorno
-
area:compiler effort:S impact:med platform:windows type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area:Analysis enhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 69/100
facebookresearch/atlas-lean#5118 ·
I maintainer di solito rispondono entro 1 giorno
-
C-bugfix
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Quantinuum/hugr#3354 ·
I maintainer di solito rispondono entro 1 giorno