Skip to content

kanaka/warpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 16, 2019
fc4ec9a · Apr 16, 2019

History

37 Commits
Apr 15, 2019
Jan 11, 2019
Mar 23, 2017
May 14, 2018
May 14, 2018
Mar 18, 2017
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Mar 21, 2017
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Apr 16, 2019

Repository files navigation

warpy - WebAssembly in RPython

A WebAssembly interpreter written in RPython.

Warpy supports the WebAssembly MVP (minimum viable product) version of the spec.

Prerequisites

Build whe warpy executable. You will need a build of rpython on the path:

make warpy-jit   # or make warpy-nojit

Alternatively, you can use an rypthon docker container (built from Dockerfile-rpython) and do the compilation from there:

docker pull kanaka/warpy-rpython
docker run -it kanaka/warpy-rpython -v `pwd`:/build -w /build make warpy-jit

You will need wast2wasm to compile wast source to wasm bytecode. Check-out and build wabt (wabbit):

git clone --recursive https://github.com/WebAssembly/wabt
make -C wabt gcc-release

Usage

Compile a wasm module:

wast2wasm test/addTwo.wast -o test/addTwo.wasm

Load and call a function in a wasm module:

./warpy-jit test/addTwo.wasm addTwo 11 12

You can also use standard python (but it's much slower of course):

python warpy.py test/addTwo.wasm addTwo 13 14

There is also a REPL mode that allow you to interactively invoke functions within a module:

./warpy-jit --repl test/addTwo.wasm
webassembly> addTwo 2 3

Misc

Some rough notes for running the WebAssembly specification tests can be found in notes\_testing.

License

MPL-2.0 (see LICENSE)