Resolve builtins transitively

Abierto
#15,086 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@dyslexicsteak ya está trabajando en esto.

Desde el 30/10/2026.

  • #15087 de @dyslexicsteak — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
20/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
rust, wasm
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
18.8k
Forks
1.9k
Merge medio
22 h 5 min
PR fusionados (30 d)
375

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bytecodealliance/wasmtime

Todos los issues de bytecodealliance/wasmtime

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.