Feature inventory

Language Feature Matrix

Language Feature Matrix

This page is the checklist for Grid's language surface.

Most entries below are fully supported. Entries marked syntax-only are recognized for compatibility or diagnostics, but should not be used as working model features yet.

Status Key

  • supported: accepted by Grid and available to model authors.
  • syntax-only: syntax is recognized, but execution is not claimed.
  • diagnostic: negative syntax that exists to produce a precise error.

Source And Statements

  • statements are separated by newlines or semicolons. Example: A1 = 1, then B1 = A1 + 1.
  • metadata headers such as MODEL "Portfolio", DESCRIPTION "...", VERSION "1.0.0", AUTHOR "...", and TAGS "audit".
  • (supported) - =, ~=, and ?= are production-lowered at top level; +=, -=, *=, and /= are production-lowered in rule actions and their documented typed mutation contexts.
  • (supported) - A1 ?= MAYBE_FAIL() preserves the previous value if the RHS returns an error.
  • rule actions perform native read-modify-write updates. Top-level arithmetic compound assignment is rejected because a declarative binding has no prior-value source; typed mutation contexts retain their own operator contracts.
  • A1 IS currency = 125000 or currency A1 = 125000.
  • declarations** (supported) - shaped declarations such as A1 IS Tensor[2, 2] with precision 32 = SQUARE(values) lower to resident Tensor graphs when the optional accelerator is present and retain the same typed Workbook result when it is absent. Bounded ITERATE, PARAMETER, and TRAIN_ADAMW provide portable inference and training syntax.
  • amount INTO currency overlays a type tag on an expression value; lowers to TYPE_TAG(amount, "currency"). Same semantic overlay as declaration-level IS, but usable inside expressions.
  • tags refine one another (USD is a currency is a number; json is an object), a leaf implies its ancestors, and currencies take the currency:<code> qualifier (bare USD too) — unit: is for physical units.
  • (supported) - one header keyword sets both the dimensional and coercion axes; strict except <axis> differs on one. Under strict, a lossy arithmetic coercion or an incompatible type-tag is a #TYPE!, and the static analyses harden too: matrix-shape mismatches (GRID_MATRIX_SHAPE_MISMATCH) and refuted VALIDATE assertions (GRID_VALIDATE_UNSATISFIABLE) become compile errors.
  • FORMAT / VALIDATE / ## notes** (supported) - trailing declarative clauses attach a format pattern, a validation clause, and doc notes to the cell in source. VALIDATE on an input cell is the write contract enforced at every write surface; on a computed cell it is a static assertion the compiler proves, refutes, or flags unverified via interval analysis. Top-level FORMAT <tag> <expr> declares tag policies; rule FORMAT actions and RESET FORMAT manage the override layer.
  • predicate reviewed(by: string) declares a typed payload schema. x is :reviewed(reviewer) = 1 attaches it; the readability articles in x is a :reviewed(...) and x is an :reviewed(...) are optional. Declarations are single-valued by default; many by (id) permits several instances and defines their identity. In rules, += upserts one identity, keyed -= removes one, and bare -= removes all. Read single fields as scalars and many fields as arrays through PREDICATES(x).reviewed.by or x.predicates.reviewed.by. Field contracts fail closed; absent fields read as BLANK. Fieldless predicates such as :happy remain open and declaration-free. MODEL.PREDICATES.NEIGHBORS(:reviewed) performs a reactive reverse lookup through the unified Predicate graph; predicate vertices use colon-symbol identity, model symbols use canonical text identity, and many instances remain parallel :applies edges.
  • (supported) - predicate releasable means ... defines a proposition about its implicit subject. Facts, natural predicate laws, EXISTS/EVERY, named structural routes (THEN, OR, *, REVERSE), Boolean NO path, result-valued REACHABLE, checked therefore conclusions, and WHY share one Predicate engine. Recursive EVERY components use dependency-SCC-scoped greatest fixed points. General modality uses independent support/refutation evidence: EVIDENCE(atom) returns neither, supported, refuted, or both; MUST reads support, MAY means not refuted, and CANNOT reads refutation. The both state is paraconsistent and does not invalidate unrelated inference. Structured unary facts retain their declared payload and reactive state.
  • (supported) - temporal facts such as design before build and topology facts such as parcel inside district share bounded family-local inference with conceptual-set facts such as vip included in active. Topology is authored as separate from, touches, partially overlaps, coincides with, inside, encloses, and intersects, with optional with boundary contact / without boundary contact refinement. Conceptual sets use included in, includes, disjoint from, overlaps with, and same members as, with optional strictly refinement. Empty extents retain exact equality, inclusion, overlap, and disjointness meaning. Plain queries mean MUST; MAY, CANNOT, alternatives, complements, reactive IF/UNLESS, RELATION, RELATION_STATUS, WHY, family selection, and contradiction isolation are supported.
  • (supported) - default B1 = … marks an overridable base a rule may set, RESET to the base, or CLEAR.
  • STATE counter = 0 declares model-owned mutable state with an initial/reset base and sticky rule-written revisions.
  • (supported) - input price = 0, output total = price * qty.
  • ordinary target cells such as D5 = 1.
  • (supported) - A1:A5 = 0 expands to per-cell assignments.
  • (supported) - [total, avg, ...rest] = SUMMARY(B1:B10).
  • A1 = NOW() ONCE, A1 = NOW() EVERY 5min, and A1 = TRUE AT dt"...".
  • predicate WHEN, settled-value CHANGES / BECOMES, and scheduled EVERY / AT blocks with eager rule-action assignments. WHEN supports SERIAL/bounded CONCURRENT admission and LATEST, bounded QUEUE, or durable LEDGER event retention using captured event-time inputs.
  • declarative goal-seek and bounded optimization over cells: SOLVE Z9 = A2 IN [0, 1] GOAL A3 = 200000, or MINIMIZE / MAXIMIZE an objective cell. The result cell receives the solved value; solves are reactive and never mutate the variable cell. See assignments.md.
  • /* notes */, including multi-line comments.
  • carry specific spans and recovery messages.
  • Grid's grammar is contextual rather than lexically reserved. Structural and operator keywords such as WHEN, END, MODEL, WITH, and NOT are treated as grammar when that parse is available, so ambiguous uses produce a diagnostic instead of silently becoming a binding reference. Contextual words may remain valid names where no structural parse applies; authors should avoid all names listed in the reference.
  • (supported) - GRAMMAR name IS CFG|PEG|REGULAR ... END creates an immutable grammar value. grammar USING LALR|EARLEY|PACKRAT|DFA|AUTO creates a portable parser recipe, GENERATOR ... makes the strategy independently authorable, and PARSE(text, parser) returns a native parse-result value. Formalisms retain distinct choice semantics; recipes persist without process-local parser tables. graph syntax = GRAPH(parse_tree) publishes a successful tree through the ordinary resident Graph and Predicate reasoning stack with ordered child edges and source-span provenance. The grammar-bound tree substrate is available through its complete declaration surface — PATTERN, THEORY, ALGEBRA, TRANSFORM, TRANSLATE, SOLVER, and THEOREM — including bounded solver search, saturation, and checked theorems as proved equation sources. See grammars.md.
  • (supported) - contextual symbol x declarations create immutable mathematical variables that compose through ordinary Grid operators, references, and admitted functions. The SYMBOLIC.* family provides exact rational construction, canonicalization, simplification, expansion, collection, factorization, rational transforms, typed substitution, exact evaluation, explicit arbitrary-precision approximation, assumptions, four-state decisions, differentiation, and complete admitted univariate solving. Results retain conditions, bounded work, completeness, and replayable Tree certificates; there is no held-body syntax, string evaluator, or alternate public AST. See symbolic-mathematics.md.
  • (supported) - regression coverage for ambiguous token boundaries.
  • continuation** (supported) - calls, arrays, objects, and bracketed expressions may span lines while delimiters are open.
  • patterns** (supported) - canonical formatting for MATCH, objects, comprehensions, DO, and CASE.
  • allowed in function calls, array literals, object literals, and MATCH arms.

