https://github.com/richplastow/rust-to-wgsl
Transforms Rust source code to WebGPU Shading Language (WGSL) source code
https://github.com/richplastow/rust-to-wgsl
Last synced: 2 months ago
JSON representation
Transforms Rust source code to WebGPU Shading Language (WGSL) source code
- Host: GitHub
- URL: https://github.com/richplastow/rust-to-wgsl
- Owner: richplastow
- License: mit
- Created: 2024-12-15T21:46:54.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-19T22:52:12.000Z (5 months ago)
- Last Synced: 2025-02-10T08:13:46.887Z (4 months ago)
- Language: JavaScript
- Size: 157 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust to WGSL
> Transforms Rust source code to WebGPU Shading Language (WGSL) source code
- Version: 0.0.1
- Created: 2024-12-15 by Rich Plastow
- Last updated: 2024-12-27 by Rich Plastow
- Playground:
- Repo:## Examples
1. `node examples/run-01.mjs` Block and line comments
2. `node examples/run-02.mjs` Rust’s `let` is equivalent to WGSL’s `var`
3. `node examples/run-03.mjs` Rust chars have no WGSL equivalent
4. `node examples/run-04.mjs` Rust strings have no WGSL equivalent## Unit tests
`node test.mjs`
## Resources
-
- with Input format ‘WGSL’, Compiler #1
‘Tint’ ‘trunk’, Shader stage ‘\’ and Output format ‘WGSL’## Build
```zsh
npm install --global rollup
# added 4 packages, and audited 5 packages in 1s
# found 0 vulnerabilities
rollup --version
# rollup v4.28.1
rollup -i rust-to-wgsl.mjs -o docs/rust-to-wgsl.js -f iife -n RUST_TO_WGSL
# rust-to-wgsl.mjs → docs/rust-to-wgsl.js...
# created docs/rust-to-wgsl.js in 87ms
```