A MEMORY-SAFE SYSTEMS LANGUAGE WITH NO HEAP, NO GARBAGE COLLECTOR AND NO LIFETIME ANNOTATIONS.
Helium is the compiled systems language underneath our newer desktop, server and browser software, and the target language that Gold compiles plain English into. Its compiler, hc, is written in Helium and builds itself. It writes native x86-64 Linux executables directly—its own code generator, optimizer and ELF writer, with no C compiler, assembler or linker required—and also compiles to portable C (for ARM64, macOS and Windows), WebAssembly with a tiny JS host for the browser, and SPIR-V, MSL, HLSL and WGSL GPU shaders.
0 GC · 0 'a
Scope-owned stack and region memory; references cannot dangle and never need lifetime annotations
~3.9K tokens
The entire language specification fits cleanly in one AI prompt or a ten-minute read
9,808 symbols
Helium standard library across 171 modules: HTTP/WebSocket, post-quantum TLS 1.3, SQLite, UI, physics and 3D graphics
Every Helium program can be written in .he layout syntax (indentation, no semicolons, := and ~=, used by hc and its standard library) or .amni brace syntax (braces, semicolons, let/var, and GPU-backed lut fn tables). Modules in both syntaxes import each other freely, or you can describe behavior in Gold and have Gold write and verify either form.
use os
use json
use crypto.sha3
digest_hex(payload const byte[:]) byte[>..]:
out byte[>..] ~= []
hex_encode(out, crypto::sha3_256(payload))
out
main():
raw byte[>..] ~= []
if !read_file("manifest.json", raw):
print("missing manifest.json")
exit(1)
doc := json::Doc {}
root, err := json::parse(raw, doc)
if err.len > 0 || root < 0:
print("bad json: ", err)
exit(1)
name, _ := json::as_string(doc, json::member(doc, root, "name"))
print(name, " sha3=", digest_hex(raw))import os;
import json;
import crypto.sha3;
fn collatz_steps(n int) int {
var x = n;
var c = 0;
while x > 1 { x = if x % 2 == 0 { x / 2 } else { 3 * x + 1 }; c++; }
c
}
lut fn fast_steps(n u16) int { collatz_steps(n) }
fn main() {
var hex byte[>..] = [];
hex_encode(hex, crypto::sha3_256("helium"));
print("steps(27)=", fast_steps(27), " sha3=", hex[..16]);
}use os, json, crypto.sha3
into check_manifest.he
`digest_hex` returns the lowercase hex string of the SHA3-256 digest of `payload`.
Read "manifest.json" (if missing, print "missing manifest.json" and exit 1), parse it as JSON (if invalid, print "bad json: " with the error and exit 1), and print its "name" string followed by " sha3=" and the `digest_hex` of the raw file bytes.BUILD & RUN
$ hc/bootstrap.sh # one-time self-hosted bootstrap from hc/seed/hc.c
$ build/hcn run check_manifest.he # native compile into ~/.cache/hc and run
$ build/hcn build check_manifest.he -o app # standalone native x86-64 ELF binary
$ build/hcn build app.amni --web -o app.wasm
Systems languages usually ask you to pick between manual memory bugs (C), garbage-collector pauses and runtime footprint (Go, Java, JS), or viral lifetime annotations (Rust). Helium restricts allocation topology instead so safety is checked statically without 'a annotations.
| Design choice | How Helium enforces it |
|---|---|
| Scope-owned values, no general heap | Every value lives on the CPU stack, in static data, or on a compiler-managed data stack. Growable arrays (byte[>..], Row[>..]) and hash maps grow in place within their owning frame and are reclaimed in bulk when that scope exits—zero per-node malloc/free churn and zero garbage-collector pauses. |
| Static root inference (no lifetimes) | Slices (const byte[:]) and mutable references (T&) borrow from a concrete root value. hc tracks each reference’s root across calls and branches and rejects any reference that could outlive its owner or alias across mutation, without lifetime parameters in function signatures. |
| Share-nothing threads | thread_fn workers share no mutable memory. Only flat, reference-free values cross typed queues (qput / qget), eliminating data races by construction. |
GPU-accelerated lut fn tables | Marking a pure function of small integer inputs (up to 24 bits) with lut fn turns it into a sparse, persistent 4,096-entry-tiled lookup table cached on disk. For 10–20-bit integer functions whose CPU fill would exceed 30 ms, Helium compiles the function body to a GPU compute shader and fills all entries in parallel on Vulkan. |
| Built-in vector & shader codegen | hc includes an auto-vectorizer, direct hardware intrinsics for AES/VAES, GFNI and AVX-512 in gf, and an internal GLSL compiler that emits SPIR-V, Metal Shading Language (MSL), HLSL and WebGPU WGSL without external shader toolchains. |
| Command | What it does |
|---|---|
hc run file [-- args] | Compile natively into ~/.cache/hc and run immediately (hc file is shorthand). |
hc build file [-o out] | Build a standalone native executable; -o out.c emits portable C99; --web -o out.wasm writes WebAssembly plus the helium.js browser host. |
hc check [--all] file | Parse, resolve imports and typecheck without emitting machine code. |
hc fetch [--update] file | Fetch git packages declared inline via import name from "owner/repo@ref";. |
hc lsp | Built-in Language Server Protocol server: live diagnostics, hover types, go-to-definition, find references, rename, document symbols, completion and inlay hints. |
hc --wgsl shader out.wgsl | Translate a .vert, .frag or .comp shader to WebGPU WGSL (--blob packs SPIR-V, MSL, HLSL and WGSL for embed_shader). |
--debug, -DNAME=V, --offline | Enable bounds/overflow/tag checks naming exact source lines, set compile-time defines, or forbid network package fetches. |
All 171 modules in hc/lib are written in Helium and indexed in the searchable API Library.
| Area | Modules & capabilities |
|---|---|
| Core & Containers | Implicit std (slices, sorting, binary search, heaps, UTF-8, shortest-roundtrip float formatting), dictionary, math, vec (float2/float3/float4), tiles/* (verified behavior-exact equivalents of JS, Python, Rust, Kotlin and Java built-ins). |
| Text, Formats & Storage | Zero-copy arena json, linear-time regex, csv, base64, binary, compression/archives, and embedded SQL via db.sqlite. |
| Networking & Servers | Non-blocking sockets, TCP, UDP, DNS, HTTP/1.1 & chunked client/server (net.http, net.httpd), WebSockets, Server-Sent Events (SSE), Socket.IO and QUIC (net.quic). |
| Cryptography & Post-Quantum TLS | TLS 1.3 client & server with hybrid post-quantum X25519MLKEM768 key share (0x11EC), ML-KEM-768 & ML-DSA-65 (crypto.pqc), SHA-2/SHA-3/BLAKE2b, Argon2id, ChaCha20-Poly1305, hardware VAES/GFNI AES-GCM, X25519, Ed25519, ECDSA, RSA verify and X.509. |
| 3D Graphics, UI, Audio & Physics | Helium Graphics PBR renderer on Vulkan and browser WebGPU (glTF, atmosphere, water, strand hair, virtual shadow maps), immediate-mode ui, spatial audio, 3D rigid-body physics, skeletal anim, and browser DOM/WebGL2 bindings (web, webgl). |
Seven single-threaded benchmarks run with identical algorithms and byte-for-byte verified outputs on an AMD Ryzen 9 9950X3D across all four facets:
| Program | Helium (hcn) | C (gcc -O2) | C (clang -O2) | Rust (-O3) | Zig (ReleaseFast) | Go | Java | Node.js | Python |
|---|---|---|---|---|---|---|---|---|---|
fib (40) | 13 ms | 75 ms | 169 ms | 170 ms | 170 ms | 305 ms | 200 ms | 634 ms | 6,017 ms |
nbody (10M) | 273 ms | 371 ms | 386 ms | 250 ms | 243 ms | 516 ms | 409 ms | 440 ms | 30.5 s |
spectral (3K) | 147 ms | 273 ms | 286 ms | 274 ms | 268 ms | 290 ms | 353 ms | 404 ms | 34.4 s |
bintrees (18) | 105 ms | 683 ms | 759 ms | 1,148 ms | 759 ms | 912 ms | 326 ms | 661 ms | 3,740 ms |
fannkuch (11) | 1,724 ms | 1,800 ms | 1,956 ms | 1,822 ms | 2,058 ms | 1,790 ms | 2,044 ms | 1,857 ms | 64.0 s |
mandelbrot (4K) | 329 ms | 602 ms | 656 ms | 614 ms | 625 ms | 630 ms | 691 ms | 676 ms | 31.6 s |
strmap (5M) | 200 ms | 731 ms | 1,114 ms | 779 ms | 215 ms | 801 ms | 535 ms | 2,869 ms | 2,406 ms |
| GEOMETRIC MEAN WALL TIME RELATIVE TO C (GCC -O2) — LOWER IS FASTER | |||||||||
| All 7 programs | 0.40× | 1.00× | 1.26× | 1.16× | 0.92× | 1.37× | 1.08× | 1.82× | 31.09× |
Without bintrees | 0.47× | 1.00× | 1.28× | 1.09× | 0.89× | 1.38× | 1.24× | 2.02× | 41.53× |
| Program | Helium (hcn) | C (gcc -O2) | C (clang -O2) | Rust (-O3) | Zig (ReleaseFast) | Go | Java | Node.js | Python |
|---|---|---|---|---|---|---|---|---|---|
fib | 1.3 MB | 2.2 MB | 2.2 MB | 2.2 MB | 1.3 MB | 1.8 MB | 40.9 MB | 54.7 MB | 9.6 MB |
nbody | 1.3 MB | 2.1 MB | 2.1 MB | 2.2 MB | 1.3 MB | 3.5 MB | 47.8 MB | 57.8 MB | 10.3 MB |
spectral | 1.3 MB | 2.1 MB | 2.2 MB | 2.1 MB | 1.3 MB | 5.4 MB | 40.5 MB | 57.8 MB | 10.3 MB |
bintrees | 16.0 MB | 34.1 MB | 34.1 MB | 34.2 MB | 16.2 MB | 38.0 MB | 632.9 MB | 182.7 MB | 42.0 MB |
fannkuch | 1.3 MB | 2.1 MB | 2.4 MB | 2.1 MB | 1.3 MB | 3.5 MB | 41.6 MB | 57.3 MB | 10.1 MB |
mandelbrot | 1.3 MB | 2.2 MB | 2.1 MB | 2.2 MB | 1.3 MB | 1.8 MB | 39.5 MB | 57.3 MB | 9.7 MB |
strmap | 7.5 MB | 23.9 MB | 24.0 MB | 17.8 MB | 10.7 MB | 22.6 MB | 164.6 MB | 91.8 MB | 31.5 MB |
| Program | Helium (hcn) | C (gcc -O2) | C (clang -O2) | Rust (-O3) | Zig (ReleaseFast) | Go | Java (.class) |
|---|---|---|---|---|---|---|---|
fib | 9 KB | 14 KB | 14 KB | 345 KB | 9 KB | 1,488 KB | 1 KB |
nbody | 21 KB | 14 KB | 14 KB | 372 KB | 28 KB | 1,500 KB | 3 KB |
spectral | 18 KB | 14 KB | 14 KB | 370 KB | 27 KB | 1,500 KB | 1 KB |
bintrees | 12 KB | 18 KB | 14 KB | 347 KB | 14 KB | 1,500 KB | 2 KB |
fannkuch | 11 KB | 14 KB | 14 KB | 348 KB | 11 KB | 1,500 KB | 1 KB |
mandelbrot | 8 KB | 14 KB | 14 KB | 345 KB | 9 KB | 1,488 KB | 1 KB |
strmap | 31 KB | 14 KB | 14 KB | 362 KB | 17 KB | 1,488 KB | 2 KB |
| Program | Helium (hcn) | C (gcc -O2) | C (clang -O2) | Rust (-O3) | Zig (ReleaseFast) | Go | Java (javac) |
|---|---|---|---|---|---|---|---|
fib | 30 ms | 45 ms | 45 ms | 76 ms | 146 ms | 33 ms | 269 ms |
nbody | 69 ms | 60 ms | 64 ms | 95 ms | 306 ms | 34 ms | 283 ms |
spectral | 54 ms | 53 ms | 68 ms | 98 ms | 355 ms | 35 ms | 298 ms |
bintrees | 34 ms | 95 ms | 70 ms | 80 ms | 260 ms | 44 ms | 253 ms |
fannkuch | 32 ms | 47 ms | 62 ms | 101 ms | 185 ms | 33 ms | 267 ms |
mandelbrot | 31 ms | 32 ms | 96 ms | 77 ms | 152 ms | 40 ms | 214 ms |
strmap | 66 ms | 50 ms | 62 ms | 159 ms | 359 ms | 35 ms | 277 ms |
14× less RAM
Waystone server & world sim vs Node.js (6.1–8.0 MiB vs 86.7–113.1 MiB), 1.9–2.5× faster
41% smaller
Pom-Pom Grove simulation binary vs Rust, using 2.4× less peak memory
1,691× faster
Amni-Crypt cipher layer vs Python + NumPy using Helium’s hardware VAES/GFNI gf module
Microbenchmarks: Helium leads six of the seven benchmarks outright, uses the lowest peak resident memory on every test (1.3 MB baseline, 16.0 MB on bintrees, 7.5 MB on strmap), emits 8–31 KB stripped binaries, and compiles each program natively in 30–69 ms. Without bintrees, Helium’s geometric mean wall time is 0.47× gcc -O2 (2.1× faster than gcc -O2 and 1.9× faster than Zig’s 0.89×). Two cells remain ahead of hcn: on bintrees, a hand-written C bump arena edges Helium’s automatic region pool (81 ms vs 105 ms), and on nbody, Zig (243 ms) and Rust (250 ms) edge Helium (273 ms) while Helium beats gcc -O2 (371 ms) and clang -O2 (386 ms).
Targets & specification: Direct machine-code generation currently targets x86-64 ELF; ARM64, macOS and Windows binaries build cleanly via Helium’s C backend (hc build -o out.c + cc or zig cc, which is how Amnitex ships single-file Linux, macOS universal and Windows executables). A formal specification lives in spec/ alongside the compiler, with remaining soundness edge cases documented openly as they are closed.
Write Helium directly (.he or .amni) for compilers, GPU pipelines, kernels, cryptographic primitives and tight byte-level protocols where you want exact control over layout and instructions. Use Gold for application logic, calculators, data rules and multi-language ports: Gold compiles plain-English specifications into checked Helium, caches verified blocks in .gold.lock and a local hash vault, and automatically repairs code when Helium evolves via gold sync.
Last updated