Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.43 KB

README.md

File metadata and controls

66 lines (47 loc) · 1.43 KB

WASMan (WebAssembly Manager)

Go Report Card CI

Another wasm interpreter engine for gophers.

Usage

Executable

Install

go install github.com/c0mm4nd/wasman/cmd/wasman
$ wasman -h
Usage of ./wasman:
  -extern-files string
        external modules files
  -func string
        main func (default "main")
  -main string
        main module (default "module.wasm")
  -max-toll uint
        the maximum toll in simple toll station

Example: numeric.wasm

$ wasman -main numeric.wasm -func fib 20 # calc the fibonacci number
{
  type: i32
  result: 6765
  toll: 315822
}

If we limit the max toll, it will panic when overflow.

$ wasman -main numeric.wasm -max-toll 300000 -func fib 20
panic: toll overflow

goroutine 1 [running]:
main.main()
        /home/ubuntu/Desktop/wasman/cmd/wasman/main.go:85 +0x87d

Go Embedding

PkgGoDev

Example

Look for examples?

They are in examples folder

TODOs

  • add more complex examples