Aela Programming Language

Aela is a safety critical systems programming language for domains like aircraft, vehicles, medical devices, factories and government systems, but it works just as well for general-purpose software, such as tools, servers and libraries, on Linux, macOS, Windows and bare metal.

What Aela Does

  1. 01

    Proofs in the Compiler

    Write what a function needs and what it promises with #requires and #ensures, and what a loop keeps true with #invariant. aec --verify proves them, and proves that every sum, index and cast stays in range. You need no other tool.

  2. 02

    Nothing Hidden

    No exceptions, no unwinding, no operator overloading and no implicit conversions. Every failure a function can return is in its signature, and the caller must handle it. Every place where async code can pause is marked with await.

  3. 03

    A Toolchain You Can Check

    The compiler is written in Aela, with no C and no LLVM, and writes plain assembly. It is built from a seed of 8,600 lines of assembly. Each release is built two separate ways, and both must give the same result. Every program records what built it (aec provenance).

  4. 04

    Memory Safety Without Lifetimes

    Every reference names the variable it borrows from. The compiler uses that to stop dangling references, use after move, and two writers changing the same data. You never write lifetimes in your code.

  5. 05

    From Servers to Bare Metal

    Linux, macOS and Windows on x86-64 and AArch64, plus bare-metal AArch64. For bare metal, a module that needs an operating system is refused when you compile. A target can set flash and RAM budgets, and the build fails if the program is over them.

  6. 06

    Small Language

    Aela has one clear way to do most things, so there are fewer patterns to learn. No macros, no inheritance and no overloading. Code reads the same from one author to the next.

Verification Failures Parallelism Regions HTTPS Hello
verify.ae
1// Contracts the compiler proves: aec --verify verify.ae
2// A refinement type: an i64 that is always a valid percentage.
3type Percent = { p: i64 where 0 <= p && p <= 100 };
4
5#let before = n;
6#requires before >= 0 && before < 1000;
7#ensures result == before + 1;
8fn bump(n: i64) -> i64 { return n + 1; }
9
10// the average of xs, proven in range: every element is a Percent
11fn average(xs: &Percent[]) -> Percent | Overflow | DivByZero {
12 #let count = xs.len;
13 var total: i64 = 0;
14 var i: i64 = 0;
15 #invariant 0 <= i && i <= count;
16 #variant count - i;
17 while (i < xs.len) {
18 (total += xs[i])?;
19 i += 1;
20 }
21 let mean: i64 = (total / xs.len)?;
22 // without this check: error E0813, mean is not proven to be a Percent
23 if (mean < 0 || mean > 100) { return 0; }
24 return mean;
25}
26
27fn main() -> i32 | Overflow | DivByZero {
28 let scores: Percent[] = [72, 95, 88];
29 println("bump: \(bump(41)), average: \(average(&scores)?)");
30 return 0;
31}

More About the Language

Aela 3.0.0 — Community Edition

The compiler, the runtime and the standard library, under the MIT license. To build programs you only need an assembler and a linker: as and ld on Linux, clang on macOS, or LLVM's clang and lld-link on Windows, where aec writes the assembly and you link it.

SHA256SUMS · its signature

install.sh
1# macOS and Linux: unpack the archive and run its install script.
2# It puts aec in ~/.local/bin (or the folder you give it).
3tar xzf aela-3.0.0-macos-arm64.tar.gz
4sh aela-3.0.0-macos-arm64/install.sh
5aec --version
6
7# Windows, in PowerShell: unzip the archive and run its install script.
8# powershell -ExecutionPolicy Bypass -File aela-3.0.0-windows-x64\install.ps1
9
10# The docs are in the compiler.
11aec docs closures # search the language docs
12aec doc std/http # show a standard library module
13aec explain E0408 # explain an error code

Each package has a SHA256SUMS file and a signature, which you can check with ssh-keygen -Y verify -n aela-release. The assembly package has the compiler for every target as source code, so you can build it yourself instead of trusting our binary.

The Zap Editor, built in Aela.

What Aela Is Not