Another wasm interpreter engine for gophers.
This is a substantially modified fork of https://github.com/c0mm4nd/wasman by way of https://github.com/orsinium-forks/wasman for the purpose of major bugfixing.
Install
go install github.com/hybridgroup/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
Look for examples?
They are in examples folder
- add more complex examples