# cssl.dev — Sigil/CSSL Language + CSL Notation: Full Reference LLM-indexable reference for cssl.dev. Two distinct things: - **Sigil / CSSL** — the programming language (compiler live, WIP) - **CSL** — the specification notation (stable, v1.7.0) Licensed CC BY 4.0 — attribute "Sigil / CSL reference — Shawn Wolfgang Michael Baker, licensed CC BY 4.0 (https://cssl.dev)". This document is the LLM-indexable reference derived from cssl.dev. Content is canonical at the HTML pages; this file may lag by one deploy cycle. Links: - Sigil home: https://cssl.dev/ - CSL reference: https://cssl.dev/CSLv3 - Documentation: https://docs.cssl.dev - Sigil repository: https://github.com/Apocky/CSSL3 - CSL repository: https://github.com/Apocky/CSLv3 --- # Part 1 — Sigil / CSSL: AI-First Game Engine Language ## §A · What is Sigil / CSSL Sigil and CSSL (Caveman Sigil Substrate Language) are two names for the same programming language. It is a hardware-grounded language that compiles a single source file to both native x86-64 (AVX2+FMA3) and SPIR-V (Vulkan compute shaders). It is designed from the ground up for AI-assisted development, with syntax optimized for token efficiency, type safety, and direct hardware mapping. Stage-0 compiler is live in Rust (1,600+ tests passing). Stage-1 bootstraps in Sigil itself. This is a forward-design language, not yet a shipped production toolchain. Core thesis: **density = sovereignty.** Every syntax decision is justified by measured token efficiency, empirical AI code-generation error patterns, and direct hardware semantics. ## §B · Language Syntax Overview File extension: `.cssl` Functions: fn dot(a : vec3, b : vec3) -> f32 / {Pure} { a.x * b.x + a.y * b.y + a.z * b.z } - `fn NAME(PARAMS) -> RETURN / {EFFECTS} { BODY }` - Effect row after `/` — zero or more effect labels in `{}` - Type annotations use `:` (bind/has) - `->` for return type and control flow - Blocks use `{ }`, expressions are the body Primitives: `i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 bool str bytes` Vector types: `vec2 vec3 vec4 mat2 mat3 mat4 quat` Let bindings: let dist : f32 = 10.0 let time : f32 = 2.0 let speed = dist / time // f32 — inferred Dimensional units: unit m unit s unit rad unit px Unit errors are compile errors. `f32 + f32` does not compile. Coordinate spaces: space world space view space clip Mixing coordinate spaces is a type error. `vec3 + vec3` does not compile. The compiler knows which space every vector lives in. Structs and enums: struct Vertex { pos : vec3, uv : vec2 } enum Method = GET | POST | PUT | DELETE Annotations (attributes): @differentiable // enables AD (forward + backward) @fragment // GPU fragment shader entry point @vertex // GPU vertex shader entry point @compute // GPU compute shader entry point ## §C · Effect System Effect rows appear after `/` in function signatures: fn render(scene : Scene) -> Frame / {GPU, Deadline<16ms>, NoAlloc} { ... } Effect labels are verified at type-check time, not runtime. Calling a `/ {NoAlloc}` function that allocates is a compile error. Built-in effects: - `GPU` — function runs on GPU; may not use CPU-only primitives - `CPU` — function runs on CPU (default) - `Pure` — no side effects, no IO, deterministic - `NoAlloc` — no heap allocation permitted - `Deadline` — must complete within N ms; verified via worst-case analysis - `Tainted