bytecodealliance / bytecodealliance/go-modules

Discussion: Strategy to remove shell-exec from compilation path

Open
#202 5 comments 0 reactions 1 assignee Claimed by @ydnar View on GitHub
Dominant language
Go
Stars
148
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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](https://component-model.bytecodealliance.org/language-support/go.html).

# 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:
- How do we keep up with wit spec?
- In what sequence we'd create these packages?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.