Lea Language
Quick Start
let numbers = [1, 2, 3, 4, 5]
let result = numbers
/> filter((x) -> x > 2)
/> map((x) -> x * x)
/> reduce(0, (acc, x) -> acc + x)
result /> print
Core Principles
- Pipes:
value /> fn passes value as first arg; use input placeholder to control position
- Functions:
let double = (x) -> x * 2 (no fn keyword)
- Multi-statement bodies: Indentation-based or brace-delimited
{ }
- Decorators: Trailing
#log #memo #time #retry(3) etc. after function body
- Bindings:
let x = 10 immutable, maybe x = 0 mutable
- Records:
{ name: "Max", age: 99 } with member access record.field
- Contexts:
context Name = default + provide Name value + @Name attachments
Builtins
- Math:
sqrt, abs, floor, ceil, round, min, max
- Lists:
length, head, tail, push, concat, map, filter, reduce, range
- IO:
print (returns first arg for chaining)
- Async:
delay(ms) — promise that resolves after ms
Running
npm run repl # Interactive REPL
npm run lea file.lea # Run a file
Reference Files
- references/syntax.md - Full syntax reference
- references/architecture.md - Interpreter internals
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: lea3description: Use when writing or modifying Lea code - pipe-oriented functional language with tree-walk interpreter4---56# Lea Language78## Quick Start910```lea11let numbers = [1, 2, 3, 4, 5]1213let result = numbers14 /> filter((x) -> x > 2)15 /> map((x) -> x * x)16 /> reduce(0, (acc, x) -> acc + x)1718result /> print19```2021## Core Principles2223- **Pipes**: `value /> fn` passes value as first arg; use `input` placeholder to control position24- **Functions**: `let double = (x) -> x * 2` (no fn keyword)25- **Multi-statement bodies**: Indentation-based or brace-delimited `{ }`26- **Decorators**: Trailing `#log #memo #time #retry(3)` etc. after function body27- **Bindings**: `let x = 10` immutable, `maybe x = 0` mutable28- **Records**: `{ name: "Max", age: 99 }` with member access `record.field`29- **Contexts**: `context Name = default` + `provide Name value` + `@Name` attachments3031## Builtins3233- Math: `sqrt`, `abs`, `floor`, `ceil`, `round`, `min`, `max`34- Lists: `length`, `head`, `tail`, `push`, `concat`, `map`, `filter`, `reduce`, `range`35- IO: `print` (returns first arg for chaining)36- Async: `delay(ms)` — promise that resolves after ms3738## Running3940```bash41npm run repl # Interactive REPL42npm run lea file.lea # Run a file43```4445## Reference Files4647- [references/syntax.md](references/syntax.md) - Full syntax reference48- [references/architecture.md](references/architecture.md) - Interpreter internals4950---51> Converted and distributed by [TomeVault](https://tomevault.io/claim/mcclowes) — claim your Tome and manage your conversions.52<!-- tomevault:4.0:skill_md:2026-04-13 -->