The Web Shading Language provides a human-writable, safe programming language for the WebGPU API.
Link to spec: https://gpuweb.github.io/WSL/
- Formally proven as safe for Web use e.g. the language forbids reading or writing to memory that shouldn't be accessible.
- Supports a restricted form of pointers.
The current implementation can be found in WebKit Source Code.
The Examples directory has some WSL sample code.
The specification is contained in Spec/, and in particular in Spec/source/index.rst
To build it requires the following:
- ott (https://www.cl.cam.ac.uk/~pes20/ott/)
- sphinx (http://www.sphinx-doc.org/en/master/)
- latex (and various latex packages)
- dvipng
All of the dependencies can be installed on Mac (assuming that XCode and MacPorts are installed) with the following commands:
sudo port install opam opam init opam install ott sudo port install py-sphinx sudo port install texlive-latex sudo port install texlive-latex-extra sudo port install dvipng Actually building the document can be done by simply running make singlehtml in /Spec, and it can be seen by opening Spec/build/singlehtml/index.html