You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-52Lines changed: 7 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -318,65 +318,20 @@ e.g. Java, Kotlin, Clojure, Scala, etc.
318
318
319
319
### Guest: TinyGo
320
320
321
-
You can compile Go code into a Wasm module using the [TinyGo](https://tinygo.org/) compiler. For example, the following command compiles `main.go` to a WASI module:
321
+
The **new** TinyGo WIT bindings generator is currently in development at the
> Note: the current TinyGo `bindgen` requires TinyGo version v0.27.0 or later.
326
-
327
-
When using `wit-bindgen tiny-go` bindgen, `*.go` and `*.h` C header file are generated for your project. These files are generated with the [`wit-bindgen` CLI command][cli-install] in this repository.
324
+
To install the `wit-bindgen-go` CLI, run:
328
325
329
326
```sh
330
-
wit-bindgen tiny-go ./wit
331
-
# Generating "host.go"
332
-
# Generating "host.c"
333
-
# Generating "host.h"
334
-
# Generating "host_component_type.o"
335
-
```
336
-
337
-
If your Go code uses `result` or `option` type, an additional Go file `host_types.go` will be generated. This file contains the Go types that correspond to the `result` and `option` types in the WIT file.
338
-
339
-
An example of using the generated Go code would look like:
go install github.com/bytecodealliance/wasm-tools-go/cmd/wit-bindgen-go
370
328
```
329
+
> Note: it requires `wasm-tools` to be installed.
371
330
372
-
This setup allows you to invoke `go generate`, which generates the bindings for the Go code into an `api` directory. Afterward, you can compile your Go code into a WASI module using the TinyGo compiler. Lastly you can componentize the module using `wasm-tools`:
331
+
Then, you can generatethe bindings for your project:
0 commit comments