Native Graph Algebra

  • (supported) - graph roads = GRAPH(...) creates a typed, immutable, revisioned property-graph handle that cannot spill into Workbook cells.
  • (supported) - symbols and cells are implicit MODEL.GRAPH nodes; relates to adds directed edges and connects to adds bidirectional logical relationships, with typed payloads, list expansion, and stable identity.
  • (supported) - MODEL.TAGS retains the unary-only :<predicate> -> "model symbol" projection for source compatibility.
  • (supported) - MODEL.PREDICATES combines live unary membership with authored binary facts and their temporal/topology/set family, descriptive relation set, and condition metadata without materializing inference closure into graph topology. Structured unary payloads are edge properties, and rule mutations participate in revisioned caching.
  • (supported) - KNOWLEDGE GRAPH knowledge VIA edge.relation projects an arbitrary resident GraphHandle into Predicate v10 with exact string, symbol, and integer node identity. WITH PROPERTIES adds joinable graph_node, graph_edge, graph_node_property, and graph_edge_property facts for typed scalar properties. WHY retains the exact graph, revision, node, edge, and property origins used by a proof, while inferred closure remains a separate derived view.
  • (supported) - every accepted resident patch appends a revisioned event; append/replay/read APIs support optimistic graph and journal revision guards so persistence can replay the exact stream beside the same compiled model.
  • (supported) - path route = path in roads from a to b minimize hops states an objective; the planner selects and explains the physical kernel.
  • (supported) - connectivity, core/k-core, and deterministic Leiden/Louvain community contracts share a revision-bound partition value.
  • (supported) - graph schemas type node/edge properties, named node and edge kinds, and endpoint constraints; hydration and atomic patch staging revalidate the same closed contract.
  • (supported) - bounded comprehensions can fuse into a consumer or materialize a derived handle, while bounded edge-deletion rewrites publish one validated immutable revision.
  • contraction** (supported) - path and partition handles expose typed scalar/Frame projections, and a revision-matched partition contracts into a deterministic quotient graph.
  • (supported) - frame hits = match roads limit 100: ... return ... provides typed node/edge predicates and Frame projections with a mandatory result bound.
  • (supported) - frame values = fixpoint in roads: ... within 100 iterations exposes sum-product, min-plus, max-min, and boolean-or propagation with explicit direction, seeds, convergence, and work bounds.
  • read-only explainGraph(modelId) host method reports semantic contracts, physical plans, declared/effective budgets, transient/retained/peak memory, materialization, lineage, and resident state. See graphs.md.
  • (supported) - the production host projects the current resident graph revision into Geo routing, Network Flow, and Sim validators/kernels without an untyped intermediate representation.

