This repository is a showcase of a pipeline that integrates WIT, WebGPU, and WASM components. It was created for both personal learning and to help others explore the modern WebAssembly component model pipeline using tools like cargo-component, wasm-tools, and wac.
This project aims to support those interested in:
- WebGPU
- WASM component models
- Nix-based development
- Game/graphics engine architecture
As of June 19, 2025, this project reflects the most recent component model practices.
-
Enter the Nix development shell:
nix develop
-
Navigate to the WebGPU demo folder:
cd webgpu
-
Create a new component package:
cargo component new <my-package-name>
- To create a command-style component, use:
cargo component new <my-package-name> --command
- To create a command-style component, use:
-
Generate WIT bindings for your component:
cargo component bindings
-
Build your component (required for
.wac):cargo component build --release
- Inspect/decompile a WASM component’s WIT interface:
wasm-tools component wit path/to/component.wasm
- WAC Documentation:
This project is intended to demystify the modern WebAssembly ecosystem by providing real, working examples built with:
- The WebAssembly Component Model
- WebGPU bindings
- Rust tooling (
cargo-component,wasm-tools,wac) - Nix-based reproducible development environments
Whether you're learning or prototyping, this is a great place to explore how these technologies come together.
Feel free to contribute, fork, or use this setup as inspiration for your own component-driven WebGPU projects!