Slang is a shading language and compiler toolchain designed to simplify GPU programming and the development of scalable graphics applications. Its HLSL-inspired syntax facilitates migration from existing shader codebases while providing compatibility with GLSL functionality. The language supports generics, interfaces, and specialized code generation for different hardware targets. A modular compilation system enables independent shader compilation and subsequent runtime linking. Integrated automatic differentiation generates forward and backward derivative propagation code for differentiable rendering and machine learning applications. Supported compilation targets include DXIL, SPIR-V, CUDA, and Metal. Language Server Protocol integration provides intelligent editing features, while debugging tools facilitate shader inspection.
Features
- Cross-platform shader compilation targeting DXIL, SPIR-V, CUDA, Metal, and additional GPU programming environments
- Advanced language constructs with generics, interfaces, and compile-time or runtime code specialization
- Modular shader development with independent compilation, intermediate representations, and runtime linking
- Automatic forward and backward differentiation for neural graphics, differentiable rendering, and machine learning applications
- HLSL-compatible syntax with GLSL interoperability for migrating existing graphics application codebases
- Integrated language server functionality with intelligent code editing, shader debugging, and RenderDoc compatibility