bytecodealliance / bytecodealliance/go-modules

wit, wit/bindgen: support abstract "pointer" type, size, and alignment

Offen
#112 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
148
Forks
20
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

In order to support `wasm64`, with 64-bit wide pointers, we need to relax the constraint in the Component Model and Canonical ABI that pointer types fit in 32 bits.

Ideally the generated Go code for a component can handle pointer widths of either 32 or 64 bits without baking assumptions into the precise memory layout of structures into the lifting and lowering code.

### Tasks

- [ ] Reconcile this with proposed `wasm64` support in the Component Model spec.
- [ ] Introduce "integer pointer" type (e.g. `uintptr`) with size/alignment that varies based on arch. For instance, when flattening a `variant` type with a `string` or `list`, the flattened pointers resolve to a `uintptr` in Go.
- [ ] Thread this flexible width concept through the ABI, lifting, and lowering code in `wit` and `wit/bindgen`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den vorhandenen ABI-, Lifting- und Lowering-Code in wit und wit/bindgen zu überprüfen, und vergleiche anschließend seine Zeigerannahmen mit der vorgeschlagenen wasm64-Unterstützung in der Component Model-Spezifikation. Die Arbeit ist abgeschlossen, wenn ein Integer-Zeigertyp eine architekturabhängige Größe und Ausrichtung hat und generierter Go-Code sowohl 32-Bit- als auch 64-Bit-Zeigerbreiten ohne feste Layout-Annahmen unterstützt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go, wasm
Bereich
compilers, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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