The Effects Language

A systems-oriented language with first-class algebraic effects. One source, eight compile targets — C, HLSL, GLSL, SPIR-V, LLVM IR, WebAssembly, x86-64, ARM64.

What is QuantaLang

QuantaLang is a compiled systems language. It blends classical ML/Rust semantics — ownership, lifetimes, algebraic data types, traits — with a first-class effect system modelled on research into algebraic effects and handlers. Effectful computation is explicit in the type system and dispatched by user-defined handlers.

Effects as values

effect, perform, handle, resume, with — compose pure code with I/O, async, logging, or backtracking without monad stacks. Handlers are regular first-class functions.

Shaders are first-class

Mark a function #[fragment] or #[compute] and it compiles to HLSL, GLSL, or SPIR-V from the same source. No separate shader language. No string-literal shaders.

Multi-backend from one IR

Eight codegen backends share the same type-checked IR. Emit a standalone binary, a browser WASM module, a ReShade effect, and a Vulkan compute shader from the same library.

AI primitives

ai, neural, infer keywords reserve syntax for differentiable program synthesis and neural architecture search via the companion axiom module.

Install

The compiler is published to crates.io and installs anywhere Rust runs.

cargo install quantalang

The binary is called quantac. Run quantac --help to see all commands.

Example

A vignette shader written once, compiled to HLSL for ReShade or GLSL for Vulkan.

fn vignette(uv_x: f64, uv_y: f64, strength: f64, softness: f64) -> f64 {
    let dx = uv_x - 0.5;
    let dy = uv_y - 0.5;
    let dist = sqrt(dx * dx + dy * dy);
    let vig = smoothstep(0.5, 0.5 * softness, dist);
    1.0 - strength * (1.0 - vig)
}

#[fragment]
fn PS_Vignette(uv: vec2) -> vec4 {
    let color = tex2d(uv);
    let vig = vignette(color.x, color.y, 0.5, 0.6);
    vec4(color.x * vig, color.y * vig, color.z * vig, 1.0)
}
# emit HLSL for ReShade
quantac vignette.quanta --target hlsl -o vignette.fx

# emit GLSL for Vulkan
quantac vignette.quanta --target glsl -o vignette.glsl

Eight targets, one source

The compiler lowers through a shared IR. Each backend emits idiomatic output for its target — not a transpiled blob.

C
HLSL
GLSL
SPIR-V
LLVM IR
WebAssembly
x86-64
ARM64

Ecosystem

The Quanta Universe is a 23-module ecosystem authored entirely in QuantaLang: rendering engines, algorithmic trading, color science, OS kernel work, developer tools.

Foundation

quantalang · foundation · axiom

Rendering

photon · spectrum · chromatic · lumina · neutrino · prism · refract

Finance

quantum-finance · field-tensor · delta · entropy

Intelligence

oracle · wavelength

Integration

entangle · calibrate · nova

Tooling

forge · nexus

Editor support

Syntax highlighting, bracket matching, and comment toggles in VS Code. LSP server ships with the compiler — works in any LSP-aware editor.

VS Code extension

HarperZ9/quantalang-vscode — TextMate grammar, language configuration, file icon.

Grammar

HarperZ9/quantalang-tmLanguage — used by the VS Code extension, submitted to github-linguist.