This repository contains the web demo for egglog, a e-graph library for equality saturation and term rewriting. The web demo allows users to interactively run and visualize egglog programs in the browser.
- Run egglog programs in your browser
- Visualize e-graphs and outputs interactively
- No server required—everything runs client-side via WebAssembly
-
Clone the repository (if you haven’t already):
git clone https://github.com/egraphs-good/egglog-demo.git cd egglog-demo
-
Install wasm-pack (if not already installed):
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
-
Build the WebAssembly package and copy static files:
make all
This will generate the necessary
.wasm
and JS files in thepkg/
directory and copy everything todist/
. -
Serve the static files:
You can use any static file server. For example, with Python:
cd dist python3 -m http.server 8080
Then open http://localhost:8080 in your browser.
src/
— Rust source code for the WebAssembly modulestatic/
— Static files for the web demo (HTML, JS, CSS)examples.py
— Script to bundle example.egg
files as JSON for the demoegglog-upstream/
— Local clone of the upstream egglog repo (ignored by git)
The web demo loads its example programs from the tests
directories of the upstream egglog. These are automatically downloaded and bundled into a JSON file (static/examples.json
) by running:
make static/examples.json
This ensures the demo always uses the latest official and experimental egglog examples. If you want to add or update examples, edit them in the upstream repos and re-run the above command.
Every night the site is rebuilt on Github Actions and the examples are pulled in.
This project is licensed under the MIT License.