Resolve builtins transitively

Aperta
#15,086 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@dyslexicsteak ci sta già lavorando.

Dal 30/10/2026.

  • #15087 di @dyslexicsteak — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rust, wasm
Ambito
backend

Direzione di ricerca

Start at the main-instance composition entry point and trace how builtin imports are discovered and instantiated. Check how existing cycle errors are reported; the issue specifies depth-first traversal in declaration order, reuse of each builtin instance, and a cycle path in errors. Done means transitive builtins are shared among importers while non-builtin imports remain imports of the result; linked PR #15087 indicates work is already underway.

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

Descrizione

Feature

Allow transitive inclusion of compile-time builtins into composition graphs.

Benefit

As it stands, builtins are only composed in if a guest directly imports them. For example, in the case of layering higher-level builtins atop lower-level ones, the guest is forced to manually import all layers. After this change the guest only needs to import its direct dependencies, closing the abstraction leak.

Implementation

Starting at the main instance, walk depth-first in declaration order and discover builtins, instantiating as we go and reusing instances already created. A stack holding builtins currently being instantiated (i.e. having their imports resolved) is used to reject repeated names which result from cyclic imports. The stack from the repeated name onwards is the cycle path used for error reporting.

By instantiating each builtin once and sharing them among their importers, stateful builtins behave correctly and all importers observe the same state.

Imports that aren't builtins, including the unsafe intrinsics, are left alone and remain imports of the result, as they do now.

Alternatives

Leave it as-is; guests must explicitly name all builtins they use.

Lingua principale
Rust
Stelle
18.8k
Fork
1.9k
Merge medio
22h 54m
PR unite (30g)
371

Preparare l'ambiente

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 bytecodealliance/wasmtime

Tutte le issue di bytecodealliance/wasmtime

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.