Closed as not planned
Description
The goal of this proposal is to add a new directive, called go:wasmexport
, in a similar fashion to the go:wasmimport
directive proposed in #38248. This proposal is a first step towards #25612 and #41715.
With this directive a user can export a function, so the engine that runs the module can invoke it:
//go:wasmexport hello_world
func helloWorld() {
println("Hello world!")
}
(master)⚡ % wasm-nm -e sample/main.wasm
e run
e resume
e getsp
e hello_world
In this proposal I won't modify the actual Golang ABI. In fact, thanks to this feature, users will be able to define their own extensions to the existing ABI. This is already supported by tinygo too https://tinygo.org/webassembly/webassembly/
Like #38248, The go:wasmexport directive will not be covered by Go's compatibility promise as long as the wasm architecture itself is not considered stable.
Metadata
Assignees
Labels
Type
Projects
Status
Hold