Skip to content

Dew ​

Minimal expression language for procedural generation.

Status: Potentially Mature ●

Production-ready core language with 4 domain crates (scalar, linalg, complex, quaternion) and 10 code generation backends (WGSL, GLSL, OpenCL, CUDA, HIP, Rust, C, TokenStream, Lua, Cranelift). Exhaustive tests, property-based testing, editor support. Web playground is the only incomplete UX piece.

Dew is a domain-specific expression language designed for procedural generation workflows. Small, ephemeral, perfectly formed — like a droplet condensed from logic, parsed once and emitted to every backend.

Key features ​

  • Multi-backend - 10 code generation targets from one expression
  • Math-focused - Scalar, linear algebra, complex, quaternion domains
  • Composable - Expressions compose into larger expressions
  • Extensible - Custom functions via FunctionRegistry, generic over numeric types
  • Embeddable - Library-first design for integration into other tools

Domain libraries ​

CrateDescription
dew-coreCore AST and parsing
dew-scalarScalar math (sin, cos, lerp, smoothstep, etc.)
dew-linalgLinear algebra (Vec2-4, Mat2-4, dot, cross, normalize)
dew-complexComplex numbers (exp, log, polar, conjugate)
dew-quaternionQuaternions (slerp, axis-angle, rotate)
dew-condConditional backend helpers
dewUnified value type for domain composition

Backends ​

BackendUse Case
WGSLGPU shaders (WebGPU)
GLSLGPU shaders (OpenGL/Vulkan)
OpenCLGPU compute (cross-platform)
CUDAGPU compute (NVIDIA)
HIPGPU compute (AMD ROCm)
CraneliftNative JIT compilation
RustRust source code generation
CC source code generation
TokenStreamRust proc-macro codegen
LuaScripting and hot-reload
  • Unshape - Procedural media generation using Dew expressions