Sign In Developer Vault
FluxionLabs / Documentation / Aether Language Reference
Toolchain Matrix

Aether CLI Toolchain (`ae`)

The reference toolchain provides a single unified command interface for instant script execution, AOT native compilation, differential test suites, and automated Python migration.

ae run <file.ae>
--jit | --interpret

Executes code directly using the 3-tier Aether Virtual Machine (AVM).

ae build <file.ae>
--native -O3 --target=x86_64|esp32|cuda

Compiles AOT directly through the self-hosting deterministic C backend.

ae test
--verify-z3 --bench

Runs test suites with automated Z3 SMT solver bounds and memory safety verification.

ae deps add <pkg>
--git | --hash

Adds a cryptographically verified dependency to aether.lock.

ae migrate <python_file.py>
--strict-types

Transpiles Python numerical loops into high-performance native Aether modules.

Interactive Code Tour

Real Aether Examples (`D:\Aether\examples`)

Toggle between production examples illustrating concurrency, bare-metal register manipulation, GPU tensor fusion, and isomorphic web apps:

examples/fibers.ae — Chase-Lev Work-Stealing M:N
module fibers

import std.time

fn worker(id: Int, ch: chan<Int>):
    for i in 0 .. 1000:
        ch.send(id * 1000 + i)
        # Yields cooperatively if timeslice elapsed (10ms)

fn main():
    ch := chan<Int>::new(1024)
    # Spawns 1,000 lightweight stackful fibers
    for id in 0 .. 999:
        spawn || worker(id, ch)
    
    total := 0
    for _ in 0 .. 999_999:
        total += ch.recv()
    println(f"Processed 1,000,000 messages. Total checksum: {total}")
examples/gpu_pipeline.ae — CUDA / ROCm / WebGPU
module gpu_pipeline

import std.tensor

# Fused GPU Kernel: stays resident in VRAM across invocations
@gpu
fn attention_block(q: Tensor, k: Tensor, v: Tensor, w_out: Tensor) -> Tensor:
    # Compile-time kernel fusion combines scale + softmax + value dot
    scores := (q @ k) * 0.125
    attn := scores.softmax(dim = 1)
    context := attn @ v
    return context @ w_out

fn main():
    q := Tensor::randn([128, 64])
    k := Tensor::randn([64, 128])
    v := Tensor::randn([128, 64])
    w := Tensor::randn([64, 64])
    out := attention_block(q, k, v, w)
    println(f"Computed attention output shape: {out.shape}")
examples/payment_engine.ae — Zero-Drift Dec128
module payment_engine

type Account:
    id: u64
    balance: dec128  # 128-bit IEEE-754 decimal floating point

fn transfer(from_acc: &mut Account, to_acc: &mut Account, amount: dec128):
    if from_acc.balance < amount:
        panic("insufficient balance")
    from_acc.balance = from_acc.balance - amount
    to_acc.balance = to_acc.balance + amount

fn main():
    mut alice := Account(1, $1000.50)
    mut bob := Account(2, $45.25)
    transfer(&mut alice, &mut bob, $19.99)
    # Guaranteed exact decimal math: no binary floating point drift!
    println(f"Alice: {alice.balance}, Bob: {bob.balance}")
examples/web_shop.ae — Isomorphic @client WASM & @server RPC
module web_shop

type Quote:
    sku: Str
    unit_price: dec128
    in_stock: Int

@server
fn get_quote(sku: Str) -> Quote!Error:
    if sku == "":
        throw Error("missing sku")
    return Quote(sku, $19.99, 42)

@client
component Shop(sku: Str):
    state quote = get_quote(sku).unwrap_or(Quote("?", $0.00, 0))
    state qty = 1
    <div class="shop-panel">
        <h2>"Aether Isomorphic Shop"</h2>
        <p>{f"{quote.sku}: {quote.unit_price} each, {quote.in_stock} in stock"}</p>
        <p>{f"{qty} x {quote.unit_price} = {quote.unit_price * dec(qty)}"}</p>
        <button on_click=fn(): qty = qty + 1>"+1"</button>
    </div>
examples/uart_driver.ae — ESP32 Bare-Metal Register MMIO
module uart_driver

# Disallows all heap allocations; Z3 proves memory bounds statically
@kernel(no_alloc = true, stack_max = 1024)
fn send_telemetry_packet(uart_base: u32, payload: [u8; 16]):
    fifo_reg := volatile_ptr::<u32>(uart_base + 0x00)
    for i in 0 .. 15:
        # Z3 verifies i < 16; zero bounds-check instructions emitted
        fifo_reg.write(u32(payload[i]))

fn main():
    packet := [0xAA, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
               0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x55]
    send_telemetry_packet(0x60000000, packet)
Zero-Allocation Standard Library

Standard Library Modules

std.http Deterministic Allocation Contract

Non-blocking HTTP/1.1 & HTTP/2 fiber client and server with zero-copy buffer pooling.

Primary Exported Functions
http.bind(addr) http.get(url) http.post_json(url, body) Response.stream()
Allocation Guarantee: Bounded pool, 0 allocations per sustained keep-alive stream.
std.sqlite Deterministic Allocation Contract

High-concurrency SQLite driver with automated WAL-mode PRAGMA orchestration and statement caching.

Primary Exported Functions
sqlite.open(path) db.execute(sql, params) db.query(sql) db.transaction()
Allocation Guarantee: Zero marshaling overhead directly into Aether struct memory.
std.fs Deterministic Allocation Contract

Deterministic asynchronous filesystem streams backed by io_uring on Linux and IOCP on Windows.

Primary Exported Functions
fs.read_file(path) fs.write_file(path, bytes) fs.open_async(path) File.seek()
Allocation Guarantee: DMA direct-to-buffer alignment, bypassing kernel page cache when requested.
std.crypto Deterministic Allocation Contract

Constant-time cryptographic primitives including ChaCha20-Poly1305, Ed25519, and SHA-3/Keccak.

Primary Exported Functions
crypto.sign(key, msg) crypto.verify(key, msg, sig) crypto.sha3_256(data)
Allocation Guarantee: Guaranteed zeroize on drop via Perceus destructive reuse hooks.
std.net Deterministic Allocation Contract

Cross-platform netpoller abstraction (epoll/kqueue/IOCP) tightly coupled to the Chase-Lev scheduler.

Primary Exported Functions
net.tcp_listen(port) net.dial_tcp(addr) net.udp_socket() Poller.poll()
Allocation Guarantee: Preallocated ring buffers with zero GC latency.
std.time Deterministic Allocation Contract

Nanosecond monotonic and real-time clock primitives with hardware cycle counters (RDTSC).

Primary Exported Functions
time.now_monotonic() time.sleep_fibers(duration) time.rdtsc()
Allocation Guarantee: Zero heap interaction; pure hardware register reads.