Games And Mechanisms

  • (supported) - game Name { players = P; strategies = S; payoffs = U } validates live normal-form relations through GAME.NORMAL_FORM; the extensive = Tree form validates a perfect-information tree. Both lower to ordinary named call assignments and the canonical compiled call form.
  • (supported) - exhaustive pure Nash, regret, dominance, Pareto, welfare, and evidence-carrying GAME.VERIFY claims fail closed on incomplete domains or exhausted work.
  • (supported) - independent zero-sum primal/dual LPs, bounded general bimatrix support enumeration, correlated-equilibrium incentive LPs, and perfect-information backward induction all replay their defining inequalities before publishing a result.
  • (supported) - mechanism Name { direct = Specification } lowers through MECHANISM.DIRECT; exhaustive DSIC/BIC, ex-post/interim IR, no-deficit, and strong-budget-balance checks return concrete counterexamples.
  • (supported) - exact unit-demand welfare matching with VCG counterfactual payments plus deterministic first/second-price auctions with reserve and tie evidence. See game-theory.md.

Literals And Values

  • integers, decimals, leading-dot decimals, and scientific notation.
  • 1_000_000 and 0.000_001.
  • (supported) - 0xFF, 0b1010.
  • 0o755.
  • double-quoted, triple-quoted, raw, raw-triple, and backtick strings.
  • newline, tab, quote escaping, and doubled quotes where documented.
    • `total={A1}`.
  • interpolation** (supported) - `total: {A1:"$#,##0.00"}`.
  • TRUE and FALSE, case-insensitive.
  • (supported) - glob"*.csv", wild"inv-????", and BLANK.
  • date"...", dt"...", duration"...", cron"...", and domain literals such as url"...", mol"...", dna"...", color"...", note"...", bin"...", b64"...", and markup typed strings html"...", xhtml"...", svg"...", jsx"..."; any typed tag may also wrap the payload as <tag>...</tag>, for example <dna>ATCG</dna>.
  • (supported) - bigint"123456789012345678901234567890" for arbitrary-precision integers and decimal"0.1" for exact fixed-precision decimals, plus the BIGINT(...) constructor. Exact values keep their precision through arithmetic and number-theory functions such as ISPRIME, MODPOW, GCD, ISQRT, and RANDPRIME; decimal"0.1" + decimal"0.2" equals decimal"0.3" exactly. Mixing an exact value with a non-integer ordinary number is a #VALUE! instead of a silent floating-point rounding.
    • duration suffixes (5min), basis points (25bps), percentages (5pct), angles (45deg), data sizes (512MB), and 3-letter units (100USD).
  • #N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NULL!, #NUM!, #CALC!, and #SPILL!.
  • /^INV-\d+$/i.
  • [1, 2, 3], [1; 2; 3], and [1, 2; 3, 4].
  • [0, ...A1:A3, 4] desugars to HSTACK for horizontal concatenation.
  • {name: "Ada", level: 9} and {"first name": "Ada"}.
  • (supported) - (1 + 2) * 3.

