Should type imports be restricted to defined types and resources

未關閉
#769 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 4 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
活躍
技術堆疊
wasm
領域
compilers

研究方向

Read the issue's component text examples and the tests added in wasm-tools PR 2833. Decide whether imports of instance, component, and function types should be allowed, and clarify the intended rules for type imports, including the exported-type example. Done means the specification has a clear decision and corresponding behavior is agreed upon.

由索引模型根據 Issue 內容生成。

描述

It turns out that wasmparser as a slew of minor issues related to handling type imports of instance, component, and function types. For example:

(component 
    (type $f (func))
    (import "f" (type (eq $f)))
)

One example is that wasmparser rejects, likely erroneously, this currently:

(component
  (type $f (func))
  (export "f" (type $f))
  (import "g" (type (eq $f)))
)

Another example is tests added in https://github.com/bytecodealliance/wasm-tools/pull/2833 as well.

Overall I'm not aware of an actual use case of this. Resources make sense, and defined types make sense for bindings generation, but I'm not sure importing other kinds of types has much of a use case beyond "let's fill out the full matrix". I wanted to raise this as a very-not-urgent issue as a result in case others had thoughts on this.

主要語言
WebAssembly
星號
1.4k
分支
134
平均合併
3 天 19 小時
30 天內合併 PR
8

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

WebAssembly/component-model 的其他 Issue

查看 WebAssembly/component-model 的全部 Issue

相似的 Issue

更多 Compilers Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。