bytecodealliance / bytecodealliance/wit-bindgen

[rust-macro] generate! should allow defering handling exports to dependent crates

Aperta
#674 2 commenti 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
1.5k
Fork
286
Merge medio
6h 32m
PR unite (30g)
19

Descrizione

See discussion here: https://bytecodealliance.zulipchat.com/#narrow/stream/327223-wit-bindgen/topic/external.20export.20implementations/near/387677837

I also want this feature. It kind of used to exist with the old export macro approach that was replaced when resource type support was added. You used to be able to have one library crate that called `generate!` and exported the "export" macro to any dependent crates who could then bind the exports of the world. When resource types were added the API changed to force the invoker of `generate!` to specify what interfaces it was exporting and implement them right then and there (at least that's my understanding).

As @alexcrichton mentioned wastime's `bindgen!` macro lets you do something like this already with more sophisticated macro parameters. Perhaps this approach could be applied here too.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Leggi prima la discussione collegata su Zulip, quindi confronta il comportamento di `generate!` di rust-macro descritto qui con la macro `bindgen!` di wastime. La funzionalità è completa quando un library crate può invocare `generate!` e i crate dipendenti possono rimandare la gestione degli exports e associare gli exports del mondo.

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

Valutazione

Stack tecnologico
rust, wasm
Ambito
developer-experience, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.