References, Ranges, And Access

  • $A$1, AA100, R1C1, and R[1]C[-2].
  • (supported) - Revenue = A1 gives the existing reactive binding a semantic address; calculated or decorated named assignments remain distinct bindings.
  • R1C1:R3C3.
  • (supported) - A:A, A:C, 1:1, and 1:3 in expression positions.
  • A1# refers to the full spilled rectangle anchored at A1.
  • (diagnostic) - @A:A was removed (it never reduced a range to a row/column value — UnaryOp::At was pure identity). A prefix @ on a reference now rejects with GRID_IMPLICIT_INTERSECTION_REMOVED; reference the cell directly. Prefix @ remains valid for temporal coordinates (@today), and postfix @ remains valid for temporal references (A1@-1) and structured projection (data@"amount", data@["id", "amount"]).
  • (supported) - obj.field, obj["field"], and optional chains.
  • (supported) - unified array/object access through INDEX.
  • data[-1] and data[^1].
  • data[2:5], data[:3], data[3:], and data[1:10:2].
  • (supported) - Sales[Revenue].
  • QUERY(data, "SELECT * WHERE col1 > 5") for table-like arrays.
  • (supported) - SELECT id AS order_id, amount * 1.2 AS gross FROM Orders WHERE status IN ("paid", "pending") OR amount BETWEEN 10 AND 30 ORDER BY amount DESC LIMIT 25, plus grouped forms such as SELECT status, SUM(amount) AS total, COUNT(DISTINCT customer) AS customers FROM Orders GROUP BY status, parse and lower to structured relational IR (REL_SELECT(source, projection, predicate, order, limit, group, having)) instead of a SQL string. Header arrays and Tuple/Vector/Deque collections of Record rows execute natively, preserving the source sequence family. Connector- produced Frames also route through native filtering, ordering, limiting, and projection and may feed another query without materializing back to cells. Warehouse-backed queries push supported clauses to BigQuery, Snowflake, Redshift, and Databricks using provider-native parameter binding, with relational residuals executed in DataFusion. WHERE uses a canonical recursive predicate tree with SQL NOT/AND/OR precedence and three-valued blank/NULL behavior. LIKE/ILIKE use SQL % and _ wildcards. Computed projections use a typed scalar tree and require AS; arithmetic, searched and simple CASE, COALESCE, NULLIF, ABS, SQRT, FLOOR, CEIL/CEILING, ROUND, POWER, LOWER, UPPER, LENGTH, CAST, TRY_CAST, IN, and inclusive BETWEEN share the same backend-neutral contract. Cast targets canonicalize to number, string, or boolean; CAST reports an invalid conversion while TRY_CAST returns null. CASE is ordered, first-true, and treats unknown conditions as fallthrough. FETCH FIRST|NEXT n ROW|ROWS ONLY is the SQL-standard spelling of the same bounded result stage as LIMIT n. LIMIT n OFFSET m and OFFSET m [ROW|ROWS] [FETCH FIRST|NEXT n ROW|ROWS ONLY] share one result- window contract across resident values, Frames, Polars, DataFusion, and bounded warehouse pushdown. ORDER BY ... NULLS FIRST|LAST controls blank/ null placement for outer and analytic-window ordering; omitted placement remains null-last in both directions. Outer ORDER BY accepts typed scalar expressions and resolves both simple and computed SELECT aliases across resident collections, Frames, Polars, DataFusion, and warehouse pushdown; sort keys are evaluated once per row. Analytic-window ordering accepts the same scalar expressions; ranking, peers, and RANGE bounds share cached key values across those backends. COUNT(*) plus COUNT, COUNT(DISTINCT ...), SUM, AVG, MIN, and MAX over portable scalar expressions execute for resident values, Frames, Polars, DataFusion, and supported warehouse pushdown. Post-aggregate HAVING uses the same predicate tree. SELECT DISTINCT deduplicates typed projected rows before outer ordering and limiting across resident relations and source-proven Frames. SQL UNION, INTERSECT, and EXCEPT, with optional ALL, compose complete query results positionally. Typed duplicate/null semantics, SQL multiset counts, INTERSECT precedence, left-arm column names, and final-result ordering/limits are shared by resident collections and source-proven Frames. Analytic projections support ROW_NUMBER, RANK, DENSE_RANK, NTILE, PERCENT_RANK, CUME_DIST, LAG, LEAD, FIRST_VALUE, LAST_VALUE, NTH_VALUE, and windowed COUNT/SUM/AVG/MIN/MAX with PARTITION BY and ORDER BY, shared by resident values, Frames, local analytics, and warehouse pushdown. LAG/LEAD accept bounded offsets and scalar defaults; aggregate and value windows accept validated explicit ROWS BETWEEN ... AND ... and RANGE BETWEEN ... AND ... frames. Grouped queries stage WHERE, aggregation, HAVING, windows, outer ordering/result-window, and final projection in SQL logical order. Parenthesized relation subqueries and non-recursive SQL WITH name AS (SELECT ...) SELECT ... CTEs compose resident relation values directly and source-proven chains fuse into one physical Frame region; single-source aliases resolve qualified references without changing the source schema. Equality-correlatable EXISTS, NOT EXISTS, correlated IN, and null-aware correlated NOT IN over explicitly aliased sources lower to composite-key hash semi/anti joins while retaining inner-local and trailing outer filters. Correlated scalar aggregate projections lower to grouped inner relations plus typed lookup joins, with SQL empty-group defaults and no per-outer-row subquery evaluation. Multiple aggregate projections compose for resident relations and source-proven Frames. WITH RECURSIVE executes as a bounded fixpoint group over header arrays and native record sequences, with column lists, multiple bindings, simultaneous mutual recursion, per-binding UNION/UNION ALL, and explicit 1,000-iteration and 2,000,000-aggregate-row limits. Source-proven groups additionally promote to native Frame recursion, including explicit column lists, multiple or mutually recursive bindings, set expressions, and recursive equi-joins against other resident Frames. Explicitly aliased INNER, LEFT, RIGHT, and FULL equi-joins lower to REL_JOIN, execute as bounded typed hash joins for resident values and Frames, and support composite keys.
  • (supported) - PG_TABLE("finance", "public", "orders") and related bounded Postgres helpers.
  • (supported) - READ_PARQUET("orders.parquet") |> WHERE("amount > 0") creates a frame value for filtering, projections, and columnar analytics.
  • ABOVE, BELOW, LEFT, RIGHT, and directional offset forms.
  • NEIGHBORS and NEIGHBORS(N).
    • A1@-1, A1@dt"...", and temporal-coordinate shorthands such as A1@today, A1@monday, A1@january, A1@1776, A1@5000BCE, and A1@2026-12-31 read historical values from model history.
  • ROW_INDEX, COL_INDEX, IS_FIRST, IS_LAST, and CELL_COUNT inside range-target rule actions, resolved for each materialized target cell.
  • data@"amount" for a single header/key.
  • (supported) - data@["id", "amount"], data@!["secret"], data PICK id, glob"*amount*", data OMIT secret, data RENAME "old" AS "new".

