CrossTL v2.0.0
A ground-up expansion of the CrossGL language and all 9 translation backends.
Highlights
- CrossGL language v2: Generics, traits, algebraic enums, pattern matching, do-while loops, double-precision types
- Validation layer: 2700+ lines of texture intrinsic, stage, and resource validation
- Plugin system: Backends self-register via
BackendSpec/SourceSpecfor third-party extensibility - 9 backends massively expanded: 10-20x more generated code surface (GLSL, HLSL, Metal, SPIR-V, CUDA, HIP, Mojo, Rust, Slang)
- 7,983 passing tests (up from ~200 at v1.0.0)
- Full CI matrix: Cross-platform (Linux/Windows/macOS) × Python 3.8–3.13 × per-backend
Breaking Changes
.cglfiles using new syntax (generics, traits, match) are not backward-compatible with v1.x parsers- Internal AST restructured:
ASTNodegainedchild_nodes(),walk(),bind_parent_links();ShaderNode.stagesis now aStageMap - Direct internal module imports (
from crosstl.translator.codegen import X) removed — use the registry orcrosstl.translate()
Install
pip install crosstl==2.0.0Backend Compatibility
All backends support core CrossGL. Advanced features with partial coverage:
| Feature | Not yet supported in |
|---|---|
| Generic functions | SPIR-V, CUDA, HIP, Mojo, Slang |
| Geometry stage | Metal, CUDA, HIP, Mojo, Rust |
| Tessellation stage | OpenGL, Metal, CUDA, HIP, Mojo, Rust |
| Mesh/Task stage | CUDA, HIP, Mojo, Rust, Slang |
Full Changelog
See CHANGELOG.md or compare: release-1.0.0...v2.0.0