Skip to content

kanaka/warpy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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)