wasm.go
wasm.go copied to clipboard
An experimental Wasm implementation written in Go.
wasm.go
An experimental Wasm implementation written in Go.

Features
- binary
- types Go structs translated from Wasm binary format (as simple and direct as possible)
- decoder Wasm binary format decoder
- encoder Wasm binary format encoder
- validator Wasm binary format validator
- interpreter Wasm interpreter
- text (WIP) WAT & WAST compiler powered by ANTLR
- aot (WIP) AOT (Wasm binary -> Go plugin) compiler
- jit (WIP) JIT compiler using LLVM
Running "Hello, World!"
Interpreter mode:
$ git clone https://github.com/zxh0/wasm.go
$ cd wasm.go
$ go run github.com/zxh0/wasm.go/cmd/wasmgo hw.wat
AOT mode:
$ git clone https://github.com/zxh0/wasm.go
$ cd wasm.go
$ go run github.com/zxh0/wasm.go/cmd/wasmgo -aot hw.wat > hw.wasm.go
$ go build -buildmode=plugin -o hw.so hw.wasm.go
$ go run github.com/zxh0/wasm.go/cmd/wasmgo hw.so