wgpu.c3l
March 4, 2026 ยท View on GitHub
WebGPU bindings for the C3 programming language, generated from the official webgpu-native JSON spec.
The bindings wrap wgpu-native and work on Linux, macOS, and Windows.
Building the bindings
The bindings in lib/ are already generated and committed. You only need to rebuild them if you want to update to a newer spec version.
./build.sh
This downloads the latest webgpu.json spec and regenerates lib/webgpu.c3 and lib/commands.c3.
Running the cube example
1. Install wgpu-native
Download the native library for your platform:
./install.sh
This detects your OS and architecture and places the library in ./libs/wgpu-native/.
2. Build and run
c3c run cube
Press Q or Escape to exit.
Using the bindings in your own project
Add this library as a dependency in your project.json:
"dependencies": ["wgpu"],
"dependency-search-paths": ["path/to/webgpu.c3l/.."]
Then import it:
import wgpu;
GLTF loading example can be found here