Giter Site home page Giter Site logo

warpy's Introduction

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)

warpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

warpy's Issues

Change `wast` to `wat` in README.md

From README.md

Compile a wasm module:
wast2wasm test/addTwo.wast -o test/addTwo.wasm

I found no wast file in test folder. They are wat files.

Also, the tool name is wat2wasm, not wast2wasm

Thanks!

Extending warpy to allow for full state dump

I'm interested in building a WebAssembly interpreter that supports not only dumping the memory, globals and tables, but the full stack state as well. Do you think it is sensible to build on your project to achieve this?

The overhead may wipe out some JIT advantages, but as long as its not worse than a 10x slowdown, I'm fine with that.

Edit: Oh, I see warpy already has tracing built in! Sweet!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.