Prologue · Buenos Aires, 1945

In a story by Jorge Luis Borges, a man goes down to a cellar and finds, under the nineteenth step, a point a few centimetres wide that holds the whole universe. Every place at once, seen from every angle, and nothing blurred into anything else.

«todos los lugares del orbe, vistos desde todos los ángulos» — J. L. Borges, El Aleph

Aleph took its name, and the names of its parts, from that cellar and from another story of his, about a world invented by a secret society of encyclopaedists. Each part does in code what the place does in the fiction.

I · Aleph

The point that holds the whole program.

Borges could only list what he saw, one thing after another. An agent opening an Aleph file sees it all at once:

the one permission the program asks for, written once at the top; every example it promises to satisfy, and whether it does; every node by its name, from n0 onward; every function that calls every other; the error a missing line would raise and the exact node to fix; the same program as the interpreter runs it and as the machine runs it, byte for byte. And nothing confused with anything else.

One canonical form per program. The formatter refuses any other, so two agents writing the same function write the same file.

$ aleph fmt add.aph
fn add a:i64 b:i64 -> i64
 ex add 2 3 = 5
 let s + a b
 s

Out of order, the same function is rejected with F001 not in canonical form, and the diagnostic carries the canonical text to paste back.

II · Tlön

A world that only has the borders you give it.

In the second story, Tlön is a planet that exists only in an encyclopaedia, until its objects start turning up in ours. Here Tlön is the runtime: the place where Aleph programs live, with its memory, its builtins and its borders.

A program declares the world it needs. The compiler refuses any path outside it it can see, and Tlön stops at run time whatever the compiler could not see, even a path assembled from pieces to slip out with ../.

escape.aph
use fs.read "data"
fn main -> res unit str
 let p cat "data/" "../x"
 let text try read p
 ok nil
$ aleph run escape.aph
"code":"R003", "node":"n12",
"msg":"capability violation"

III · Orbis Tertius

The society that writes the encyclopaedia.

In Borges, Tlön is the work of a secret society, generation after generation, writing the encyclopaedia of a world. Orbis is that society, made of agents: they write Aleph, the compiler checks every line, and only verified programs go into the corpus. Aleph itself is being built this way, by an agent working in a loop, day and night.

For you, Orbis is a cycle of six steps. You ask in plain words; you sign off on what the program may touch.

  1. 01 · ask"Top 10 words in report/"Natural language in, nothing else. The person never has to open the file.
  2. 02 · writeThe agent loads llms.txtThe whole language fits in under 2,000 tokens of context, with ten verified examples.
  3. 03 · checkErrors arrive as JSONCode, node id, expected and found. The agent repairs the exact node instead of guessing.
  4. 04 · testExamples run on every checkAn ex line is a test. A function without one does not compile.
  5. 05 · approveRead what it may touchaleph explain lists capabilities and effects. Undeclared access stops the program.
  6. 06 · runInterpret it or build it nativeSame output, byte for byte, from the interpreter and the C backend.

IV · Uqbar

A country you find only if you know what to look for.

Uqbar appears in a single copy of a single encyclopaedia, and in no atlas. It will be Aleph’s registry: every verified function kept under the hash of its meaning, found by signature or by intent, never browsed.

Not built yetuqbar find "words in a string"
→ sha256:[…] words s:str -> i64 · 1 example
On the roadmap after v0.2. Like the country, it exists so far in one document: ours.
Next · InterludeThe same task, written three times →