Live Demo: https://zeachco.github.io/cells-ai/
A Rust-based cellular simulation that compiles to WebAssembly and runs in the browser.
This is a Rust project built with macroquad that compiles to WebAssembly for web deployment. While the core logic is written in Rust, the project uses npm scripts for convenient web development workflow.
- Rust (with the
wasm32-unknown-unknowntarget) - Node.js and npm
- cargo-watch (optional, for development)
# Add the WebAssembly target
rustup target add wasm32-unknown-unknown
# Install cargo-watch for development (optional)
cargo install cargo-watchnpm installStart the development server with hot-reloading:
npm run devThis runs both:
- A Rust watcher that rebuilds the WebAssembly on code changes
- A Vite dev server at
http://localhost:5173
npm run buildThis compiles the Rust code to optimized WebAssembly and bundles everything with Vite.
npm run preview| Command | Description |
|---|---|
npm run dev |
Start development server with hot-reloading |
npm run build |
Build optimized production bundle |
npm run build:wasm |
Compile Rust to WebAssembly (release mode) |
npm run watch:wasm |
Watch Rust files and rebuild on changes |
npm run preview |
Preview the production build locally |
While npm provides convenient scripts, you can also use standard Rust/Cargo commands:
# Build for native (desktop)
cargo build
# Run natively
cargo run
# Build for WebAssembly
cargo build --release --target wasm32-unknown-unknown