18 releases

0.3.2 Sep 13, 2024
0.3.1 Sep 13, 2024
0.2.14 Sep 5, 2024
0.2.9 Aug 2, 2024
0.0.0 Dec 10, 2022

#32 in WebAssembly

Download history 401/week @ 2024-07-23 522/week @ 2024-07-30 7/week @ 2024-08-06 659/week @ 2024-09-03 255/week @ 2024-09-10 61/week @ 2024-09-17 58/week @ 2024-09-24 70/week @ 2024-10-01

1,157 downloads per month

Apache-2.0 WITH LLVM-exception

220KB
5K SLoC

weval

weval Wasm partial evaluator

A Bytecode Alliance project

build status zulip chat Documentation Status

Contributing | Chat

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

  • Bump the version in Cargo.toml and cargo check to ensure Cargo.lock is updated as well.

  • Bump the tag version (TAG constant) in npm/weval/index.js.

  • Bump the npm package version in npm/weval/package.json.

  • Run npm i in npm/weval/ to ensure the package-lock.json file is updated.

  • Commit all of this as a "version bump" PR.

  • Push it to main and ensure CI completes successfully.

  • Tag as v0.x.y and push that tag.

  • cargo publish from the root.

  • npm publish from npm/weval/.

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!

Dependencies

~53MB
~1M SLoC