Capabilities, not ambient power
The core language can’t do IO or allocate. A file declares uses io, alloc, and main passes the values down, so a signature shows what a function can touch.
Egg is a systems language where memory is safe without a GC or lifetime annotations. It compiles to portable C99, and it is designed to be written by AI and read by people.
curl -fsSL https://raw.githubusercontent.com/femto/egg/main/install.sh | shirm https://raw.githubusercontent.com/femto/egg/main/install.ps1 | iexNative eggc and clutch for Linux, macOS and Windows. You also need a C compiler.
uses alloc, io
fn greet(io: Io, a: Allocator, name: str) void {
const msg = a.concat("hello, ", name)
defer a.free(msg)
io.print(msg)
}
fn main(io: Io, a: Allocator) void {
greet(io, a, "egg")
}
The core language can’t do IO or allocate. A file declares uses io, alloc, and main passes the values down, so a signature shows what a function can touch.
A buffer has one owner. Use after free, double free and leaks are compile errors, with no lifetime annotations.
No undefined behaviour outside allow unsafe code. Integer overflow, integer division by zero and out-of-bounds indexing panic.
Near C on most programs, with every check on, and 1.3 to 5.6 times the Rust port’s throughput on a real web app’s benchmark routes, both with caches on (numbers).
Owned values move between threads over channels; what they share is immutable (Shared(T)) or atomic, as in Erlang, so there are no locks.
Strict errors with stable codes, diagnostics as JSON (eggc check --json), and the whole spec in one command (eggc spec) to paste into a prompt.
eggc, the first compiler, is written in Ruby and also builds as native binaries with Spinel. Modules, capabilities, integer types, pointers, extern fn, owned buffers and memory without a GC are done. Egg is young: expect breaking changes.