Amber for Mortals
This is a course, not a reference. It assumes you can program and have never used an array language, and it is ordered so that each chapter only needs the ones before it. Worked all the way through it is an afternoon; the first three chapters are the ones that change how you think and are worth doing slowly.
The code blocks are extracted and run against a real Amber build as part of publishing. An example that does not work cannot reach this site.
The path
Read them in order. Chapters 1 to 4 are the language; 5 to 6 are data and querying; 7 to 8 are what Amber is for.
| # | chapter | what you get |
|---|---|---|
| 1 | Thinking in arrays | the mental shift; right-to-left; why there is no precedence |
| 2 | Your first session | a prompt, the type system, atoms vs vectors, nulls |
| 3 | Verbs | the twelve you use constantly, grouped by intent |
| 4 | Adverbs | each, over, scan and prior, where the power lives |
| 5 | Dictionaries and tables | the column store, keyed tables, and what a table really is |
| 6 | qSQL | select / by / where, sorted and limited selects, fby |
| 7 | Time series | joins including as-of, temporal types, bars, attributes |
| 8 | Making it fast | fusion, moving windows, group aggregates, charts, parallelism |
Before you start
You need a terminal and a C compiler. Nothing else: no runtime, no package manager, no daemon.
git clone https://github.com/BonucciAndrea/amber
cd amber
./aThat builds and drops you at a prompt. Keep it open while you read: every chapter assumes you are typing along, and none of this sticks by reading alone.
If you already know q or k
Start at chapter 3 and skim. The things that will catch you out are collected in Gotchas, and the dialect differences, which are real, are in the language reference under dialect notes. The short version: two-argument library functions take brackets, there is no select[n]-free ordering clause, and ss is string-search so the time accessor is sec.