Should type imports be restricted to defined types and resources

Offen
#769 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Aktiv
Tech-Stack
wasm
Bereich
compilers

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
WebAssembly
Sterne
1.4k
Forks
134
Ø Merge
3 T. 19 Std.
Gemergte PRs (30 T.)
8

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus WebAssembly/component-model

Alle Issues in WebAssembly/component-model

Ähnliche Issues

Weitere Issues zu Compilers

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.