w2c2
Translates WebAssembly modules to C. Inspired by wabt's wasm2c.
Features
- Implements the WebAssembly Core Specification 1.0
- Passes 99.9% of the WebAssembly core semantics test suite
- Written in C89 and generates C89
- Support for older operating systems and architectures
- Support for big-endian systems
- Streaming compilation, low memory usage
Performance
- Coremark 1.0: ~7% slower than native
Usage
make release
./w2c2 <module.wasm> > <module.c>
Examples
Coremark:
cd examples/coremark
./coremark
Testing
Requires Python 3 and wabt (for wast2json).
cd tests
make gen
make run-tests