Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanaka/warpy
WebAssembly interpreter in RPython
https://github.com/kanaka/warpy
interpreter jit python rpython wasm wast webassembly
Last synced: about 2 months ago
JSON representation
WebAssembly interpreter in RPython
- Host: GitHub
- URL: https://github.com/kanaka/warpy
- Owner: kanaka
- License: other
- Created: 2017-03-17T17:37:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T02:43:06.000Z (over 5 years ago)
- Last Synced: 2024-10-14T20:55:21.454Z (about 2 months ago)
- Topics: interpreter, jit, python, rpython, wasm, wast, webassembly
- Language: Python
- Size: 200 KB
- Stars: 65
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awe-wasm - Warpy - activity/m/kanaka/warpy) ![Language](https://img.shields.io/github/languages/top/kanaka/warpy) (Runtimes / **Python**)
README
# 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](https://github.com/WebAssembly/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)