Adding core module “build targets” for WIT
June 13, 2024
WASI SG
Motivation
Idea
parse+resolve
(component� (import “wasi:filesystem/types” (instance …))
…
)
(module� (import “wasi:filesystem/types” “descriptor.read”� (func (param i32 i64 i64 i32))
…
)
Canonical ABI
<:
<:
wasi-sdk --target=wasm32-wasip2-module ☃
wasi-sdk --target=wasm32-wasip2-component ☃
.c
.c
.c
clang
.o.wasm
.o.wasm
.o.wasm
core�module
wasm-ld
component
wasm-�component-ld
wasm-tools�component�new
^^ both official Preview 2 “targets”
or: GOOS=wasip2 -buildmode=module|component ☃
Access to full component-model feature set:
Easy to add to existing core wasm engines�or if you don’t benefit from components
package wasi:cli;
world command {
import wasi:filesystem/types;
…
}
component�runtime
supports
core-only�runtime
supports
(basic plan since day 1)
Can add additional module build targets�(e.g. wasm64-wasip2-module)
What about…
Next steps