-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: Strategy to remove shell-exec from compilation path #202
Comments
TinyGo, by design and convention, has depended on external tools to handle parts of compilation (LLVM, asyncify, wasm-ld, among others). Based on statements made by the Go team and by historical precedent, I (and others, I believe) assume that this strategy would not apply to mainline ("big") Go. The
|
we chatted about it during BA's meeting and no decisive actions other than researching what wasm-tools is actually doing under the hood and follow up next meeting. We identified a few options to pass down wit:
This is a 🔑 point. We touched briefly on the point wrt making TinyGo / BigGo emit wasm32 module and leave The interesting bit here is
The first incarnation of again, no decisions made but wanted to relay the discussion. |
I have WIT generation working with tree shaking in a branch, so we can emit minimal WIT files containing a single world to a world's Go package directory. wasm-tools-go is only a prerequisite for code generation, so it's not really required to compile and build a Go program. This is similar to other tools used by big Go projects like protoc or avo. |
TinyGo's current behavior is to handle module -> component conversion for
-target wasip2
.Where is shell exec today?
wit-bindgen-go
https://github.com/bytecodealliance/wasm-tools-go/blob/main/wit/load.go#L54
wit: parsing / world resolver
Uses wasm-tools to convert wit -> resolved world json.
The resulting json is converted into structs for codegen.
TinyGo
https://github.com/tinygo-org/tinygo/blob/release/builder/build.go#L864
wit: parsing / world resolver
wasm metadata: attach wit to wasm (
wasm-tools component embed
)wasm component encoder: convert wasm module to component (
wasm-tools component new
)Uses
wasm-tools
to adapt a wasm module to component.Discussion
Should TinyGo / Go generate core wasm modules and leave metadata/component encoding to 3rd party tools; or should they be part of a wasi target ( or goos/goarch combination )?
Assuming we implement wit parsing / wasm patching in Go:
The text was updated successfully, but these errors were encountered: