This repo contains scripts and examples for testing certicoqwasm.
Note, that CertiCoq-Wasm is not necessary to run the benchmarks.
- CertiCoq with wasm backend: certicoqwasm.
- Node.js (version 22 or higher)
- python 3
- binaryen (version 117 or higher)
- Rust (e.g. 1.77)
- wasm-tools: installation
See here (outdated) and here for some performance comparisons.
In evaluation
, run:
./benchmark.py --engine=node --folder ./binaries/non-cps-primops-may-21-24 --wasm-opt --coalesce-locals
In evaluation
, run:
./benchmark.py --engine=wasmtime --folder ./binaries/non-cps-primops-may-21-24 --wasm-opt --coalesce-locals
In evaluation
, run:
./benchmark.py --engine=wasmtime-compile --folder ./binaries/non-cps-primops-may-21-24 --wasm-opt --coalesce-locals
Note, that wasmtime-compile is currently not supported. (Could be supported by removing the unused imports.)
Wasmtime requires the installation of wasmtime-py, version 18 or later.
pip install "wasmtime>=18.0.0"
- Create branch in main repo
benchmarks_<NAME>
- Create folder with name
<NAME>
in./evaluation/binaries/
, put binaries in it - Insert folder with short description in
./evaluation/benchmark.py
, possibly update program list - Then you can run the benchmark with e.g.
cd evaluation && ./benchmark.py --folder ./binaries/non-cps-primops-may-21-24 --wasm-opt --coalesce-locals
- Add the expected result in file in
./evaluation/results
- Run the
./evaluation/sanity-checks.py
script.
In evaluation/rust_to_wasm
, run:
./benchmark.py --folder ./binaries/unchecked_arith/
In evaluation/wasm_of_ocaml
, run:
TODO
In evaluation/c_to_wasm_emscripten
, run:
TODO
This compiles extracts a sha256 sum (taken from A.W. Appel) to wasm and runs it with Node.js.
Run make sha
, or make sha_explicit
.
In website_demo_sha256
, start dev-browser by:
make develop
The script wasm_to_coq.py
takes a given .wasm file and outputs a Coq file, importing the binary to WasmCert-Coq.