Since Web Assembly's text format is close to Lisp, maybe an attempt to a REPL prompt is in order!
Demo:
- This REPL is not strictly built according to Wasm spec. Some rules are relaxed to make it easy to use within a REPL prompt. For example, the prompt acts as the inside of a Wasm
func
, so you can do, say an(i32.const 12)
. However, unlike the inside of a Wasmfunc
, you can also define a newfunc
on the prompt. - We don’t have full coverage of all features of Wasm yet. What is covered is documented here. If you would like to see a particular feature implemented, please feel free to open an issue. Or a PR.
To install, follow the below command,
$ cargo install wasmrepl
To check if installation is complete,
$ wasmrepl
>>
It should give you the REPL prompt. To exit the prompt, use Ctrl+D.
Some examples on how to use this is added in the blog post here.