Skip to content

Another wasm interpreter engine for gophers based on pure golang

License

Notifications You must be signed in to change notification settings

orsinium-forks/wasman

 
 

Repository files navigation

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

About

Another wasm interpreter engine for gophers based on pure golang

Resources

License

Stars

Watchers

Forks

Languages

  • Go 100.0%