HLX: A deterministic systems programming language with perfect execution traceability. Bijectional, reversible, and introspectable - giving you unprecedented control over program behavior. Compiles to native code (LLVM) and GPU compute (SPIR-V). Features include LSP integration, DWARF debugging, panic-proof compiler, and reversible bytecode. Built for systems programming, embedded development, and deterministic GPU compute where execution guarantees matter. Itโs built on four values: 1. A1 (Determinism) - Same input โ same LC-B output 2. A2 (Reversibility) - decode(encode(v)) == v 3. A3 (Bijection) - 1:1 correspondence between values and encodings 4. A4 (Universal Value) - All types lower to this core
HLX: A Deterministic Systems Programming Language
HLX iโฆ
HLX: A deterministic systems programming language with perfect execution traceability. Bijectional, reversible, and introspectable - giving you unprecedented control over program behavior. Compiles to native code (LLVM) and GPU compute (SPIR-V). Features include LSP integration, DWARF debugging, panic-proof compiler, and reversible bytecode. Built for systems programming, embedded development, and deterministic GPU compute where execution guarantees matter. Itโs built on four values: 1. A1 (Determinism) - Same input โ same LC-B output 2. A2 (Reversibility) - decode(encode(v)) == v 3. A3 (Bijection) - 1:1 correspondence between values and encodings 4. A4 (Universal Value) - All types lower to this core
HLX: A Deterministic Systems Programming Language
HLX is a systems programming language built on four axioms: determinism, bijection, reversibility, and universal value representation. It compiles to native code via LLVM and GPU compute via SPIR-V, with guaranteed reproducible execution across all platforms.
The Four Axioms
- A1 (Determinism) - Same input โ same LC-B output, always
- A2 (Reversibility) -
decode(encode(v)) == vfor all values - A3 (Bijection) - 1:1 correspondence between values and encodings
- A4 (Universal Value) - All types lower to a core value representation
These arenโt goals. Theyโre proven properties of the language, verified through self-hosting compilation where Stage 2 == Stage 3 bytewise.
Key Features
Production-Ready Compiler
- Panic-proof LLVM backend - Zero unwrap/expect calls, comprehensive error handling
- Self-hosting - HLX compiler written in HLX, compiles itself
- Native compilation - LLVM backend for x86_64, ARM, bare-metal targets
- GPU compute - SPIR-V backend for Vulkan compute shaders
- Reversible bytecode - LC-B format with cryptographic verification
Developer Tooling
- Language Server Protocol (LSP) - Go-to-definition, diagnostics, hover support
- DWARF debugging - Source-level debugging with gdb/lldb
- Dual syntax - HLX-A (ASCII) for humans, HLX-R (Runic) for AI systems
- Standard library - Math, vector operations, I/O primitives
Safety Guarantees
- Bounded execution - All loops require explicit maximum iterations
- Immutable by default - Data structures are immutable unless explicitly cloned
- No undefined behavior - Deterministic semantics enforced at compile time
- Cryptographic verification - SHA256 hashing of all compiled artifacts
Quick Start
Prerequisites
- Rust toolchain (latest stable)
- LLVM 15+ (for native compilation)
- Vulkan SDK (optional, for GPU compute)
Build
git clone https://codeberg.org/latentcollapse/HLX_Deterministic_Language.git
cd HLX_Deterministic_Language/hlx
cargo build --release
Hello World
Create hello.hlxa:
program hello {
fn main() {
print("Hello from HLX!");
}
}
Compile and run:
./target/release/hlx compile hello.hlxa -o hello.lcc
./target/release/hlx run hello.lcc
Verify Determinism
# Run the bootstrap - Stage 2 should equal Stage 3
./bootstrap.sh
# Expected hash (verify on your machine):
# c92fbf41f1395c614703f15f0d6417c5b0f0ef35f2e24f871bb874bae90bb184
Architecture
Compilation Pipeline
HLX-A (source) โ Parser โ AST โ LC-B (bytecode) โ Crate (.lcc)
โ
โโโโโโโโโโดโโโโโโโโโ
โ โ
LLVM Backend SPIR-V Backend
โ โ
Native Binary Vulkan Shader
Runtime Options
- Interpreter - Direct LC-B execution via register-based VM
- JIT - LLVM ORC JIT for development/testing
- AOT Native - Compile to native executables (
.o,.so, ELF) - GPU Compute - Compile to SPIR-V for Vulkan compute pipelines
Language Design
Bounded loops (required):
fn sum_array(arr) -> int {
let total = 0;
let i = 0;
loop (i < len(arr), 1000) { // max 1000 iterations
total = total + arr[i];
i = i + 1;
}
return total;
}
Immutable objects:
fn increment_age(person) -> object {
// Create new object, original unchanged
return {
"name": person.name,
"age": person.age + 1,
"alive": person.alive
};
}
Type system:
- Primitives:
int(i64),float(f64),bool,string,null - Composites:
array,object(immutable maps) - Special:
tensor_t(GPU-accelerated matrices)
Use Cases
1. Reproducible Science & Finance
HLXโs determinism guarantees bit-identical results across platforms. No floating-point drift. No platform-specific behavior. Same code, same result, always.
2. AI-Generated Code Execution
The bounded execution model and immutability make HLX safe for running untrusted AI-generated code. No infinite loops. No buffer overflows. No data races.
3. Embedded Systems
Compile to bare-metal targets with LLVM. No runtime dependencies. No garbage collector. Predictable memory usage. Perfect for real-time systems.
4. GPU Compute Pipelines
Write compute shaders in HLX, compile to SPIR-V. Same determinism guarantees on GPU as CPU. Cross-platform Vulkan support.
5. Compiler Research
The self-hosted compiler is ~76KB of readable code. Study a real compiler that compiles itself, with full source available.
Current Status
โ Complete
- Self-hosting compiler (Ouroboros achieved January 6, 2026)
- Panic-proof LLVM backend (all error paths handled)
- Native code generation (x86_64, ARM, bare-metal)
- SPIR-V GPU compute backend
- LSP with semantic tokens (Phase 1 & 2 complete)
- DWARF debugging support
- Standard library (math, vector, I/O)
- Cryptographic verification (SHA256)
- Three-stage bootstrap (Stage 2 == Stage 3)
- Optional type annotations
๐ง In Progress
- Package manager (
hlx get) - Code formatter (
hlx fmt) - Foreign Function Interface (FFI)
- HLX-R (Runic) specification
๐ฎ Planned
- WebAssembly target
- Formal verification tools
- Proof-carrying code
- Research paper with formal proofs
Project Structure
hlx/
โโโ hlx_compiler/ # Compiler frontend (lexer, parser, AST)
โโโ hlx_backend_llvm/ # LLVM native code backend
โโโ hlx_runtime/ # LC-B interpreter + GPU runtime
โโโ hlx_core/ # IR definitions (instructions, values)
โโโ hlx_lsp/ # Language Server Protocol
โโโ hlx_cli/ # Command-line interface
โโโ examples/ # Example programs
โโโ lib/ # Standard library
โโโ bootstrap.sh # Self-hosting verification
Documentation
- Language Specification: See
hlx/QUICK_START.mdand example programs - Build Summary:
hlx/BUILD_SUMMARY.md- current implementation status - Architecture:
hlx/ARCHITECTURE.md- compiler internals - Contract System:
hlx/CONTRACT_CATALOGUE.md- 124 deterministic operations
Testing
# Run all tests
cargo test --release
# Run bootstrap (verify determinism)
./bootstrap.sh
# Run example programs
./target/release/hlx run examples/fibonacci.lcc
./target/release/hlx run examples/test_tensor.lcc
# Compile to native
./target/release/hlx compile examples/fibonacci.hlxa --emit-obj -o fib.o
gcc fib.o -o fibonacci
./fibonacci
Contributing
HLX is open source under Apache 2.0. Contributions welcome:
- Test the bootstrap - Verify determinism on your platform
- Report bugs - Open issues with reproducible test cases
- Write examples - Demonstrate HLX capabilities
- Improve tooling - LSP features, formatter, package manager
- Documentation - Tutorials, guides, clarifications
Development setup:
git clone https://codeberg.org/latentcollapse/HLX_Deterministic_Language.git
cd HLX_Deterministic_Language/hlx
cargo build --release
cargo test
./bootstrap.sh
Performance
Benchmarks on representative hardware (Intel Xeon E5-2699 v3, 32GB RAM):
- Bootstrap time: ~8 seconds (3 stages)
- Compilation speed: ~30,000 instructions/second
- Native execution: Within 10% of hand-written C (LLVM backend)
- GPU compute: Full Vulkan 1.3 pipeline support
See hlx/BENCHMARKS.md for detailed profiling data.
FAQ
Q: Why create a new language? A: Existing languages donโt guarantee determinism. HLXโs four axioms make entire classes of bugs impossible.
Q: Is this production-ready? A: The core compiler is stable and self-hosting. Tooling (LSP, package manager) is still maturing.
Q: How does HLX compare to Rust/C++? A: HLX prioritizes determinism over raw performance. Itโs faster than Python, slower than C++, but with guarantees neither can provide.
Q: Whatโs the performance penalty for determinism? A: ~10% vs optimized C in most cases. The LLVM backend generates competitive machine code.
Q: Can I use HLX for [X]? A: If you need reproducible execution, verifiable builds, or safe AI-generated code, yes. If you need a mature ecosystem, not yet.
Citation
If you use HLX in research:
@software{hlx2026,
title = {HLX: A Deterministic Systems Programming Language},
author = {latentcollapse and contributors},
year = {2026},
url = {https://codeberg.org/latentcollapse/HLX_Deterministic_Language},
note = {Self-hosting compiler with proven determinism (Axioms A1-A4)}
}
License
Copyright 2026 HLX Contributors
Licensed under the Apache License, Version 2.0. See LICENSE file for details.
Acknowledgments
Pair-Programming Contributions:
- Claude (Anthropic) - Architecture design, LLVM backend, panic-proofing, LSP implementation
- Gemini (Google DeepMind) - Parser optimization, standard library, testing infrastructure
HLX was built through collaborative human-AI engineering, demonstrating that deterministic languages enable new forms of software development.