bytecodealliance / bytecodealliance/wit-bindgen
Prototyping handles and resources using a bindings-based implementation
- Vorherrschende Sprache
- Rust
- Sterne
- 1.5k
- Forks
- 286
- Ø Merge
- 6 Std. 32 Min.
- Gemergte PRs (30 T.)
- 19
Beschreibung
As a way to enable more experimentation with the developer-facing side of resources, I propose we add support for parsing `resource` declarations and simple `handle` types, and implement them in bindings by lowering them into code similar to what we currently write by hand and call "pseudo-resources": plain `u32` indices, which index into an implied per-store table.
Pseudo-resources don't provide cross-component isolation, and have other limitations, so they are only a temporary measure, but they are enough to open up some important developer ergonomics improvements, such as support for method-calling syntax (eg. `thing.action()` instead of `action(thing)`), greater type safety and IDE guidance, automatic destructors, structured documentation, and communication of API intent.
Even though the pseudo-resource technique itself is temporary, some of this work, such as the parsing and AST, and wit-using code that can be built on top of this, should be migratable to full resources when the pieces are in place for that.
If anyone has thoughts or questions about this, please ask! For anyone interested in working in this area, for now, please reach out to me, so we can coordinate efforts. Especially as we get into the guest-side bindings part of this, there are likely to be several parallelizable tasks.
@silesmo
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Das Issue nennt keine Dateien, Tests oder Einstiegspunkte. Beginne damit, den Umfang mit dem Autor des Issues zu besprechen, bevor du Ressourcendeklarationen, einfaches Handle-Parsing, AST-Unterstützung und das Lowering von Bindings untersuchst; abgeschlossen wäre die Aufgabe erst mit einem vereinbarten Implementierungsplan und koordinierter Arbeit über die relevanten Bindings-Aufgaben hinweg.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, wasm
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100