Resolve builtins transitively

Đang mở
#15,086 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@dyslexicsteak đang làm issue này rồi.

Từ ngày 30/10/2026.

  • #15087 của @dyslexicsteak — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust, wasm
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
18.8k
Fork
1.9k
Merge trung bình
22 giờ 54 phút
Pull request đã merge (30 ngày)
371

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bytecodealliance/wasmtime

Tất cả issue của bytecodealliance/wasmtime

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.