An open API service indexing awesome lists of open source software.

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

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
```