Clean, Expressive Syntax
Lea's pipe operator /> makes data transformations readable and composable. Chain operations naturally from left to right.
- No nested function calls
- Clear data flow
- Immutable by default
let numbers = [1, 2, 3, 4, 5]
let sumOfSquares = numbers
/> filter((x) -> x > 2)
/> map((x) -> x * x)
/> reduce(0, (acc, x) -> acc + x)
sumOfSquares /> print -- 50Why Lea?
A modern language designed for clarity, composability, and developer joy.
Pipe-Oriented
Write data transformations that read naturally from left to right. The /> operator passes values through function chains, eliminating nested calls and making your code more readable.
First-Class Pipelines
Pipelines are values you can store, compose, and inspect. Create reusable transformation chains, visualize them, and apply algebra operations like union and intersection.
Functional by Default
Immutable bindings with let, pure functions, and decorators like #memo and #log. Opt into mutability with maybe when you need it.
Built-in Concurrency
Async/await support, parallel pipes with \>, and the parallel() builtin make concurrent operations simple and safe.
Powerful Decorators
Add behavior to functions with trailing decorators:#log, #memo, #retry(3),#timeout(1000), and more.
Interactive Learning
Built-in REPL with an interactive tutorial, help system, and runnable examples. Type .tutorial to start learning immediately.
How Lea Compares
See how common patterns look in Lea versus other languages.
| Pattern | Lea | JavaScript | Python |
|---|---|---|---|
| Data transformation | numbers /> filter(isEven) /> map(double) | numbers.filter(isEven).map(double) | list(map(double, filter(isEven, numbers))) |
| Function composition | let process = /> step1 /> step2 /> step3 | const process = (x) => step3(step2(step1(x))) | process = lambda x: step3(step2(step1(x))) |
| Parallel execution | data \> (fetchA, fetchB, fetchC) | await Promise.all([fetchA(data), ...]) | await asyncio.gather(fetchA(data), ...) |
| Memoization | let fib = (n) -> ... #memo | // Requires library or manual impl | @functools.lru_cache |
| Spread over list | items />>> processItem | items.map(processItem) | [processItem(x) for x in items] |
Quick Start
Get up and running with Lea in seconds.
Try without installing
npx lea-lang hello.leaInstall globally
npm install -g lea-langStart the REPL
lea --repl