https://github.com/bytecodealliance/weval
the WebAssembly partial evaluator
https://github.com/bytecodealliance/weval
Last synced: 7 months ago
JSON representation
the WebAssembly partial evaluator
- Host: GitHub
- URL: https://github.com/bytecodealliance/weval
- Owner: bytecodealliance
- License: apache-2.0
- Created: 2024-08-30T19:47:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-08T07:36:00.000Z (7 months ago)
- Last Synced: 2025-07-12T00:44:57.132Z (7 months ago)
- Language: Rust
- Homepage:
- Size: 2.25 MB
- Stars: 76
- Watchers: 10
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
`weval` partially evaluates WebAssembly snapshots to turn interpreters into
compilers (see [Futamura
projection](https://en.wikipedia.org/wiki/Partial_evaluation#Futamura_projections)
for more).
`weval` binaries are available via releases on this repo or via an [npm
package](https://www.npmjs.com/package/@cfallin/weval).
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](https://cfallin.org/blog/2024/08/28/weval/), 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](https://spidermonkey.dev) interpreter, providing
3-5x speedups over the generic interpreter. Please let us know if you use it
elsewhere!