3

GitHub - turbolent/w2c2: Translates WebAssembly modules to C

 2 years ago
source link: https://github.com/turbolent/w2c2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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 Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK