/Web49

Web49: WebAssembly Interpeter

Primary LanguageWebAssemblyMIT LicenseMIT

Web49

Web49 is a WebAssembly toolkit and interpreter.

Try the first release! v0.0.1

Web49 contains a few tools for working with WebAssembly.

  • interpreters
    • miniwasm
      • fast wasm interpreter
      • supports multiple wasm formats
        • wasm binary format: ~100% complete
        • wasm text format: ~95% complete
        • wasm spect test: ~75% complete
      • includes a custom WASI implementation
    • raywasm
      • wasm interpreter based on miniwasm
  • wasm binary tools rewrite
    • much simpler than WABT's tools
    • much smaller than Binaryen's tools
    • wat2wasm
      • convert wasm text into wasm binary
    • wasm2wat
      • generates nearly identical wat as binaryen or wabt
      • turn wasm binary into wasm text
      • supports all of wasm 1.0 and some extensions
    • wasm2wasm
      • shrink numbers in wasm files generated by llvm
        • saves 0-4 bytes per 32 bit number
        • saves 0-10 bytes per 64 bit number
      • round trip parse and reemit

Benchmarks

Benchmarks performed by wasm3 and Web49's miniwasm. Ran on an 2020 Macbook Air (M1 + 8GiB ram) using bench.py.

All Benchmarks compiled with: emcc -O2

One can also view results run on github actions One can run the benchmarks for themselves.

  • python3
    • with pip
  • emcc
  • wasm3
  • make
    • tested with GNUMake
    • works with BSDMake too
  • and a C compiler
    • gcc/clang/tcc works
    • msvc would work if someone rewrites two macros
      • #define NEXT() break
      • #define LABEL(X) case X:
      • probably a couple others
git clone https://github.com/fastvm/web49
cd web49
make CC=gcc # gcc is fastest in my tests
python3 -m pip install matplotlib
python3 bench.py