🌐 English · Japanese
In the tradition of "The Little Schemer."
This is not a reference and not a textbook — the guide is the textbook. This is a drill book: a long conversation of small questions and small answers, each one a half-step past the last. It teaches your hands the parts of Align that are unlike other languages — pipelines, match, Move, arenas, and turning data sideways into columns — until the idioms come out on their own.
It does not tour every syntax form or library module. It has succeeded when a problem you have not seen before makes you ask the Align questions on your own: What is the shape of the data? Is this a flow, a choice, or a control circle? Who owns it, how long does it live, which columns will the machine touch, and where is the cost written? The aim is not to leave you acquainted with Align. It is to make you an aligner.
Read a question. Answer it out loud before reading the answer. If you were right, keep going; if you were wrong, back up a few questions — the answer was built there. When a program appears, you may run it (alignc run), but try to be the compiler first: most questions can be answered with nothing but the previous page.
Keeping align-repl open beside the book suits the drill rhythm: it starts empty, an answer is one line, and the program grows with you instead of becoming a new file per question. Predict the answer, type it, and compare. It compiles and runs natively rather than interpreting, so a wrong prediction is corrected by the real compiler; :list shows the program the chapter has built up so far, and :save turns it into a file when a drill grows into something you want to keep. See chapter 16 of the guide.
Some answers are one word. Some questions look identical to the one before — the difference is the lesson. And when a rule has earned it, it is carved into a Commandment.
After the first trip through the book, take one program you liked and read it again without running it. Predict its answer. Trace the data. Point to where every value dies. Count the passes, allocations, and copies. The final chapter teaches this second reading. Recognition makes a page feel familiar; recall makes the language yours.
- Toys — values, bindings, and functions
- Do It Again —
map - Keep Some —
whereand field projections - Collapse It — reductions:
sum,count,reduce, and friends - Chains — whole pipelines, and why they cost one loop
- One of Many — sum types and
match - Maybe, or It Failed —
Option,Result,? - Whose Is It? — Copy, Move, arenas, and
.clone() - Turn It Sideways —
soa: data as columns - Count Me by Name —
group_by,agg,dict_encode - Do It Until — the
loopexpression, when a pipeline can't say it - Do It Apart — Pure work,
par_map, and structured tasks - Four at a Time — explicit SIMD, vectors, and masks
- The Big Crunch — mmap, zero-copy pipelines, and putting it all together
- Read It Four Ways — answer, flow, lifetime, and work
Everything here runs with today's alignc. Bon appétit.