HELIUM

A MEMORY-SAFE SYSTEMS LANGUAGE WITH NO HEAP, NO GARBAGE COLLECTOR AND NO LIFETIME ANNOTATIONS.

SEE THE CODE → HOW IT WORKS STANDARD LIBRARY BENCHMARKS API LIBRARY GITHUB

WHAT IT IS

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

TWO SYNTAXES, ONE COMPILER

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

HOW MEMORY & CONCURRENCY WORK

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 choiceHow Helium enforces it
Scope-owned values, no general heapEvery 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 threadsthread_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 tablesMarking 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 codegenhc 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.

COMPILER COMMANDS

CommandWhat 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] fileParse, resolve imports and typecheck without emitting machine code.
hc fetch [--update] fileFetch git packages declared inline via import name from "owner/repo@ref";.
hc lspBuilt-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.wgslTranslate a .vert, .frag or .comp shader to WebGPU WGSL (--blob packs SPIR-V, MSL, HLSL and WGSL for embed_shader).
--debug, -DNAME=V, --offlineEnable bounds/overflow/tag checks naming exact source lines, set compile-time defines, or forbid network package fetches.

STANDARD LIBRARY

All 171 modules in hc/lib are written in Helium and indexed in the searchable API Library.

SEARCH ALL 9,808 SYMBOLS →SEE HELIUM GRAPHICSSEE GOLD
AreaModules & capabilities
Core & ContainersImplicit 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 & StorageZero-copy arena json, linear-time regex, csv, base64, binary, compression/archives, and embedded SQL via db.sqlite.
Networking & ServersNon-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 TLSTLS 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 & PhysicsHelium 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).

PERFORMANCE

Two-panel chart of per-program speedup and geometric mean speedup relative to C (gcc -O2) for Helium, C, Rust, Zig, Go, Java, Node.js and Python across seven benchmarks (higher is faster). Three-panel chart comparing Helium against C, Zig, Rust, Go, Java, Node.js and Python on peak resident memory, stripped native binary size, and cold compile time (lower is better).

Seven single-threaded benchmarks run with identical algorithms and byte-for-byte verified outputs on an AMD Ryzen 9 9950X3D across all four facets:

ProgramHelium (hcn)C (gcc -O2)C (clang -O2)Rust (-O3)Zig (ReleaseFast)GoJavaNode.jsPython
fib (40)13 ms75 ms169 ms170 ms170 ms305 ms200 ms634 ms6,017 ms
nbody (10M)273 ms371 ms386 ms250 ms243 ms516 ms409 ms440 ms30.5 s
spectral (3K)147 ms273 ms286 ms274 ms268 ms290 ms353 ms404 ms34.4 s
bintrees (18)105 ms683 ms759 ms1,148 ms759 ms912 ms326 ms661 ms3,740 ms
fannkuch (11)1,724 ms1,800 ms1,956 ms1,822 ms2,058 ms1,790 ms2,044 ms1,857 ms64.0 s
mandelbrot (4K)329 ms602 ms656 ms614 ms625 ms630 ms691 ms676 ms31.6 s
strmap (5M)200 ms731 ms1,114 ms779 ms215 ms801 ms535 ms2,869 ms2,406 ms
GEOMETRIC MEAN WALL TIME RELATIVE TO C (GCC -O2) — LOWER IS FASTER
All 7 programs0.40×1.00×1.26×1.16×0.92×1.37×1.08×1.82×31.09×
Without bintrees0.47×1.00×1.28×1.09×0.89×1.38×1.24×2.02×41.53×
ProgramHelium (hcn)C (gcc -O2)C (clang -O2)Rust (-O3)Zig (ReleaseFast)GoJavaNode.jsPython
fib1.3 MB2.2 MB2.2 MB2.2 MB1.3 MB1.8 MB40.9 MB54.7 MB9.6 MB
nbody1.3 MB2.1 MB2.1 MB2.2 MB1.3 MB3.5 MB47.8 MB57.8 MB10.3 MB
spectral1.3 MB2.1 MB2.2 MB2.1 MB1.3 MB5.4 MB40.5 MB57.8 MB10.3 MB
bintrees16.0 MB34.1 MB34.1 MB34.2 MB16.2 MB38.0 MB632.9 MB182.7 MB42.0 MB
fannkuch1.3 MB2.1 MB2.4 MB2.1 MB1.3 MB3.5 MB41.6 MB57.3 MB10.1 MB
mandelbrot1.3 MB2.2 MB2.1 MB2.2 MB1.3 MB1.8 MB39.5 MB57.3 MB9.7 MB
strmap7.5 MB23.9 MB24.0 MB17.8 MB10.7 MB22.6 MB164.6 MB91.8 MB31.5 MB
ProgramHelium (hcn)C (gcc -O2)C (clang -O2)Rust (-O3)Zig (ReleaseFast)GoJava (.class)
fib9 KB14 KB14 KB345 KB9 KB1,488 KB1 KB
nbody21 KB14 KB14 KB372 KB28 KB1,500 KB3 KB
spectral18 KB14 KB14 KB370 KB27 KB1,500 KB1 KB
bintrees12 KB18 KB14 KB347 KB14 KB1,500 KB2 KB
fannkuch11 KB14 KB14 KB348 KB11 KB1,500 KB1 KB
mandelbrot8 KB14 KB14 KB345 KB9 KB1,488 KB1 KB
strmap31 KB14 KB14 KB362 KB17 KB1,488 KB2 KB
ProgramHelium (hcn)C (gcc -O2)C (clang -O2)Rust (-O3)Zig (ReleaseFast)GoJava (javac)
fib30 ms45 ms45 ms76 ms146 ms33 ms269 ms
nbody69 ms60 ms64 ms95 ms306 ms34 ms283 ms
spectral54 ms53 ms68 ms98 ms355 ms35 ms298 ms
bintrees34 ms95 ms70 ms80 ms260 ms44 ms253 ms
fannkuch32 ms47 ms62 ms101 ms185 ms33 ms267 ms
mandelbrot31 ms32 ms96 ms77 ms152 ms40 ms214 ms
strmap66 ms50 ms62 ms159 ms359 ms35 ms277 ms

SHIPPED AMNI PRODUCTS ON HELIUM

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

Where Helium still loses, and what is unfinished

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.

When should I write Helium directly vs Gold?

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