Operators

  • arithmetic, concatenation, comparison, and equality operators.
  • +, unary -, logical !, and NOT.
  • (supported) - frame |> WHERE("x > 0") |> COLLECT() desugars to nested function calls, placing the left expression as the first argument. values |> FILTER(value => predicate [, if_empty]) is the elementwise special form and lowers to FILTER(values, MAP(values, value => predicate) [, if_empty]). Ordinary FILTER(values, include_mask [, if_empty]) is unchanged outside a pipe; the legacy FILTER(_, _ > 0) pipe spelling remains accepted but is not canonical. See collections.md.
  • function-first mirror of pipe: ABS() OF A1A1 >> ABS(); ROUND(_, 2) OF ABS() OF A1 is right-associative and ≡ A1 >> ABS() >> ROUND(_, 2). The left operand must be a function call (ABS(), not bare ABS); the right operand must be a value (cell, literal, or expression without _ placeholders). Callable OF callable is rejected. %OF is unrelated (percent-of → PERCENTOF); IS MULTIPLE OF stays on the comparison layer. See infix-operators.md.
  • 50% is 0.5.
  • exponentiation** (supported) - 2 ^ 3 ^ 2 parses as 2 ^ (3 ^ 2).
  • 2 ** 3.
  • 7 // 2 (floor division). Use QUOTIENT(n, d) for truncate-toward-zero division (Excel semantics). Backslash \ is not a division operator.
  • 10 %% 3, 10 MOD 3, or 10 MODULO 3 (all desugar to MOD).
  • 10 DIVIDES 5, 10 NOT DIVIDES 3, or 10 /? 5 (desugar to MOD(a, b) = 0). See infix-operators.md.
  • 8 COPRIME 15 (desugar to GCD(a, b) = 1).
  • (supported) - a BITAND b, BITOR, BITXOR, BITLSHIFT/SHL, and BITRSHIFT/SHR.
  • [1, 2] ++ [3, 4] desugars to VSTACK.
  • [1, 2, 3] HAS 2, [1, 2] SUBSET OF [1, 2, 3], [1, 2, 3] SUPERSET OF [1, 2], and [1, 2] OVERLAPS [2, 3]. Membership and set relations compare direct elements without recursively flattening nested arrays; 2-D arrays expose rows, while subset/superset are unordered and duplicate-insensitive. Equality is type/tag-sensitive, compares errors by code, equates signed zero, never equates NaN, and distinguishes infinity signs.
  • 5! and 7!!.
  • (supported) - "ha" * 3 repeats text.
  • AND, OR, XOR, NOT, &&, and ||.
  • A1 ?? 0; DEFAULT is the canonical spelling.
    • value IN [1, 2, 3] and value NOT IN set.
  • both <> and !=.
  • 5 BETWEEN 1 AND 10, plus NOT BETWEEN.
  • "Jon" LIKE "J*n" and NOT LIKE.
  • operators** (supported) - STARTS WITH, ENDS WITH, ILIKE, and their NOT forms; CONTAINS is case-sensitive contiguous containment for both text and ordered arrays/tuples/vectors/deques, with linear sequence matching.
  • value IS NUMBER, value IS NOT BLANK, value IS EMPTY, value IS ODD, value IS EVEN, value IS PRIME, value IS MULTIPLE OF 5, and domain predicates such as value IS URL.
  • 0 <= score <= 100.
  • A1 <=> B1 returns -1, 0, or 1.
  • INTERSECT, EXCEPT.
  • synonym for EXCEPT.
  • +/ A1:A10, */ A1:A10, and &/ A1:A10.
  • (supported) - SIN.([1, 2, 3]) and ROUND.(values, 2).
  • 25 %OF 200 and 100 TO 200.
  • (supported) - n CHOOSE kCOMBIN(n, k); n PERMUTE kPERMUT(n, k); n MULTICHOOSE kCOMBINA(n, k). Bind tighter than *, /, //, and %% (5 * 3 CHOOSE 2 is 5 * COMBIN(3, 2)). Infix CHOOSE is unrelated to the lookup function CHOOSE(index, ...).
    • 100 +/- 5 and 100 +/- measurement_error.

