documentation
Reference card
Every l primitive on one page — monadic and dyadic glyphs, keyword verbs, types, and which ones compute directly on compressed data.
Every l primitive on one page. Each glyph has a monadic and a dyadic meaning; monadic primitives are invoked by keyword (first, reverse, …), dyadic ones by the infix glyph. Read right-to-left, no precedence.
CoC — does it avoid decompressing? ✓ = computes on the encoding or reads the header (no full decode); - = materialises first. Compound cells are monadic / dyadic.
Glyphs
| Glyph | Monadic | Dyadic | CoC |
|---|---|---|---|
| :: | identity — return x | assign-through (returns y) | - / - |
| + | flip — transpose | add | - / ✓ |
| - | neg — negate | subtract | ✓ / ✓ |
| * | first — head | multiply | ✓ / ✓ |
| % | reciprocal — 1%x | float divide | ✓ / ✓ |
| & | where — mask → indices | lesser / and | ✓ / ✓ |
| | | reverse | greater / or | ✓ / ✓ |
| ^ | null — null mask | fill nulls | ✓ / ✓ |
| = | group — value → indices | equal | ✓ / ✓ |
| < | iasc — grade up | less-than | ✓ / ✓ |
| > | idesc — grade down | greater-than | ✓ / ✓ |
| $ | string — format | cast / pad; float matmul | - / ✓ |
| , | enlist | join | ✓ / ✓ |
| # | count | take / reshape | ✓ / ✓ |
| _ | floor | drop / cut | ✓ / ✓ |
| ~ | not | match (identical?) | ✓ / ✓ |
| ! | key — dict keys | build dict / enum | ✓ / ✓ |
| ? | distinct | find index; roll | ✓ / ✓ |
| @ | type | index / apply | ✓ / ✓ |
| . | value — eval | apply / deep-index | - / - |
0: 1: 2: are the text/CSV, fixed-width, and dynamic-load I/O glyphs (all materialise).
Math & statistics
| Verb | Meaning | CoC |
|---|---|---|
| neg abs | negate / absolute value | ✓ |
| sqrt exp log | root / eˣ / natural log | ✓ |
| sin cos tan asin acos atan sinh cosh tanh | trig & hyperbolic (radians) | ✓ |
| reciprocal floor | 1%x / round toward −inf | ✓ |
| div | x div y — integer floor-division | ✓ |
| xexp | x xexp y — power xʸ | - |
| sum prd avg | total / product / mean | ✓ |
| min max | extrema (O(1) from header bounds) | ✓ |
| med | median | - |
| var dev | variance / std-dev (population) | ✓ |
| svar sdev | sample variance / std-dev | ✓ |
| cov cor | covariance / correlation | ✓ |
| wsum wavg | weighted sum / mean | ✓ |
| sums prds mins maxs | running total / product / min / max | - |
| deltas ratios avgs | successive diffs / ratios / running mean | - |
| mmxw mmnw | windowed running max / min | ✓ |
| mmu xmm | matrix multiply A·B / A·Bᵀ (float) | - |
Lists, search & tables
| Verb | Meaning | CoC |
|---|---|---|
| til | til n — 0..n−1 | - |
| count | number of items | ✓ |
| first last | head / tail | ✓ |
| next prev | shift ∓1 (0N fill) | - |
| reverse rotate | reverse / n rotate x cyclic shift | ✓ / - |
| flip | transpose | - |
| enlist raze | wrap as 1-list / flatten one level | ✓ / - |
| where group distinct | indices / value→indices / unique | ✓ |
| asc desc iasc idesc | sort / grade, ascending & descending | ✓ |
| rank xbar | ordinal position / w xbar x round down | - / ✓ |
| cut sublist | n cut x chunk / n sublist x slice | - |
| cross fills | Cartesian product / forward-fill nulls | - |
| in within bin | membership / range test / binary search | ✓ |
| inter union except | set intersect / union / difference | - |
| key value | dict keys / values | ✓ / - |
| keys cols meta | key-columns / all-columns / column info | ✓ |
| xkey xcol | key a table / rename columns | - |
| xasc xdesc | sort a table by column(s) | ✓ |
| insert upsert | append / add-or-overwrite rows | - |
| fby | filter-by: per-group aggregate inside where | ✓ |
q-sql: select / exec / update / delete … by … from … where — templates, read right-to-left.
Text & I/O
| Verb | Meaning | CoC |
|---|---|---|
| string | format any value to characters | - |
| lower upper trim | case / strip blanks | - |
| like | glob match (? *) | - |
| ss ssr | substring find / replace | - |
| sv vs | join↔split; base decode↔encode | - |
| set get | serialize↔read a value on disk | - |
| read0 0: 1: | text lines / CSV / fixed-width binary | - |
Types
For a type, ✓ means XCMP-compressible. Default integer is int (type 1 → -6h).
| Type | Char | Type# | Literal | CoC |
|---|---|---|---|---|
| boolean | b | −1h | 0b / 101b | ✓ |
| byte | x | −4h | 0x00 | ✓ |
| short | h | −5h | 0h | ✓ |
| int | i | −6h | 1 (default) | ✓ |
| long | j | −7h | 1j | ✓ |
| real | e | −8h | 1e | ✓ |
| float | f | −9h | 1.0 / 1f | ✓ |
| char | c | −10h | "c" / "abc" | - |
| symbol | s | −11h | `a`b`c | ✓ |
| timestamp | p | −12h | 2026.07.01D12:00:00.000000000 | ✓ |
| month | m | −13h | 2026.07m | ✓ |
| date | d | −14h | 2026.07.01 | ✓ |
| datetime | z | −15h | 2026.07.01T12:00:00.000 | ✓ |
| timespan | n | −16h | 0D01:00:00.000000000 | ✓ |
| minute · second · time | u · v · t | −17h · −18h · −19h | 12:34 · 12:34:56 · 12:34:56.789 | ✓ |
| dictionary | — | 99h | `a`b!1 2 | - |
| table | — | 98h | ([]a:1 2) | ✓ |
| function | — | 100h | {x+1} | - |
0N / 0W are int null / infinity. Temporal null/inf literals do not lex; guid is nyi.
Iterators
| Glyph | Keyword | Meaning | CoC |
|---|---|---|---|
| ’ | each | apply item-by-item (map) | - |
| \: | each-left: x against all of y | - | |
| /: | each-right: all of x against each y | - | |
| ’: | prior | each item with its predecessor | - |
| / | over | fold to a single value | ✓ (inherits folded verb) |
| \ | scan | running fold, keeping every step | - |
| peach | parallel each | - |
Examples
2*3+4 / 14 — right-to-left: 2*(3+4)
sum 10+til 1000000 / 500009500000j — closed form over a compressed column
avg 1 2 3 4 / 2.5
distinct 1 1 2 3 3 / 1 2 3
where 1 0 2 0 1 / 0 2 2 4 — index i repeated x[i] times
5^0N 2 0N / 5 2 5 — fill nulls
2 3 5 in 1 2 3 4 / 110b
var 1 2 3 4 5.0 / 2f — closed-form stat, stays compressed
cor[1 2 3;2 4 6.0] / 1f
(0.1 0.2 0.3;0.4 0.5 0.6) mmu 1 2 3.0 / 1.4 3.2 — matrix · vector
{e%sum e:exp x-max x} 1 2 3 4.0 / softmax in one line
select sum sz by sym from t / grouped aggregate (q-sql)