Deterministic Memory,
Formal Typing & Dual-Engine AVM
The mathematical design behind Aether's ability to unify bare-metal microcontrollers, cooperative fiber concurrency, and GPU tensor compute without garbage collection pauses.
1. Perceus Reference Counting & Destructive Reuse
Traditional languages force an unacceptable trade-off: non-deterministic stop-the-world GC pauses (Go, Java, Python), or tedious lifetime and borrow-checker annotations that complicate systems modeling (Rust, C++). Aether implements Perceus Reference Counting: an exact static analysis that transforms functional updates into in-place destructive mutation whenever a reference count is uniquely 1 (\(rc = 1\)).
# Pure functional transform of a 4096x4096 matrix buffer
fn normalize_weights(w: Tensor) -> Tensor:
# Syntactically creates a transformed tensor
return w.map(fn(x): (x - 0.5) * 2.0)
fn main():
mut weights := Tensor::randn([4096, 4096])
for epoch in 0 .. 1000:
# Local's last use moves memory; rc stays 1
weights = normalize_weights(weights)
// Zero heap malloc! Buffer reused in-place if rc == 1
if (ae_is_unique(w)) {
// In-place destructive reuse: overwrites in CPU cache
float* raw = (float*)w->data;
for (size_t i = 0; i < 16777216; ++i) {
raw[i] = (raw[i] - 0.5f) * 2.0f;
}
return w; // Reuses same pointer
} else {
return ae_tensor_clone_map(w);
}
2. Formal Typing Inference Rules
Aether's typing judgments incorporate hardware capability effects directly into the inference relation \(\Gamma \vdash e : \tau \ \& \ \Phi\), where \(\Phi\) denotes the hardware constraint effect.
Statically proves that no heap allocations (\(\text{Alloc} = \emptyset\)) occur within the marked block. The integrated Z3 solver statically verifies index safety, allowing the compiler to safely omit runtime bounds-checking branches.
Proves static shape dimension alignment (\(K = K\)) at compile time. When chained with activations (e.g. \((A @ B).\text{relu}()\)), operations are fused into a single GPU register pass without writing intermediate results to VRAM.
Lowers early returns to single register test-and-branch instructions. No C++ exception tables (Dwarf CFI) or stack unwinding machinery required.
3. Dual-Engine Architecture: Native AOT C vs 3-Tier AVM
Deterministic Native AOT C Backend
Lowers Aether AST directly to standard C99/C11 and compiles via bundled Zig CC, Clang, or GCC.
- ✓ Unboxed Int/Float/Bool/dec128 values
- ✓ M:N fibers on Chase-Lev work-stealing scheduler
- ✓ OS-thread `parallel for` with work chunking
- ✓ Incremental: one cached object per function
3-Tier AVM (Aether Virtual Machine)
Register-based virtual machine with 64-bit instruction words and multi-tier adaptive compilation:
4. 3-Stage Self-Hosting Deterministic Bootstrap
The reference compiler achieves bit-for-bit reproducible self-hosting across 3 stages, eliminating trusting-trust security vectors.
aetherc-boot.py
Pure Python 3.10+ reference lexer, parser, SMT checker, and C generator with zero required external dependencies.
aetherc-stage1
Aether compiler written in pure *.ae, compiled natively via Stage 0. Implements Perceus and SMT solvers.
aetherc-release
Recompiled by Stage 1. Output binary is bit-identical to Stage 3 recompilations (verified via BLAKE3 hash).