# Terms

The [Language overview](overview.md) introduces these terms informally, as they come up.

Every [value](#term-value) is an [atom](#term-atom) or an [array](#term-array): atoms are [numbers](#term-number), [characters](#term-character), [functions](#term-function) and [operators](#term-operator), [scalars](#term-scalar) are arrays of [rank](#term-rank) 0, [units](#term-unit) are atoms and scalars, and [subjects](#term-subject) are all values except functions and operators.

| Term | Meaning |
|--- |--- |
| <a name="term-value"></a>value | a number, character, function, operator or array |
| <a name="term-atom"></a>atom | a value that isn't an array: a number, character, function or operator |
| <a name="term-number"></a>number | an approximate real or complex number, or an exact integer or rational, as [Numbers](numbers.md) describes |
| <a name="term-bare-number"></a>bare number | a number written without a suffix, which is approximate: `0.5`, whereas `3ₓ` and `1ᵣ3` are exact |
| <a name="term-whole"></a>whole | with no fractional part. Integers are whole, as are floats such as `3.0` and `¯3.0` |
| <a name="term-mathish-types"></a>Mathish types | ordinary exact numbers, 64-bit floats and complex numbers with 64-bit parts, under dynamic kinds. Fixed-integer calculations are excluded. [Mathish mode](numbers.md#mathish-mode) applies its conventions when enabled |
| <a name="term-character"></a>character | one Unicode character, written in single quotes: `'a'` |
| <a name="term-primitive"></a>primitive | a built-in function or operator, written as one glyph: [`+`](https://bpl.fast.ai//glyphs/plus.html) or [`/`](https://bpl.fast.ai//glyphs/slash.html) |
| <a name="term-dfn"></a>dfn | a function or operator written in braces, as [Dfns](dfns.md) describes: `{ω+1}` |
| <a name="term-function"></a>function | a primitive, train, derived function, or dfn that doesn't use [`⍶`](https://bpl.fast.ai//glyphs/alpha-underbar.html) or [`⍹`](https://bpl.fast.ai//glyphs/omega-underbar.html), which applies to arguments |
| <a name="term-operator"></a>operator | a primitive, or a dfn that uses [`⍶`](https://bpl.fast.ai//glyphs/alpha-underbar.html) or [`⍹`](https://bpl.fast.ai//glyphs/omega-underbar.html), which takes operands and derives a function: [`/`](https://bpl.fast.ai//glyphs/slash.html) derives `+/` from [`+`](https://bpl.fast.ai//glyphs/plus.html) |
| <a name="term-derived-function"></a>derived function | a function that an operator derives: `+/`, or `2↣×` |
| <a name="term-pervasive-function"></a>pervasive function | a function that applies to each atom of its arguments, through any nesting: `≥[2 ⊂3]` is `[3 ⊂4]` |
| <a name="term-array"></a>array | a rectangular collection of values along zero or more axes |
| <a name="term-simple-array"></a>simple array | an array whose items are all atoms: `1 2 3`, `"abc"` and `⊂5` are simple, and `[1 [2 3]]` is not |
| <a name="term-rank"></a>rank | the number of axes: a vector has rank 1, and atoms and scalars have rank 0 |
| <a name="term-vector"></a>vector | an array of rank 1 |
| <a name="term-matrix"></a>matrix | an array of rank 2 |
| <a name="term-string"></a>string | a vector of characters, written in double quotes: `"abc"` |
| <a name="term-scalar"></a>scalar | an array of rank 0, holding one value: `⊂5` is a scalar holding the number 5, and `5` is a number |
| <a name="term-unit"></a>unit | a rank-0 value: a number, character, function, operator or scalar |
| <a name="term-subject"></a>subject | a value that isn't a function or operator: a number, character or array |
| <a name="term-item"></a>item | the value at one position of an array: `[1 [2 3]]` has the items `1` and `[2 3]` |
| <a name="term-position"></a>position | an index along an axis, counting from 0. Negative positions count from the end |
| <a name="term-axis"></a>axis | one of the dimensions of an array, numbered from 0. Each axis has a length, and can have a name and keys |
| <a name="term-key"></a>key | a string that labels a position along an axis, as [Keyed arrays](keyed.md) describes |
| <a name="term-record"></a>record | a vector with keys, written as `key:value` items in brackets: `["a":1 "b":2]` |
| <a name="term-cell"></a>cell | a sub-array made of an array's last k axes, called a k-cell: a matrix's rows are its 1-cells. A 0-cell is the unit at one position, the atom there or the array there enclosed. When k is at least the array's rank, the whole array is its one cell |
| <a name="term-major-cell"></a>major cell | a cell made of every axis but the first: a matrix's rows are its major cells |
| <a name="term-frame"></a>frame | the axes before the cells, with one cell at each position |
| <a name="term-assembly"></a>assembly | building one array from results, one for each position of a frame: the shape is the frame followed by the results' shape, each result fills its position with its items, and shorter results are padded with fill |
| <a name="term-function-array"></a>function array | an array with a function as an item. [Evaluation](evaluation.md#binding) gives the rule for calling one: `2 [+ ×] 3` is `5 6` |
| <a name="term-map"></a>map | a call of Each, Rank, an outer product or a stencil, which applies its operand at each position of a frame: to each item, cell, pair of items or window. These are the map's cells. [Evaluation](evaluation.md#functions-and-effects) describes how a map calls its operand |
| <a name="term-prototype"></a>prototype | the value an array supplies as its own fill: its first item with each number made 0, each character made a space, and each function kept. An empty array keeps its prototype: `↑0ρ"ab"` is `' '` |
| <a name="term-fill"></a>fill | the value an operation uses where an array has no item, as when `5↑1 2` gives `1 2 0 0 0`. It is the array's [prototype](#term-prototype), unless the call chooses a fill through [`⍠`](glyphs/quad-colon.md#fill)'s options record |
| <a name="term-selection"></a>selection | values read from an argument together with their places in it, as a list of positions or a function such as `1↓` reads them |
| <a name="term-glyph"></a>glyph | a symbol for a primitive or for syntax, as the [glyph reference](glyphs.md) lists |
| <a name="term-name"></a>name | a word that refers to a value, as [Syntax](syntax.md#names) describes: `x` or `avg` |
| <a name="term-statement"></a>statement | the code between two newlines or [`◇`](https://bpl.fast.ai//glyphs/diamond.html) separators. Inside brackets and parentheses, these separate rows instead |
| <a name="term-shy"></a>shy | giving a result that isn't displayed unless the code asks for it: an assignment is shy, and `⎕←x←3` displays its value |
| <a name="term-literal"></a>literal | a number, character, string, [`∞`](https://bpl.fast.ai//glyphs/infinity.html), [`⍬`](https://bpl.fast.ai//glyphs/zilde.html), or a constant: `$t` true, `$f` false or `$n` NaN |
| <a name="term-group"></a>group | brackets, parentheses or braces with what they hold: `(1+2)`, `[a b]` or `{ω}` |
| <a name="term-token"></a>token | a glyph, name, literal or group |
| <a name="term-run"></a>run | a sequence of tokens with no spaces between them |
| <a name="term-token-separator"></a>token separator | [`⁝`](https://bpl.fast.ai//glyphs/tricolon.html) separates tokens without ending a run or continuing a literal strand |
| <a name="term-strand"></a>strand | subjects side by side, read as a vector without brackets: `1 2 3` is `[1 2 3]`, and `a b` is `[a b]` |
| <a name="term-argument"></a>argument | a subject a function applies to |
| <a name="term-operand"></a>operand | a value an operator applies to |
| <a name="term-monadic"></a>monadic | taking one argument, or for an operator, one operand: `-5` is a monadic call |
| <a name="term-dyadic"></a>dyadic | taking two arguments, or for an operator, two operands: `3-5` is a dyadic call |
| <a name="term-ambivalent"></a>ambivalent | callable with one argument or with two: [`-`](https://bpl.fast.ai//glyphs/minus.html) negates with one argument and subtracts with two |
| <a name="term-expression"></a>expression | a run, group or statement that ends in a subject |
| <a name="term-train"></a>train | a run, group or statement that ends in a function |
| <a name="term-part"></a>part | one of the pieces a train is built from: a literal strand, or a token with the operators bound to it, such as `2`, `+/` or `(+×-)` |
| <a name="term-fork"></a>fork | three parts of a train, `f g h`, giving `(f ω) g (h ω)` |
| <a name="term-tine"></a>tine | one of the two outer parts of a fork |
| <a name="term-atop"></a>atop | two parts of a train, `f g`, giving `f (g ω)` |
| <a name="term-bind"></a>bind | a subject directly before a part, fixing that part's left argument: `2×` is `2↣×`, and in `2\|#⊢` the `2` binds `\|` |
| <a name="term-hook"></a>hook | a function that [Before](glyphs/right-tail-arrow.md) or [After](glyphs/left-tail-arrow.md) derives from two functions. With one argument, a hook uses that argument twice: `f↢g Y` is `Y f(g Y)`, and `f↣g Y` is `(f Y)g Y` |
| <a name="term-fast-combination"></a>fast combination | a combination of functions that BPL computes with a dedicated algorithm: `10↑⍋v`, `⊛1+x` |

## Internals terms

These terms describe how BPL runs code. [Performance](performance.md) explains what they mean for the speed of a program. [`•explain`](system/explain.md), [`•storage`](system/storage.md), [`•memory`](system/memory.md) and [`•prefs`](system/prefs.md) report them.

| Term | Meaning |
|--- |--- |
| <a name="term-pending"></a>pending | not yet computed. A call on a large array can return a pending array, and BPL computes the items when a later call reads them, as [Calls that wait](performance.md#calls-that-wait) describes. `(•storage y).pending` is `$t` for a pending array |
| <a name="term-fused-group"></a>fused group | the pending calls that BPL computes together, block by block, in one pass over their arrays. Each of those calls is <a name="term-fused"></a>fused. The `fused` field of `•explain` has a row for each fused group that ran |
| <a name="term-forced"></a>forced | computed because a call needed the items in memory: [`⍋`](https://bpl.fast.ai//glyphs/delta-stile.html) and display each force a pending array that they read. The `forced` field of `•explain` has a row for each call that forced one |
| <a name="term-compiled-loop"></a>compiled loop | machine code that BPL makes while a process runs, for the calls and types of one fused group, as [Compiled loops](performance.md#compiled-loops) describes. `•explain` records each run of one as a `"compiled"` route |
| <a name="term-kernel"></a>kernel | a built-in loop that computes one primitive on whole arrays of given types, such as [`+`](https://bpl.fast.ai//glyphs/plus.html) on two arrays of 64-bit floats. A call that isn't part of a compiled loop runs on its kernel |
| <a name="term-trace"></a>trace | to record the calls that a function makes as the steps of a program. A trace stops at a call that a program can't hold, as [What stops a trace](autodiff.md#what-stops-a-trace) lists |
| <a name="term-program"></a>program | the typed steps that a trace records. BPL runs the program in place of the function on later calls whose arguments have the same types and shapes. The `programs` field of `•explain` has a row for each program built or replayed |
| <a name="term-batched-call"></a>batched call | one call of a [map](#term-map)'s operand on all the map's cells together, in place of one call for each cell, as [Evaluation](evaluation.md#functions-and-effects) describes |
| <a name="term-compact-storage"></a>compact storage | storage that holds items of one type side by side, as an array of floats or of characters does. [Storage](numbers.md#storage) describes it |
| <a name="term-mixed-storage"></a>mixed storage | storage that keeps each item's kind with the item, for an array whose items no one compact type can hold: `(•storage 1ₓ 2.5).kind` is `"mixed"` |
| <a name="term-view"></a>view | an array that shares another array's items without copying them, as a reshape or a cell from Rank does. A view keeps all of that other array's items alive |
