bytecodealliance / component-docs

Documentation around creating and using WebAssembly Components
https://component-model.bytecodealliance.org/
Other
66 stars 41 forks source link

Language Guide: Add (tiny)go #37

Closed kate-goldenring closed 6 months ago

kate-goldenring commented 1 year ago

Add instructions for compiling go modules and componentizing them. For example:

tinygo build -target=wasi foo.go
wasm-tools component embed --world myworld ./foo.wit foo.wasm -o foo.embed.wasm
wasm-tools component new -o foo.component.wasm --adapt wasi_snapshot_preview1="$COMPONENT_ADAPTER" foo.embed.wasm

where the adapter is built from https://github.com/bytecodealliance/wasmtime/tree/main/crates/wasi-preview1-component-adapter

Mossaka commented 10 months ago

I can take a look

kate-goldenring commented 10 months ago

@Mossaka i started working on this here https://github.com/bytecodealliance/component-docs/pull/77. would you be willing to give it a review and if its really out of shape we can pivot