Expressions And Control Flow

  • SUM(A1:A3), dotted function names such as Z.TEST(...), and the full generated catalog in functions.md.
  • ROUND(3.14159 AS number, 2 AS digits).
  • (supported) - score > 0 THEN "positive" ELSE "non-positive".
  • LET(x, 2, x + 3).
  • bindings ending in a result expression. Async calls are dependency-aware: independent bindings launch concurrently, AWAIT adds a barrier, DO SYNC serializes async bindings, and the result waits for all active stages.
    • TRAVERSE applies one effectful named function serially and PAR_TRAVERSE applies it with an explicit concurrency bound. Both preserve source order, enforce collection and concurrency limits before launching work, and fail closed when the function has zero or multiple effect sites.
  • WITH data = HTTP_JSON(url), users = data.results THEN users[1] ELSE BLANK.
  • total + tax WHERE total = SUM(A1:A10), tax = total * 0.21.
  • total + tax USING total AS SUM(A1:A10), tax AS total * 0.21.
  • amount UNLESS amount = 0.
  • value ASSERT value > 0 ELSE #N/A.
  • recovery** (supported) - TRY primary() THEN backup() ELSE "n/a".
    • CASE WHEN score >= 90 THEN "A" ELSE "F" END.
  • MATCH(status, "draft" -> :gray, _ -> :red). Error-literal arms match on the subject's error kind without propagating — MATCH(risky, #DIV/0! -> 0, #N/A -> BLANK, _ -> risky).
  • CHOICE status = :green | :amber | :red declares a one-of enum that makes MATCH check exhaustiveness; CHOICES perms = :read | :write | :exec declares a flag set, where perms HAS :read + :write tests membership.
  • CHOICE Reply = Ok(value: number) | Rejected(reason: string) declares payload-bearing constructors such as Reply.Ok(7). Constructor-pattern MATCH is exhaustive, fields may recursively reference the enclosing type, and nested values are bounded to 64 levels.
  • x => x * 2, (acc, x) => acc + x.
    • MAP(rows) WITH row DO ... END and REDUCE(0, values) WITH total, value DO ... END lower to the helpers' existing final lambda argument. Also supported by SCAN, ITERATE, BYROW, BYCOL, and MAKEARRAY, with checked parameter arity.
  • LAMBDA(x, x + 1).
  • DEFINE hypot(a, b) = SQRT(a^2 + b^2) names a reusable, non-recursive helper; the DEFINE keyword is optional (hypot(a, b) = …) and DEF is an accepted synonym. Definitions receive independently inferred principal signatures with fresh per-call polymorphism, open record rows, shared collection protocol constraints, and inferred connector effect rows; runtime lowering remains the compatible LET expansion.
  • (supported) - ARGS(fn), BODY(fn), and FUNCTION(fn) fold at compile time to ordinary Grid values. BODY exposes a normalized, versionable AST shape with exhaustive structural coverage of the expression tree.
  • (supported) - D(fn, x[, step]) differentiates a named definition using exact autodiff when available and central differences otherwise; INTEGRAL(fn, start, end[, control]) adaptively integrates a one-parameter definition. DERIVATIVE and INTEGRATE are the long-form aliases.
  • (supported) - SAMPLE(fn, coordinates) realizes explicit points; SAMPLE(fn, start, end[, count_or_tolerance]) produces fixed-resolution or adaptive x/y rows whose reactive bounds can be driven by a chart viewport. Multi-parameter families select a varying parameter and bind the others by name; SAMPLE_INFO reports resolution, tolerance, discontinuities, and safety-limit metadata.
  • SUM(5, _) produces a lambda when used as a value.
    • [x * 2 FOR x IN A1:A10 IF x > 0].
  • 1..10, 1..<10, 1..2..10, and date/duration ranges.
  • 1..<10 excludes the upper bound.
  • A1 >> ABS() >> ROUND(_, 2). >> and |> share the same insertion and functional-FILTER lowering rules.
  • WITH A1 DO FILTER(value => value > 0) THEN SORT(_, -1) >> TAKE(5) — same desugar as >> on _; after DO, steps may be separated by THEN, >>, or |>. Optional ELSE wraps the chain in IFERROR (classic WITH name = … THEN bindings are unchanged).
  • (supported) - value >> TAP passes the value through for inspection.
  • (supported) - value >> ABS() IF cond desugars to IF(cond, ABS(value), value). Each pipe step may have its own trailing IF; see infix-operators.md.

Function Catalog

The function catalog is the user-callable function reference:

  • functions.md lists every built-in function, grouped by category, with signature, return type, aliases, compatibility notes, and external contracts.
  • function-compatibility.md lists every canonical name and alias with its compatibility label.