For agents
Aleph is written mostly by agents, so the first reader of this page is a model.
Load the language
Section titled “Load the language”The complete language fits in one file, llms.txt, under 2,000 tokens. It is generated by the compiler from its own tables, so it cannot drift from what the compiler accepts, and its examples all pass aleph check.
aleph llms > context.txtPut it in the agent’s context, system prompt or a skill. Nothing else is needed to write valid programs.
The working loop
Section titled “The working loop”- Write the whole file:
uselines, thentype, thenfnitems sorted by name,mainlast. - Run
aleph check FILE --json. - Read each diagnostic:
code,node,expected,found. If there is afix, apply it to that node. - Repeat until check is clean. Examples run as part of check.
- Run
aleph explain FILEand show it to the person: it is what they approve.
Rules that save attempts
Section titled “Rules that save attempts”- Every function except
mainneeds at least oneexline, unless it calls an effectful builtin. - Calls have fixed arity and no parentheses:
+ fib - n 1 fib - n 2isfib(n-1) + fib(n-2). ok,errandnoneneed an expected type; inside a function returningres T Ethat is automatic.- Bindings are immutable and may not shadow anything (
T005). - There are no loops in v0.1: use recursion,
range,map,filterandfold.