Home

Awesome

<div align="center"> <h1>weval</h1> <p> <strong>weval Wasm partial evaluator</strong> </p>

<strong>A <a href="https://bytecodealliance.org/">Bytecode Alliance</a> project</strong>

<p> <a href="https://github.com/bytecodealliance/weval/actions?query=workflow%3ACI"><img src="https://github.com/bytecodealliance/weval/workflows/CI/badge.svg" alt="build status" /></a> <a href="https://bytecodealliance.zulipchat.com/#narrow/stream/223391-wasm"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="zulip chat" /></a> <a href="https://docs.rs/weval"><img src="https://docs.rs/weval/badge.svg" alt="Documentation Status" /></a> </p> <h3> <a href="https://github.com/bytecodealliance/weval/blob/main/CONTRIBUTING.md">Contributing</a> <span> | </span> <a href="https://bytecodealliance.zulipchat.com/#narrow/stream/223391-wasm">Chat</a> </h3> </div>

weval partially evaluates WebAssembly snapshots to turn interpreters into compilers (see Futamura projection for more).

weval binaries are available via releases on this repo or via an npm package.

Usage of weval is like:

$ weval weval -w -i program.wasm -o wevaled.wasm

which runs Wizer on program.wasm to obtain a snapshot, then processes any weval requests (function specialization requests) in the resulting heap image, appending the specialized functions and filling in function pointers in wevaled.wasm.

See the API in include/weval.h for more.

Releasing Checklist

Further Details

The theory behind weval is described in the author's blog post here, covering partial evaluation and Futumura projections as well as how weval's main transform works.

Uses

weval is in use to provide ahead-of-time compilation of JavaScript by wevaling a build of the SpiderMonkey interpreter, providing 3-5x speedups over the generic interpreter. Please let us know if you use it elsewhere!