CleverLang
Fast, proven systems code — too clever to trap, leak, or overflow.
C speed · 0-trap Wasm · Metal & CUDA · Built-in Lean proofs · Secret<T>
Apple M5 Max · Wave 01 preview · verified 0 runtime traps in the cores
1.Fast — without the footguns.
CleverLang compiles to plain C11, zero-import WebAssembly, freestanding -nostdlib MMIO, Metal, and CUDA. No GC, and no runtime traps in @noabort(strict) code.
clever-server
✓ 46 laws · 0 traps in the cores3.58M req/s
HTTP/2 plaintext: 19.3× nginx, 2.85× H2O
HTTP/2 plaintext clever-server3.58M req/sH2O1.25Mnginx189kCaddy118kvs nginx, H2O, Caddy, HAProxy and hyper39W / 10T / 7LWhere it loses
clever-server
✓ 46 laws · 0 traps in the cores- 64 KB static files vs H2O (0.752×)
- 64 KB proxy vs H2O (0.890×) and nginx (0.899×)
- TLS HTTP/2 proxy vs nginx (0.728×)
- JSON vs nginx (0.901×), and TLS 1 KB proxy vs HAProxy (0.905×) and hyper (0.914×), measured on a loaded host
- 15 scenarios, 56 pairings. 4.0 MB RSS on HTTP/1.1.
clever-regex + clever-rg
✓ 0 traps in the search cores6.7× Rust regex
extracting Unicode identifiers; 98 of 102 rows win
Extract identifiers, Unicode6.7× clever-regex270 MB/sRust regex40 MB/sclever-regex vs Rust regex98W / 4T / 0Lclever-rg vs ripgrep27W / 6T / 3LWhere it loses
clever-regex + clever-rg
✓ 0 traps in the search cores- PCRE2’s JIT wins some regex patterns
- Three many-file directory walks trail ripgrep (1.06–1.14× its time)
- clever-rg’s command-line layer still has run-time checks
- Regex: 102 rows in two suites. clever-rg: 36 rows, output identical to ripgrep’s sorted output.
clever-json / zstd / jpeg
✓ 0 C and Wasm traps in the cores0 parse losses
vs the simdjson DOM (1W / 5T), 1.017× libzstd decoding, 1.081× libjpeg-turbo encoding
JSON DOM parse vs simdjson1W / 5T / 0Lzstd decode vs libzstd18W / 17T / 13LJPEG encode vs libjpeg-turbo24W / 0T / 2LWhere it loses, and more results
clever-json / zstd / jpeg
✓ 0 C and Wasm traps in the cores- 13 of 48 zstd frames, and compression at L1 and L3, trail libzstd
- 256×256 JPEG encode trails libjpeg-turbo (0.947–0.959×)
- 2 of 16 JPEG decodes trail libjpeg-turbo
- Outside parsing, 3 JSON rows trail simdjson; yyjson wins one parse file
- Ratios are geometric means.
cleverio
✓ 25 laws · 500-seed sim clean2.51× tokio
on 1→1 MPSC, 108× on actor RPC, 1.01–1.02× on 4 KiB TCP echo at 256 and 1,000 connections
MPSC, 1→12.51× cleverio70.9M msg/stokio 1.5428.2Mvs Rust tokio 1.548W / 1T / 3LWhere it loses, and more results
cleverio
✓ 25 laws · 500-seed sim clean- 64 B TCP echo at 64 and 256 connections (0.95×, 0.96×)
- 4 KiB TCP echo at 64 connections (0.98×)
- 12 workloads vs Rust tokio 1.54, 4 threads each.
2.Proven — inside the compiler.
Write a law next to the function. The compiler’s bitvector kernel covers all 264 values of every input in milliseconds, and hands humans — or coding agents — the exact counterexample when code is wrong.
export fun moved( amount: U64, from: U64, to: U64 ): U64 = amount
✗ Counterexample: amount = 1, from = 0.
It moves money the account doesn’t have.
export fun moved( amount: U64, from: U64, to: U64 ): U64 = if (amount > from) { 0 } else { amount }
✗ Counterexample: to + amount wraps.
The receiver’s balance overflows the largest U64.
export fun moved( amount: U64, from: U64, to: U64 ): U64 = if (amount > from) { 0 } else if (to +% amount < to) { 0 } else { amount }
✓ PROVEN for all 264 values of every input.
All three tries checked in 0.4 s on an M5 Max.
law safe_to_move(amount: U64, from: U64, to: U64): moved(amount, from, to) <= from && to +% moved(amount, from, to) >= to proof by bv law moves_all_or_nothing(amount: U64, from: U64, to: U64): amount > from || to +% amount < to || moved(amount, from, to) == amount proof by bv
3.Hold it up to the glass.
Drag the glass over CleverLang source to see what the compiler emits — zero-trap ARM64, Metal GPU kernels, or compile-time rejections — or run the Wasm live.
export fun sumTo(n: U64): U64 {
val lim = if (n < 1000) { n } else { 1000 }
var acc = 0u64
for (i in 0u64 until lim) {
acc = acc +% i
}
acc
}cbz x0, LBB0_2 mov w8, #1000 cmp x0, #1000 csel x8, x0, x8, lo sub x9, x8, #1 sub x8, x8, #2 mul x10, x9, x8 umulh x8, x9, x8 extr x8, x8, x10, #1 add x0, x9, x8 LBB0_2: ret
The loop folds into a closed formula. Ten instructions and a return, no loop left.
4.Release waves.
We’re releasing 26+ systems libraries in four waves — one wave at a time, with raw logs and honest losses.
- WAVE 01LIVE
Core & Web
Web server, regex & ripgrep, JSON/zstd/JPEG codecs, work-stealing async runtime.
- WAVE 02NEXT TIDE
Crypto & Network
WireGuard VPN, Post-Quantum TLS 1.3, QUIC / HTTP/3, Post-Quantum SSH, X.509 & DNS — constant-time Secret<T>.
- WAVE 03UPCOMING
Storage, eBPF & Bare Metal
Embedded ACID B+Tree + WAL database, RFC 9669 eBPF verifier, Protobuf codec, -nostdlib ARM64 / VirtIO / NVMe drivers.
- WAVE 04UPCOMING
Metal, CUDA & Verifiable Compute
Zero-spill GPU kernels from the same language: LLM inference on Metal/CUDA and verifiable compute.
5.Trust, itemized.
What a build proves, what it checks, what is only tested, and what you still have to trust.
- PROVEN
- user-written laws, across all 264 values of every inputeliminated bounds and overflow checks
- CHECKED
- 0 runtime trap sites in
@noabort(strict)codeownership and&mutaliasingSecret<T>taint isolation - TESTED
- parser, lowering, C and Wasm printersmutation testing and ASan/UBSan fuzzing
- TRUSTED (TCB)
- proof kernel, language semantics modelC compiler (
clang), CPU hardware
A proof covers only the laws you write. Every shipped library also runs mutation testing and fuzzing.
6.Read the Book.
Eight short chapters, from your first function to your first proof.
- 01QuickstartWrite it, prove it, and ship it to C, WebAssembly and JavaScript.
- 02Language tourValues, types, loops, errors and collections.
- 03BorrowingOwnership without lifetimes.
- 04Proofs and trustState what must be true, then read the receipt.
- 05Power, tasks, GPUNo power by default, tasks that can’t escape, loops on the GPU.
- 06SecretsKeep secrets out of branches, lookups and timing.
- 07From Rust, Kotlin, LeanWhat you already know, translated.
- 08ReferenceSyntax, tactics and commands on one page.