wasm.go icon indicating copy to clipboard operation
wasm.go copied to clipboard

An experimental Wasm implementation written in Go.

wasm.go

Build Status

An experimental Wasm implementation written in Go.

jaws

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