A functional, C-like programming language designed for solving Advent of Code puzzles. Read the docs →
- First-class functions and closures with tail-call optimization
- Functional pipelines (
|>) and composition (>>) - Pattern matching with
matchexpressions and guards - Lazy sequences and infinite ranges (
1..) - Persistent immutable data structures
- Placeholder syntax (
_ + 1) for concise lambdas - Built-in memoization support
- Rich built-in function library for AoC puzzles
- AoC runner with automatic input fetching
// Pattern matching
let fibonacci = |n| match n {
0 { 0 }
1 { 1 }
n { fibonacci(n - 1) + fibonacci(n - 2) }
};
// Pipelines and functional operations
let result = 1..10
|> filter(|n| n % 2 == 0)
|> map(_ * 2)
|> sum;
// Lazy infinite sequences
let evens = 0.. |> filter(|n| n % 2 == 0) |> take(5);
A complete solution for AoC 2015 Day 1:
input: read("aoc://2015/1")
part_one: {
input |> fold(0) |floor, direction| {
if direction == "(" { floor + 1 } else { floor - 1 }
}
}
part_two: {
zip(1.., input) |> fold(0) |floor, [index, direction]| {
let next_floor = if direction == "(" { floor + 1 } else { floor - 1 };
if next_floor < 0 { break index } else { next_floor }
}
}
test: {
input: "()())"
part_one: -1
part_two: 5
}
The language has multiple implementations (affectionately called "reindeer") exploring different execution models and technologies.
| Codename | Type | Language |
|---|---|---|
| Comet | Tree-walking interpreter | Rust |
| Blitzen | Bytecode VM | Rust |
| Dasher | LLVM native compiler | Rust |
| Donner | JVM bytecode compiler | Kotlin |
| Vixen | Embedded bytecode VM | C |
| Prancer | Tree-walking interpreter | TypeScript |
| Name | Description | Language |
|---|---|---|
| Workbench | Desktop IDE | Tauri/React |
| Tinsel | Code formatter | Zig |
