Una forma, multa membra.
— ONE FORM, MANY MEMBERS —
NVIDIA · CMU · Khronos · 2017 — 2024
SLANG · INTERFACE / IMPL · DIFFERENTIABLE · CROSS-COMPILES TO SPIR-V · DXIL · METAL · CUDA · WGSL
OSL describes a surface. WGSL dispatches a kernel. Slang introduces a third move: an interface. One contract, written once. Many implementations, swapped at compile time. The shader becomes generic — a surface that holds whichever physics you fit to it. Below: the same sphere; six implementations; one drag.
interface IBSDF { fn eval(ωi, ωo) → vec3; } — the contract. drag the rail to swap the implementation. —
drag the knob · or press ← →
The trilogy completes. OSL is a closure — describe what the surface is. WGSL is a kernel — compute the same thing on every device. Slang is an interface — write the contract once, slot in any member that fits.
This is shader polymorphism in the style of Rust traits or Swift protocols. A material library becomes a set of IBSDF implementations; the renderer asks for one by name; the compiler specializes. One form. Many members.
And — the move that lifted Slang into the moment — the language is differentiable. Compose a shader, and the compiler will hand you back its gradient. The shader is no longer just a renderer. It's a layer in a network.
shader-slang.comslang.exe · slangc · libslangused in production: NVIDIA Omniverse| 2007 | Tim Foley begins shader-language research at Stanford. The question: can shaders carry generics without losing GPU efficiency? |
| 2017 | Slang first appears at NVIDIA Research. HLSL-compatible. Adds interfaces, generics, extensions — Rust-trait-style polymorphism in a shader language. |
| 2018 | Open-sourced on GitHub. Falcor — NVIDIA's research path tracer — adopts Slang for its material system. |
| 2020 | Compiles to SPIR-V, DXIL, MSL, GLSL, CUDA. The same Slang source now ships to every GPU backend that matters. |
| 2022 | Differentiable Slang. The compiler will return a gradient for any function you write. Inverse rendering, learned BRDFs, neural shading become first-class. |
| 2024 | Khronos adopts Slang as a working group. v1 spec stable. The shader language with generics, written for the GPU, ratified for the open ecosystem. |
| ∞ | Una forma, multa membra. The interface holds. The implementations swap. The compiler decides the rest. |
One contract. Six implementations. Six backends. The language that finally let shaders carry generics — and gradients — without leaving the GPU.