Should type imports be restricted to defined types and resources

Aperta
#769 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
wasm
Ambito
compilers

Direzione di ricerca

Read the issue's component text examples and the tests added in wasm-tools PR 2833. Decide whether imports of instance, component, and function types should be allowed, and clarify the intended rules for type imports, including the exported-type example. Done means the specification has a clear decision and corresponding behavior is agreed upon.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

It turns out that wasmparser as a slew of minor issues related to handling type imports of instance, component, and function types. For example:

(component 
    (type $f (func))
    (import "f" (type (eq $f)))
)

One example is that wasmparser rejects, likely erroneously, this currently:

(component
  (type $f (func))
  (export "f" (type $f))
  (import "g" (type (eq $f)))
)

Another example is tests added in https://github.com/bytecodealliance/wasm-tools/pull/2833 as well.

Overall I'm not aware of an actual use case of this. Resources make sense, and defined types make sense for bindings generation, but I'm not sure importing other kinds of types has much of a use case beyond "let's fill out the full matrix". I wanted to raise this as a very-not-urgent issue as a result in case others had thoughts on this.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebAssembly/component-model

Tutte le issue di WebAssembly/component-model

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.