◆ Flux

Conventions & notation

The reference is written in a small, fixed notation, and reading it once here saves decoding it on every later page. This is the key: how kinds, error codes, invariants and code samples are written, how the reference marks maturity, and the frozen vocabulary the whole site shares. It owns the notation; the things the notation names — the kind system, the error policy, the determinism contract — are specified on the pages linked from each section.

New here? Start with Guide §1 — What is Flux? →

How kinds are written

A kind is a stream’s dimension — its meaning, not only its shape. Kinds appear in code style throughout, exactly as they are written in a program or a diagnostic:

Written Reads as
price An affine point on the price axis
level A displacement along the price axis — the vector between two points
osc(0,100) A bounded oscillator, parameters giving the bounds
signal A discrete, per-step event stream
vec(κ, N) A fixed-width vector of N values, each of kind κ
record{…} A named-field aggregate; the fields fill the braces

Two lower-case Greek metavariables stand in for “any kind” when a rule is generic: κ (kappa) for an element kind, and where a second is needed the plan’s own letter is used. A parameterised kind carries its parameters in parentheses (osc(lo,hi)) or braces (record{…}); a bare name (price, signal) is a kind with no parameters. The word is always kind, never “type” — “type” is reserved for the host language a Flux program is embedded in. The dimensional system these names belong to is specified in Spec — Kinds.

Error codes are verbatim

Diagnostics are quoted exactly as the compiler emits them, in backticks, because the string is load-bearing — it is what you grep for, what the editor surfaces, and what a negative example asserts:

Code Raised when
[ErrDim] Two streams are combined across incompatible dimensions
[ErrCausal] A value would depend on its own future — a causality violation
[ErrTotal] A loop or window cannot state a compile-time bound
[ErrFirewall] A downstream plane tries to write back into what a program computes
[ErrRepr] A value is asked for in a representation its kind cannot take
[WarnTop] A top-level result is well-formed but likely not what was meant

A code beginning Err is a compile error and rejects the program; one beginning Warn is a diagnostic that does not. The full policy — which rule raises which code, and the message text that accompanies it — is owned by Spec — Inference & the error policy. Codes are never paraphrased: a page writes [ErrDim], not “a dimension error”.

Invariants and amendment rules

Two numbered series are referenced by number across the reference, and neither is redefined where it is cited:

When a page names I7 or A14, it links the owner rather than restating the rule, so the statement lives in exactly one place and cannot drift.

Code samples

Every fenced ```flux block is a complete, runnable program, kind-correct under the sealed grammar. A trailing // comment carries the teaching — most often the inferred kind and what it implies for presentation:

FLUX
plot close   // price → main pane, price scale
FLUX
plot rsi(close, input(14))   // osc(0,100) → own pane, 0–100 scale, 30/70 guides, params UI

Both lines are read back in prose after the fence; a sample is never left to speak for itself.

Negative examples show what the compiler rejects. Each is marked // ✗ with the exact error code — close + rsi(close, input(14)) // ✗ [ErrDim] — and, because Flux has no expression-statements, a rejected form is often a bare expression fragment: it demonstrates the rule, it is not a statement you could run. A page that mixes fragments into its fences says so up front in a short note on the samples, so an unmarked line is always a legal statement.

Samples are machine-checked. Every ```flux block on the site is run through the shipped parser, the shipped inference engine and the engine’s own arity table before the page ships — the same checker that guards the canonical corpus, run over this tree too — so a sample that reads as correct also is correct against the compiler that will run it. What lives outside the ANALYSIS plane the checker implements is parsed and arity-checked but not kind-checked: an app block and a collection constructor (Map, Set, Deque, Tree, Vec). A few samples that reach for a surface the ANALYSIS checker has no opinion on yet — a window verb, a variant payload, a representation, the viz.* pillar — are shown as designed code, not run.

Host-side code is fenced ```ts (TypeScript); grammar and diagrams-as-text use a plain ``` fence. The grammar itself is normative and owned by Spec — Grammar; the lexical rules behind the tokens are in Spec — Lexical structure.

Maturity

The reference describes Flux v1 as specified, in the present tense: a page states the designed behavior of the language as the behavior it has. Maturity — what runs today versus what is sealed design still being built — is tracked in exactly one place, the status table in Implementation status, and no page repeats it.

Where the design itself holds something back — a rollout that follows v1, a seam kept open and inert, an alternative weighed and set aside — the page that reaches it explains the decision in prose, at the point it arises, rather than flagging it with a badge. Pages do not sprinkle “not yet” through the text: either a behavior is part of the design and stated plainly, or a decision was made and the page gives its reason.

Frozen vocabulary

A handful of terms are used precisely and always the same way. The most load-bearing:

Term Meaning
ANALYSIS · CANVAS · TRANSITION · APP The four planes, always all-caps, always these names
the firewall The one-way boundary: downstream planes read upstream results, never write back
sort A stratum of the kind lattice (the “kind of a kind”)
join / meet The least upper and greatest lower bound of two kinds in that lattice
≤safe / ≤lossy The two coercion edges: value-preserving, and precision-losing
no-repaint A value, once produced for a step, never changes
byte-identity Two runs produce the same bytes, not merely equal numbers

Names are fixed: Flux is the language, FDK the kit, fluxpack the package artifact, and TEA is The Elm Architecture (spelled out once per page that uses it). The planes and the firewall are specified in The four planes & the firewall; the lattice, sorts and coercion edges in Spec — Kinds. Every term with a formal definition also has a plain one in the Glossary.

How the reference states its claims

Precision is the house style, and it extends to the guarantees. Designed behavior is written in the present tense as the behavior it is; a decision the design made against something is stated with its reason, not hedged. The guarantees are phrased exactly, and the exact phrasing is the honest one:

Naming a limit as plainly as a strength is itself a convention here: a claim the docs will not hedge is one you can rely on.

See also