-
Notifications
You must be signed in to change notification settings - Fork 219
Go: ergonomics improvement for types, function and package name #626
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
Comments
Some thoughts on this, from discussions at Wasmcon, and my work on the Go bindings generator: Worlds vs InterfacesWe need to clarify if a Go program will presume an entire WASI world, or can link to individual packages or interfaces. For example, will a Go program require the host implement the NamesAs @Mossaka and others have pointed out, the current names generated by
Therefore the type Second, I think it makes sense to introduce a mapping of WASI names to Go names. This could be specified as command-line arguments to the Go code generator, or loaded from a config file. For example:
Package path mapping would allow generated code to be placed in an Stdlib@achille-roussel pointed out that the requirements for codegen in the Go stdlib may differ materially, such as the number and names of generated Go packages, and how to make tradeoffs between simple vs clever or idiomatic vs performant. |
Follow up to previous comment, we now have working Go bindings generated from WIT: https://pkg.go.dev/github.com/ydnar/wasm-tools-go/wasi
wit-bindgen-go generate ./path/to/wasi-cli/wit # if wasm-tools is in path Or: wasm-tools component wit -j ./path/to/wasi-cli/wit | wit-bindgen-go generate These are currently being used in a |
Closing this issue since we have deprecated the TinyGo bindgen in this repo (#1194) and moved to a new implementation at bytecodealliance/go-modules |
This issue is created for a discussion on improving how types, function and package named in the Go bindgen.
To see how the current names is generated, please read the head of this #612 (comment).
A summary of what's being proposed: #612 (comment)
The text was updated successfully, but these errors were encountered: