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.
-
Bump the version in
Cargo.tomlandcargo checkto ensureCargo.lockis updated as well. -
Bump the tag version (
TAGconstant) innpm/weval/index.js. -
Bump the npm package version in
npm/weval/package.json. -
Run
npm iinnpm/weval/to ensure thepackage-lock.jsonfile is updated. -
Commit all of this as a "version bump" PR.
-
Push it to
mainand ensure CI completes successfully. -
Tag as
v0.x.yand push that tag. -
cargo publishfrom the root. -
npm publishfromnpm/weval/.
The theory behind weval is described in the author's blog post here, covering partial evaluation and Futamura projections as well as how weval's main transform works.
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!