fxamacker / w2c2

Translates WebAssembly modules to C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Translates WebAssembly modules to C

License:MIT License


Languages

Language:WebAssembly 89.0%Language:C 10.7%Language:Python 0.2%Language:Makefile 0.1%