Resolve builtins transitively

オープン
#15,086 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@dyslexicsteak がすでに取り組んでいます。

2026年10月30日 から。

  • #15087 @dyslexicsteak による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust, wasm
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
18.8k
フォーク
1.9k
平均マージ
22時間 54分
マージ済み PR(30日)
371

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bytecodealliance/wasmtime のほかの issue

bytecodealliance/wasmtime の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。