https://github.com/mattn/gowasmer
WebAssembly runtime for wasmer-go
https://github.com/mattn/gowasmer
Last synced: 9 months ago
JSON representation
WebAssembly runtime for wasmer-go
- Host: GitHub
- URL: https://github.com/mattn/gowasmer
- Owner: mattn
- License: mit
- Created: 2021-07-20T09:22:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-18T07:04:18.000Z (over 3 years ago)
- Last Synced: 2025-03-27T17:23:05.335Z (10 months ago)
- Language: Go
- Homepage:
- Size: 1.54 MB
- Stars: 112
- Watchers: 5
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gowasmer

When compiling Go to WebAssembly, the Go compiler assumes the
WebAssembly is going to run in a JavaScript environment. Hence a
`wasm_exec.js` file is provided by the Go compiler and must be
used. However, WebAssembly can actually run everywhere. So we need to
use some hacks to make WebAssembly modules generated by the Go
compiler runnable everywhere. And that's where `gowasmer` is useful.
`gowasmer` is a port of the `wasm_exec.js` file, for Go. It assumes
the WebAssembly runtime is
[`wasmer-go`](https://github.com/wasmerio/wasmer-go/).
Alternatively, to avoid using `gowasmer`, you can compile your Go
program to WebAssembly with [TinyGo](https://tinygo.org/) as follows:
```sh
$ tinygo build -o module.wasm -target wasi .
```
## Usage
See `_example` directory.
## Installation
```
$ go get github.com/mattn/gowasmer
```
## License
MIT
## Author
Yasuhiro Matsumoto (a.k.a. mattn)