Eon is a self-hosted systems programming language designed around explicit cost, static memory and resource proofs, and a zero-C, zero-LLVM native compilation pipeline across 3 CPU architectures × 6 OS targets, unified @gpu shaders (SPIR-V 1.3 + MSL 2.4), and a pure-Eon GPUI-class cross-platform UI stack (eon_win, eon_gpu, eon_text, eon_ui).
The self-hosted compiler (selfhost/src/, 47 files, ~212k LOC of 100% safe Eon) compiles Eon programs directly into native binaries — ELF64 (x86_64 / AArch64 / RISC-V 64, PIE, .so, and bare-metal nostd kernels), PE32+ (Windows .exe / .dll), Mach-O (macOS / iOS with built-in SHA-256 ad-hoc LC_CODE_SIGNATURE & .app), and Android ET_DYN + AXML + zipalign + APK Signature Scheme v2 — with DWARF5 debug info, a built-in memory sanitizer (--sanitize), deterministic multi-threaded compilation (-j 1 == -j 4 == -j 12 == auto), item-level incremental .emi builds, built-in eonc fmt & eonc lsp, and a bit-for-bit reproducible Stage 2 == Stage 3 triple bootstrap under 450 MiB Peak RSS — without invoking gcc, clang, ld, or as.
- Zero-Mercy Static Safety (
ZM-01..ZM-18):- Relational DBM + Known-Bits Verifier: Proves slice bounds, integer non-overflow, and non-zero division statically (including
min(a.len, b.len)andbase + kindexing); uncheckedbuf[i]is only accepted when proven safe, while fallible indexing (buf.at(i)) and checked arithmetic (+?,*?,/?) are explicit. - Second-Class Borrows (
*T,*mut T,view fn,view struct): Local NLL borrow checking without viral lifetime annotations. - Linear Resource Types +
errdefer: Values markedlinearmust be explicitly consumed or destroyed on every normal and error path. - Structure-of-Arrays (
pool) Built Into the Language:ArenaPool[T](branded 4-byteId[p], O(1) arena reset) andSlotPool[T](ABA-safe generationalGenId[T]), enabling 64-byte aligned column iteration and loop fusion. - Effects, Capabilities & Static Stack Budgets: Explicit
Envcapabilities (AllocCap,FsCap,DirCap,ClockCap,IoCap,ArgsCap), effect annotations (@noalloc,@noblock,@interrupt), and machine-frame verified@stack(N)bounds. - Auditable Trust Boundary (
.hal.eon+--audit-tcb): Safe.eonfiles cannot containraw, raw pointer dereferences, inlineasm, orextern "C". All unsafe/OS/hardware code is isolated in.hal.eonmodules and audited with SHA-256 digests.
- Relational DBM + Known-Bits Verifier: Proves slice bounds, integer non-overflow, and non-zero division statically (including
- Multi-Target Optimizing Compiler (
EIR-Opt,MachIR,@gpu, Zero-C Linkers):- 3 CPUs × 6 OSes (
--target=<arch>-<os>): Nativex86_64(SSE2/AVX2/FMA),AArch64(ARMv8 + NEON), andRISC-V 64(RV64IMAFD/LP64D) targetinglinux,windows,macos,android,ios, and bare-metalnostd, with@target_arch()/@target_os()/@target_is_nostd()dead-branch pruning. - SSA Optimizer & Link-Time Density: Mem2Reg, SROA, GVN-PRE, SCEV-lite, SLP + loop auto-vectorization, SoA fusion,
-Ozcode-size profile, ELF64 function dead-stripping (GC), and Safe Identical Code Folding (ICF). - Unified
@gpuShader Compiler: DirectEIR -> SPIR-V 1.3(Vertex/Fragment/Compute,spirv-valverified for Vulkan 1.1+) andEIR -> MSL 2.4(Metal) with@embed_gpu_spirv/@embed_gpu_msl. - Built-in Developer Tooling: Canonical formatter (
eonc fmt [--check]), incremental JSON-RPC Language Server (eonc lspsurfacing proven DBM intervals &@stack(N)), multi-packagebuild.eon+eon.lock+.emilibrary archives, and reference SSA interpreter (eonc run --interp).
- 3 CPUs × 6 OSes (
- Pure-Eon Cross-Platform Graphics & GPUI-Class UI Stack (
libs/+apps/eon_calc):libs/eon_win: UnifiedPlatformWindowover thin.hal.eonadapters (Wayland+X11fallback,Win32,Cocoa,Android NativeActivity,UIKit, 3-arch bare-metalnostdframebuffer, and headless test backend).libs/eon_gpu: Focused GPUI UI-RHI (Quad,Shadow,Underline,MonoSprite,PolySprite,PathVertex,ContentMask) with shared@gpushaders and exactly 3 backends: Vulkan 1.1+, Metal, and pure-Eon SIMD software rasterizer (eon_gpu_soft) — zero OpenGL, zero C toolchain.libs/eon_text: Freestandingcore/TrueType (.ttf) parser, analytical anti-aliased Bezier scanline rasterizer, shelf-packed R8GlyphAtlas, UTF-8 shaper/wrapper/hit-tester, and embedded SIL OFL UI fonts.libs/eon_ui: GPUI-class framework built on Eon'sSlotPool(Entity[T]/AppContextreactive observers withoutRc<RefCell>), Taffy-class Flexbox + 2D CSS Grid SoA &ArenaPoollayout, 3-phase lifecycle (request_layout -> prepaint -> paint), fluentdiv(),FocusTree/Keymap/Hitbox,Spring/Tweenanimations, Dark/LightTheme, and widgets (Text,TextInput,ScrollView, 100k virtualizedUniformList,Button,Toggle,Overlay) — sustaining> 135 FPS(5.3–7.3 ms/frame) on100,000live Flexbox/Grid widgets with 0 per-frame heap allocations.apps/eon_calc: Full Standard / Scientific / Programmer (HEX/DEC/OCT/BIN) GUI calculator written in 100% safe Eon (0@hal, 0raw, 0@target_*), compiling from identical source across all 10 targets (verified live on Linux Wayland+Vulkan, Windows PE32+ under Wine, and bare-metal QEMUx86_64-nostd/aarch64-nostd/riscv64-nostd).
module examples.hello;
import core.mem;
import std.rt;
pub pool Body {
pub x: f32;
pub vx: f32;
}
pub fn integrate(bodies: *mut ArenaPool[Body], dt: f32) @noalloc {
// DBM proves `i < bodies.len()` -> zero hidden bounds checks on SoA columns
for i in 0_usize..bodies.len() {
bodies.x[i] = bodies.x[i] + bodies.vx[i] * dt;
}
}
pub fn main(env: *mut Env) -> i32 ! MemError {
// Linear FrameArena MUST be destroyed on both normal and error paths
var frame = try mem.FrameArena.init(&mut env.alloc, 4096_usize);
errdefer frame.destroy(&mut env.alloc);
var bodies = try mem.init_frame_pool.[Body](&mut frame, 4_usize);
let _ = try bodies.push(.{ x: 1.0_f32, vx: 2.5_f32 });
integrate(&mut bodies, 0.5_f32);
rt.print_str("Integrated bodies: ");
rt.print_u64(bodies.len().widen.[u64]());
rt.print_nl();
frame.destroy(&mut env.alloc);
return 0_i32;
}
Rust (cargo) is required only to build the frozen Stage 0 Bootstrap Seed (compiler/, zero external crates). Once bootstrapped, selfhost/out/eonc2_rel compiles and links native binaries for all 10 targets with zero C toolchain.
# 1. Build Stage 0 Bootstrap Seed (Rust, 0 external crates, frozen)
cargo build --release --manifest-path compiler/Cargo.toml
# 2. Run full Triple Bootstrap (eonc0 -> eonc1 -> eonc2_rel == eonc3_rel, < 450 MiB RSS)
python3 tools/bootstrap_stage3.py --release
# 3. Build & run EonCalc natively on Linux (Wayland/X11 + Vulkan 1.1+)
selfhost/out/eonc2_rel build --release --audit-tcb apps/eon_calc -o /tmp/eon_calc
/tmp/eon_calc
# 4. Cross-compile the EXACT SAME apps/eon_calc source to any target (Zero-C)
selfhost/out/eonc2_rel build --release --target=x86_64-windows apps/eon_calc -o /tmp/eon_calc.exe
selfhost/out/eonc2_rel build --release --target=aarch64-macos apps/eon_calc -o /tmp/eon_calc_macos
selfhost/out/eonc2_rel build --release --target=aarch64-android --shared apps/eon_calc -o /tmp/libeon_calc.so
selfhost/out/eonc2_rel build --release --target=x86_64-nostd apps/eon_calc -o /tmp/eon_calc_x64_nostd
selfhost/out/eonc2_rel build --release --target=aarch64-nostd apps/eon_calc -o /tmp/eon_calc_a64_nostd
selfhost/out/eonc2_rel build --release --target=riscv64-nostd apps/eon_calc -o /tmp/eon_calc_rv64_nostd
# 5. Built-in formatter, LSP server, sanitizer & EIR interpreter
selfhost/out/eonc2_rel fmt --check apps/eon_calc/src/engine.eon
selfhost/out/eonc2_rel lsp
selfhost/out/eonc2_rel build --sanitize apps/eon_calc -o /tmp/eon_calc_san
selfhost/out/eonc2_rel run --interp examples/layout_proto# UI diagnostic suite (88 tests) + full selfhost regression suite (13 suites covering M1.1–M2.5)
selfhost/out/eonc2_rel test tests/ui
python3 tests/selfhost/run_regressions.py --eonc selfhost/out/eonc2_rel
# Differential & soundness mutation fuzzing
python3 tests/fuzz/soundness_fuzz.py -n 1000 --jobs 6 --eonc selfhost/out/eonc2_rel
python3 tests/fuzz/diff_backends.py --release --verify-opt -n 1000 --jobs 6 --eonc selfhost/out/eonc2_rel
# Boot EonOS-Micro (freestanding x86_64 microkernel: SMP=2, 1,000 timer IRQs, 4-level paging)
python3 kernel/run_qemu.py --eonc selfhost/out/eonc2_relMeasured on Linux x86_64 (AMD Ryzen 5 5600H, 12 logical CPUs) comparing selfhost/out/eonc2_rel --release against Safe Rust (#![forbid(unsafe_code)], -C opt-level=3 -C lto=fat -C codegen-units=1 -C panic=abort -C target-cpu=native), with bit-identical output checksums. Full tables and methodology are in bench/BENCHMARKS.md.
| Category | Metric | Eon (--release) |
Safe Rust / Target | Result |
|---|---|---|---|---|
| Runtime (11 workloads) | Geometric mean (01–11) |
11 / 11 faster | baseline | 0.7820x (~21.8% faster overall) |
08_matmul_f32 |
Dense AVX2/FMA auto-vec matmul | 193.5M instrs (-48.9% vs pre-M1.1) |
169.5M instrs |
Faster wall time, major instr gap reduction |
05_ecs_physics |
200k-body SoA sys loop |
24.08 ms | 53.30 ms | 0.452x (2.21× faster) |
10_par_reduce_graph |
Multi-core par for + graph |
30.30 ms (27.96 MiB RSS*) |
49.67 ms (32.29 MiB RSS*) |
0.610x (1.64× faster, -13.4% RAM) |
Compile (selfhost/src, 212k LOC) |
Stage 3 --release Peak RSS |
437.5 MiB (393.6 MiB -j 1) |
< 450 MiB budget |
~2× lower than pre-M1.2 865 MiB |
| Compile (31k LOC, 21 files) | Cold --release vs Cargo fat-LTO |
412.45 ms | 9,374.26 ms | 22.73× faster |
| Compile (31k LOC, 21 files) | Incremental 1-fn edit (.emi) |
37.94 ms | 711.14 ms | 18.75× faster |
Zero-libc Utilities (utils/) |
ewc / egrep (32 MiB × 20) |
8.23 / 11.70 GB/s (55–62 KiB) |
4.53 / 3.30 GB/s (2.0 MiB) |
1.82× / 3.55× faster, 32–36× smaller |
Zero-libc HTTP (ehttpd) |
4-core io_uring (96k reqs) |
377.6k RPS, p99=233 us, 616 KiB RSS |
394.5k RPS, p99=249 us, 3,028 KiB RSS |
Lower p99, 4.9× less RAM, 0.957x RPS |
EonUI 100k Widget Stress |
100,000 live Flexbox/Grid nodes | 5.28–7.29 ms/frame (137–189 FPS) |
< 8.33 ms (120 FPS) |
0 per-frame heap allocs, 0 leaks under --sanitize |
EonUI 100k Virtualized List |
UniformList (100,000 rows) |
0.029 ms/frame (34,482 FPS) |
< 8.33 ms |
O(1) visible-window layout & paint |
* Standalone fresh-process MaxRSS median (7 runs). Full caveats and measurement details are documented transparently in bench/BENCHMARKS.md.
Eon is pre-1.0. All 14 milestones across compiler optimization, multi-target codegen (3 CPUs × 6 OSes), @gpu (SPIR-V + MSL), eon_win, eon_gpu, eon_text, eon_ui, and apps/eon_calc are implemented and verified, with transparent boundaries on host testing:
- Physical Apple & Mobile Device Testing:
aarch64-macos/aarch64-iosMach-O executables (with SHA-256LC_CODE_SIGNATUREand MSL 2.4 shaders) andaarch64-android.so/APK v2 binaries are cross-compiled and structurally/cryptographically verified on Linux; live GPU execution on physical Apple Silicon (Metal) and physical Android/iOS hardware awaits dedicated hardware CI runners. - No Package Registry Yet: Multi-package local path dependencies,
eon.lock, and.emilibrary archives are built intobuild.eon, while a centralized remote package registry is planned forv1.0. - Verification Maturity: Guarded by bit-exact triple bootstrap, 13 regression suites, 88+ UI diagnostic tests, 140+ calculator unit/UI golden tests, and multi-architecture differential/soundness fuzzing, Eon has not yet undergone years of external production hardening.
- ARCHITECTURE.md — Repository map, compiler pipeline (
selfhost/src/), multi-target backends,@gpu,libs/UI stack, and.hal.eonTCB model. - ROADMAP.md — Completed phases (
0–13, including Milestones M1.1–M4.2) and Phase 14 (v1.0). - bench/BENCHMARKS.md — Full Eon vs Safe Rust benchmark tables, PMU counters,
EonUI100k stress timings, and methodology caveats. - CONTRIBUTING.md & SECURITY.md — Development workflow, Stage 0 freeze policy, and soundness reporting.
- spec/00-philosophy-and-guarantees.md — Zero-Mercy rules (
ZM-01..ZM-18), safety boundaries, glossary. - spec/01-lexical-and-syntax.md — Lexical rules, syntax, Pratt precedence table, modules, visibility.
- spec/grammar.ebnf — Formal EBNF grammar for Eon
v0.2. - spec/02-types-and-memory-layout.md — Type system, SIMD,
bitfield, SoApool, UTF-8 strings, copy threshold (<= 16 B). - spec/03-ownership-borrows-linearity.md — Second-class references,
view fn,view struct, closures,linear+errdefer,ArenaPool&SlotPool. - spec/04-verification-and-arithmetic.md — Relational DBM verifier,
wherecontracts,buf[i]vsbuf.at(i), arithmetic,core.math, error unions! E. - spec/05-generics-interfaces-comptime.md — Generics
[T], Layout Sharing,iface/implwith@stack(N),comptimeVM,build.eon. - spec/06-concurrency-and-memory-model.md —
sys,par for, 1-thread-per-core scheduler, atomics, DMA barriers. - spec/07-effects-capabilities-io.md — Effects (
@noalloc,@noblock,@interrupt),Envcapabilities,IoRing, static fibers. - spec/08-hal-ffi-and-gpu.md —
.hal.eonisolation,MmioReg,arch/, C FFI (extern "C"), and@gpu. - spec/09-abi-modules-and-hotreload.md — Native
EonCallABI,EonBin,.emimodule interface format, hot-reload. - spec/10-compiler-ir-and-bootstrap.md —
eoncarchitecture, SSAEIR, native backends, Zero-C linkers,--sanitize,--audit-tcb, and triple bootstrap. - spec/CHANGES-v0.2.md — Summary of
v0.2design decisions.
Eon is released under the MIT License.