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
-
(supported) -
AST.QUOTEcaptures unevaluated expressions andAST.DEFINITIONreflects local declarations. Immutable syntax values support traversal, construction, rendering, and capture-avoiding substitution in expressions and plain constructed named declarations/modules. Generated module bindings include forward and recursive uses; annotated and incomplete source forms retain explicit refusals.AST.SELECTandAST.REWRITEprovide bounded bulk operations;AST.CAPABILITIESexplains supported operations at a selected node. The selected Rust compiler service supplies parse, analysis, check, and checked rename. Source-only forms retain exact text and refuse unsafe emission. Whole-source inspection includes rule policies/actions, assignment schedules, solve goals, function signatures, graph/predicate schemas, and View outlines. Retained graph paths, partitions, patterns and fixed points expose nested records derived from compiler definitions, with validated local child links and source spans kept separately from field data. Internal lowering calls are not presented as their authored structure. View outlines, library items and graph/predicate schemas use the same generated compiler-record structure. Explicit span roles distinguish embedded expressions from retained fragments, and nested lists, names and guards preserve their compiler-owned shape without a second View/schema visitor. Rule triggers, actions, nested policies and assignment schedules also derive from compiler records; valueless actions exclude internal placeholder expressions. Incomplete clauses remain explicit; structure coverage and emission support are distinct properties.AST.MEANINGand Code's Explain expression bind semantic facts to exact source revisions, with resolved bindings, contextual types, known effects, direct source dependencies, and retained assignment facts. Partial and unknown information remains explicit; changed revisions refuse stale selections.AST.EDITprepares revision-bound expression replacement, extraction, and signature changes with resolved direct caller updates.AST.APPLYreconstructs and compiles a reviewed transaction before returning source. Code shows focused edits and diagnostics and stages atomically against the original draft. Lexical capture, stale revisions, altered edits and unsupported call uses are refused; compilation is not presented as behavioral equivalence.AST.DIAGNOSTICSvalidates revision-bound authored findings and inert suggested edit requests. Explicit Grid analyzers feed Code Problems and source markers; suggested fixes open checked transaction previews before atomic draft staging. Analyzer results remain distinct from compiler validity and proofs.AST.HOLE,AST.SPLICE, andAST.EXPANDadd explicit quoted templates, expression/argument/array substitution, and bounded per-node generated origins. Code's expansion viewer reconstructs input claims, checks declaration source without executing it, and follows compiler findings to template/input locations. Constructed template locations may be structural only; declaration-list splices and complete origin preservation through constructors remain unsupported. Working models cover auditing, refactoring, native TREE invoice translation, and generated calculations. Code offers a source-linked syntax inspector, checked rename previews, example scratchpads, and explicit generation previews. A bounded Rust worker compiles generated source and executes requested outputs in a fresh LIR model; staging requires review and an explicit save. See compiler tools for the schema, limits, and host support. -
(supported) - The sequential Desktop subset of
TEAMandPROCESSdeclarations retains addressedASK,SHARE,UNSHARE, childRUN, bounded repetition, lexical scope and source imports for analysis and formatting.PRIVATELY ... ENDis a scoped value block in the internal runner: histories continue and only the returned value escapes. The selected internal runner also executes freshROOMplans, sequential public turns, roomSHARE/UNSHARE, and childRUN ... IN roomwith exact role keys.READ(room)returns bounded public metadata that ordinaryFILTERandMAPexpressions can query. Public and private histories remain separate. The internal Processes panel can inspect bounded room metadata at waiting and terminal checkpoints, without an authored read or further model call. Live room handles and room resources are still unavailable. Installed sequentialops:exports now compile as typed PROCESS steps:status = service.read_status(target)or an unbound call before another step. Imported processes and saved-source replay retain the exact descriptor. Calls lower to explicit operation nodes; formulas, nested effects and independent operation groups refuse. A selected internal volatile environment now executes operation calls, suspends pending work without polling and accepts typed results before acknowledging receipts. Results can feed SHARE and ASK. The internal process service binds operation authority per principal/model, exposes pending metadata and queues explicit settlement on its shared executor. Stale operation identities or revisions refuse without another lookup. Desktop binds installed single GET/HEAD API queries through that environment. API results are schema checked before SHARE or ASK; writes, pagination and durable operation recovery remain unavailable through this adapter. See the API and agent workflow.INDEPENDENTLY EACH item IN itemssupports isolated freshRUNchildren and an ordered join; outer conversations, carried state, borrowed rooms and transitive external operations are refused. See the newsroom walkthrough. SequentialEACH item IN itemsproduces ordered position/value rows;WITH state = seedfolds over the same items. The current 32-item upper bound is reserved conservatively; empty inputs perform no turns. See the collection review. A localmethod = careful THEN reviewed ELSE briefcan select between two named procedures or staticPROCESSparameters beforeRUN method(...). Both alternatives are checked; only the chosen child executes. Local aliases retain the decision and remain excluded from payload data. See method selection. Nested/reference-container choices and passing runtime references through PROCESS parameters remain open. Compilation lowers the executable subset into an inert, validated process artifact beside the model's callables. Desktop selects the sequential runtime: save a model, open Agent → Tasks → Processes, select models and explicitly Start. Saving or evaluating a plan performs no inference. Process plans and their local bindings are excluded from workbook cell lowering and named-value hydration. The panel shows each retained reply and the final result. See the guided debate. Server, Cloud and Embedded do not select this capability by default; hosts without it refuse withPROCESS_UNAVAILABLE. The alternating debate and draft/review/revise samples execute in the internal deterministic harness, including continuing/fresh histories, explicit sharing, bounded stopping and validated published inputs. Ordinary bindings namedevidenceremain distinct fromEVIDENCEclaim declarations. Code completes retained process data and participant scopes, static child targets, and root team selections. Suggestions exclude later locals and independent sibling results; malformed declarations withhold suggestions. Process rename remains unfinished. Ordinary formulas and unaddressedASKkeep their existing behavior. The broader coordination language remains under implementation. The supported Desktop subset does not include API writes, browser operations, live room handles, population generators or distributed execution. -
(supported) - Code exports portable top-level composite ELEMENTs as
.griduipackages with author-selected parameter types and named content slots with defaults. The compiler checks the draft with its current imports before download. Independent stateful composites can instead use.gridcomponentsource packages in Code: local state and actions recompile for each receiving instance. Captured bindings, model-relative calls and unproven dependencies are refused. Export bundles local element and named action helpers transitively as private nested declarations, including custom PRESENT controls and action callbacks passed to local elements. Code/App import reviews list helpers, named actions and complete source. Shared Grid functions and imported closures still use libraries. New View creation and reviewed App conversions insert at the compiler boundary in one rich-Code Undo step, retain Whole model and open the new inspector after analysis; explicit Save applies the draft. Conversion handoffs retain App/source identity, support cancellation during editor loading and never replay refusals. The plain editor retains its limited staging commands. Selected component instances identify their compiler-owned shared definition, with exact Code navigation for local composite/native contracts and caller USE links plus dependency navigation for imported definitions. Custom PRESENT components preserve private/transitive library ownership. Stale links are disabled. Code can create a bound View instance during import, reviewing the element and SURFACE as one staged edit. The compiler checks bindings and generates separate local state and native rules. Repeated rendered instances keep their own labels, help, validation descriptions, tab panels and page headings while preserving compiler identity for Code navigation. App Builder can place saved View instances through Insert View…, with binding review, private local state, guarded live source updates and ordinary App document recovery. React ejection retains those Views through the sharedui.Apprenderer, including nested Form guards and the enclosing Component write permissions. Framework downloads and published Apps capture referenced View documents, static scripts and admitted assets together; model values stay live and source edits require re-export. Builder also imports source packages through Import View component…, with reviewed bindings, guarded source saving and recoverable App placement. App Undo retains the reusable View in Code. App conversion now gives library components distinct declaration names and reviews original IDs/names, translation gaps and source links in Code. Full App identity reconstruction remains incomplete. Code also imports one selected package component through a source review and checked insertion, with name-collision refusals, draft staging and one-step Undo. Bounded source annotations retain App library identity, version, descriptions, parameter and slot metadata through formatting and selected import/export. Code preselects retained parameter types and reviews labels/defaults; Grid argument semantics remain unchanged.BODY "name"declares a composite slot with optional fallback children;SLOT "name"supplies caller-owned content, including an explicit empty fill. Code offers the declared slots as checked source edits and completions. App insertion retains defaults and avoids capturing caller bindings. ContextualSURFACE Nameoutlines preserve ordinary bindings namedsurface. Indentation, pages, elements, actions, locals, guards, arrangements, contracts (including split/close-only boolean lenses), checks, and verbatim JavaScript/CSS blocks have source-mapped syntax trees. Locked React contracts can select SCRIPT JSX adapters with phrase props, lens pairs, declared events and explicit part attributes; published adapters are prepared module files using the host React instance. Selected composite import/export bridges portable App templates, concrete binding parameters and named slots with retained container styling; App migration retains those library definitions as ELEMENT source and retains model-dependent library records as source-owned metadata. Node IDs, workbench references and saved View placements survive migration. Closed local/imported Grid function dependencies travel with source components under private names; native admission still refuses captured model state and authority. Imported contracts also check known literal tuple positions/lengths, choices and discriminated record alternatives. Intersection contracts check each member and combine their event-field hints. Importing tuple contracts preserves optional entries and trailing rest items; known values and event fields retain their cardinality and positional types. Code completes contract phrase and part names and reports invalid tells at their source. Locked JSX imports offer native prop types from admitted contracts with isolated completion and diagnostics; full package declarations remain incomplete. Named local and imported SCRIPT helpers carry per-use contract expectations into Code, preserving property-context and asks-callback calls. Lens converters carry separate model-side and foreign-side parameter/result types, including bounded known model records. Generated View wires retain bounded source excerpts, hashes and locations in compiled metadata, including separate imported definitions; native WHY uses the traced source revision. Native event signatures type captured JavaScript values and USING members; shared browser functions retain each use’s lexical types in Code. Built-in Kanban/Calendar/Map events expose fixed payload types and bounded known-row field hints. Grid handlers diagnose missing known-row fields and invalid scalar field reads at their source locations. Grid member completion uses those same scoped row names and finite imported record shapes, including nested records and array items. It inserts quoted brackets for nonidentifier fields, respects local parameter shadowing and intersects union alternatives. Shared element uses offer common fields. Importedpartsdeclarations require a component adapter at placement, which receives each declareddata-partattribute object for its actual DOM element. Recursive serializable imported records retain bounded graph references in contract types. Code checks recursive fields and Grid checks known values, lenses and event paths without expanding cycles into an infinite schema. Code and headless CHECK expand each graph into named type aliases, so a cycle that closes at a union (type Json = string | Json[] | { [k: string]: Json }) reports ordinary member and assignment errors instead of an "excessively deep" instantiation that silently dropped every check. Installed component prop declarations can retain required and unmapped props and callbacks in isolated Code imports. Older library locks retain the admitted contract fallback; bounded type metadata never enters runtime documents. App-to-View migration preserves executable legacy Button contracts and their styling when an arrow cannot express the complete settings. Literal JSON lists and records retain their exact shape as admitted View properties. Migration also retains App label defaults and table paging/selection defaults; it does not acquire those from the View placement policy. Page conversion uses one collision-free name plan for declarations and navigation, preserving valid names before assigning aliases. Code reviews the original names, routes, home page and changed order, with source links into the candidate. Static route lookup follows App case and slash normalization; duplicate routes remain explicit gaps. Identity and order differences remain in the comparison. Repeater migration retains custom row aliases, nested row scopes, filters, limits, empty text and windowing settings. Resident queries stay page-bounded; non-windowed arrays render the admitted row limit without a pager. Calendar end-column continuations remain distinct from END lines. Closed composite argument lists accept shared label/layout phrases and continuations without treating parameter values as phrase names. The formatter preserves expression and foreign payload bytes. This entry covers authoring syntax; see Grid Views for the evaluation boundary and the implementation contract.Conditional record and row-set presentation retains field tags shared by all outcomes; proven whole-row selection/reordering carries those hints into Forms and tables. Date/datetime row hints preserve the native temporal carrier for formatting without reinterpreting ordinary text. Checked column format edits retain explicit-over-inherited precedence. Unknown and conflicting tags are withheld; this is admission metadata, not a browser evaluator.
Native model input batches check contracts against all proposed values before committing any member. Computed validation operands see that proposed state, including defaults restored by a clear. The detached resolve uses the ordinary evaluator and refuses missing/error/external operands without committing. View controls and Forms now ask the native host to check proposed values. Check values returns field messages without a write; Save checks again before its guarded batch. Computed/equality contracts use native operands, not committed browser projections. Private copies check their own session. Missing/old hosts refuse without saving; managed learning batches remain unsupported.
Model text contracts (
LIKE,ILIKE,STARTS WITH,ENDS WITH,CONTAINS) and text/Boolean equality reach controls with their declared messages. Direct model operands and plain aliases read staged Form inputs; computed operands remain native wires. Code edits the owning clause through checked source transactions. Numeric/structured equality feedback remains host-owned.Analyze supplies contract-derived completion spans and a read-only source outline; these editor inventories add no ordinary formula compilation or runtime work. Browser-local collections admit stored-field repeaters with direct field keys. Literal, nested row and explicit JavaScript row sources survive the shared document and renderer, including empty arrays. Checked row-identity edits retain browser ownership; computed browser row expressions remain explicitly refused. Model row derivations retain the native path. Compiler-admitted repeated local templates instantiate by element path and typed row key, retain state while hidden or paged away, and share their declaration's constraints and defaults. Repetition binds lexical row names before component arguments and restores the enclosing scope. Properties edits a direct row-local contract at its exact declaration, including same-named outer locals. Inline edits now also target declared local arrays and arrays inside local records, including repeated-element locals. A bounded private operation uses typed keys, checks the current field and whole-local validation, and preserves neighboring data and Grid vector shape. Duplicate/missing keys are refused; conflicts retain the draft for reapplication. Checked column controls, native formatting, paging and reset share the same source and renderer. Nested private tables follow explicit enclosing stored-field keys through multiple repeaters and component arguments. Compiler-owned row identities survive binder shadowing and per-instance local roots; admission checks all declared ancestor schemas and mutation checks the current keyed path. Nested table column Properties preserves those paths in a checked source transaction. Row-source validation follows stored private collections to their containing local declaration, including read-only lists and repeated body locals. Properties separates the whole-local rule from displayed rows, keeps source navigation, and rejects changed or ambiguous ownership. Direct columns with dynamic schemas remain row fields in Code's diagnostics. Editable table/picker columns retain literal format, heading, alignment and width through compiler-checked source edits; they keep their input control. Native format plans drive precise numeric editing while keyed row lenses preserve model write ownership. Model FORMAT policies reach row fields through bounded native tag-lattice selection, including reactive patterns and explicit column overrides. Compiler-owned field metadata retains uniform declared row tags through local JSON and replacement edits. Nested record forms inherit policies while preserving one guarded Save and active numeric draft units. Date, date-time, text and boolean fields show native formatted readouts beside their original controls; raw edits and zoned date-time text survive Save. Pending/retried scalar formatting stays editable and print shares the result. Numeric local literals reuse native compilation; exact numeric defaults stay text. Native tables and table views pass current column types/units to the evaluator for inherited policy selection; currency, percent, physical units and date columns retain their metadata, numeric blank repair and keyed writes. Mixed/computed local schemas still need per-row presentation hints. View admission retains exact subject spans for automatic tables, maps and generated record forms. Code exposes their shared options and checked appearance edits, retaining row columns and record-field ownership. Record inspectors list nested object-literal fields and edit their source defaults at the owning input or local declaration, including plain aliases and shared component definitions. Checked transactions preserve sibling fields, whole-record validation and Code Undo. Sensitive defaults stay in Code; computed record schemas explain the source editing boundary. Add, rename and remove fields or nested records through checked schema edits, preserving other defaults, comments, validation and one Code Undo step. Names are record keys; references elsewhere keep their existing spelling. Field-specific validation remains separate work. Structural moves across repeater, page or declaration scopes prepare an exact source review with compiler checks before Apply. Invalid references remain refused; scope changes may deliberately rebind a valid same-spelling name. The reviewed candidate shares Code Undo and cannot apply to a changed editor. Availability controls edit
needsconditions and explanations together, including separate action requirements, through checked source transactions. Ordinary and direct native arrow requirements can be added or removed individually, preserving nested actions, requirement order and refusal handlers. Native action requirements have a separate inspector section from component availability, with the selected activation event's values listed. Named native and embedded event handlers also expose requirement controls, with independent event scopes and preserved neighboring handlers, slots and refusal actions. Availability groups can wrap supported blocks, edit an explanation or redirect, and remove their wrapper while retaining contents and separate visibility. Compiler-checked source transactions preserve payloads. Wrapping or lifting declaration-owning blocks shows an exact source review before Apply, with duplicate names and invalid references refused; condition-only edits stay direct. Reusable-element inspectors combine required arguments and shared options, preserving caller content and existing argument spellings when a bare call needs parentheses or a continuation must move onto its header. Validation ownership follows admitted component instances into nested and transitive helpers, native slots and consumed caller bodies. Definition paths distinguish same-named locals; repeated instances share one source contract. Unused helpers and unconsumed content contribute no owners. Imported locals stay in library source, and bounded inventories explain their editing limits. Table and picker inspectors add, update, remove and reorder column declarations, including display expressions, headings, literal presentation settings and keyed inline editing. Plain row-source aliases follow their input/default or native table owner, preserving qualified named/cell targets and native commits. Local shadowing never grants writes to a same-named model input. Row-action controls create buttons, edit captions and inline bodies, expose scoped requirements, and move/remove complete blocks with attached refusals. Existing action keys and table settings are preserved. Literal table-column FORMAT patterns now use the native TEXT formatter through bounded display batches, retaining date types and raw sorting/edit values. Scalar Text/Metric/Stat/Badge displays use the same native operation for declaration and host-resolved patterns, preserving line-option precedence, private local state, unit labels, cancellation and export readiness. Table columns, row actions, pickers and repeated controls expose the surrounding row source's whole-collection validation, exact source/declaration navigation and checked edits with Undo. Pickers keep their selected-value owner separate; nested repetitions use the nearest collection. Plain aliases and admitted View locals retain declaration ownership. Computed/native sources without a direct owner explain the source editing boundary instead of guessing one. Individual field-validation editing and native-host acceptance remain incomplete. Explicit literal arrow keys pin rule identity across label and wrapper edits.Link "text" to "url"binds its caption and destination separately. CHECK setup supportsreset Namefor input/local defaults and literal JSON withINTO/TYPE_TAGannotations, without adding production computations. Code captures staged private-preview preparations through checked source edits.undoablearrows join the open view's undo/redo history:+=/-=targets undo by their own delta, other values and keyed table rows are restored from what the runtime reports the click committed.undoable within <duration>holds an arrow's effects so an undo can cancel them, andundo -> …declares how to reverse effects that have run. Capture is selected per arrow at model admission; ordinary arrows and rules pay nothing.Private table record/list fields have bounded JSON drafts with explicit Save/Cancel, content-aware conflicts and keyed field replacement. Compiler array/object hints retain blank repair, and browser projection preserves nested list shapes. Admitted model input/default record lists use the same editor with native field/list-position types, exact/date text and matrix axes retained. Typed record actions preserve row keys and values through the existing model rule and outcome. Literal row admission retains shallow field roots even when nested lists have mixed types. Unsupported native carriers and individual field contracts remain outside this editor; native-host acceptance is pending. Stored record paths such as
Order.shipping.linesnow retain keyed edits at the containing input/default, with current parent and neighboring values preserved by the existing rule. Code exposes checked columns and the containing input's whole-value validation, including context for repeated readouts. Keyed enclosing model rows and shared element arguments now retain this owner. Native ancestor keys and one edited field cross the action boundary; root guards reject missing/duplicate keys before staging. Code offers columns and the containing input contract inside shared definitions. Dynamic/dotted INDEX fallback keys stay outside this contract. Admission is bounded to 32 stored field/key steps and 65,536 visits per helper; native acceptance remains pending.Numeric controls and editable columns accept native fractions and decorated accounting, scientific and scaled entry across format sections. Ambiguous signs/scales retain the draft; plain decimals keep its active display units. Invalid numeric fields block Form Save until repaired. Code's existing column editor changes these patterns through one checked source transaction and Undo.
-
(syntax-only) -
A3 = CAD.EVALUATE(A2)declares a guarded, read-only CAD result depending on a separate description cell. Grid recognizes the declaration, but ordinary model execution refuses it. This is not a callable geometry function or a supported headless workflow. -
(supported) -
CAD.DESIGNand its typed child constructors return bounded, immutable v2 authoring data. Construction validates declarations and dependencies, not geometry. Explicit v1 migration retains original source bytes. This does not imply a reactive CAD evaluation region or graduation of the described geometry; see the function reference. -
statements are separated by newlines or semicolons. Example:
A1 = 1, thenB1 = A1 + 1. -
metadata headers such as
MODEL "Portfolio",DESCRIPTION "...",VERSION "1.0.0",AUTHOR "...", andTAGS "audit". -
USE "shared/finance.gs" AS financeimports reusable definitions under a namespace;EXPOSING (...)selects flat imports. Definitions-only.gslibraries may import transitively, while cycles, duplicate aliases, and executable library statements fail with diagnostics. -
(supported) -
DECISION PACKAGEpins a native computation's version, domain, dialects, capabilities, and typed artifact contracts in module metadata. Resident loading matches the complete declaration against the native registry and fails closed on unavailable or mismatched contracts. -
(supported) -
REQUIRES crm = NETWORK("https://api.example.com", GET)andREQUIRES auth = SECRET("crm.read")declare exact authority metadata forNETWORK.GET_JSON. Requirement aliases never become ordinary values or captured secrets; compiler-owned call contracts retain the normalized origin, method, secret purpose, and effect route. -
(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 = 125000orcurrency 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. BoundedITERATE,PARAMETER, andTRAIN_ADAMWprovide portable inference and training syntax. See Tensor shape, precision, and training for axis conventions, bounds, and the non-training array fallback. -
amount INTO currencyoverlays a type tag on an expression value; lowers toTYPE_TAG(amount, "currency"). Same semantic overlay as declaration-levelIS, but usable inside expressions. -
tags refine one another (
USDis acurrencyis anumber;jsonis anobject), a leaf implies its ancestors, and currencies take thecurrency:<code>qualifier (bareUSDtoo) —unit:is for physical units. -
(supported) - one header keyword sets both the dimensional and coercion axes;
strict except <axis>differs on one. Understrict, 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 refutedVALIDATEassertions (GRID_VALIDATE_UNSATISFIABLE) become compile errors. -
directive** (supported) -
dimensions strict,dimensions warn, anddimensions offselect the dimensional-analysis policy independently of value coercion. -
advice** (diagnostic) -
GRID_NESTED_ARRAY_TRANSPOSEexplains the outer dimensions of statically known literal nested arrays and the semicolon row syntax for scalar matrices. It remains advisory under strict dimensional checking and never rewrites intentional nested data or evaluates live inputs. -
unit_scales warn,unit_scales strict, andunit_scales offselect a compile-time audit of numeric unit representations. Explicit strict enforcement rejects known scale conflicts and unverified unit-sensitive expressions. It does not convert arithmetic, select another evaluator, or change the existingstrict/looseaxes. See unit scales. -
FORMAT/VALIDATE/PRESENT/##notes** (supported) - trailing declarative clauses attach a format pattern, a validation clause, a preferred Grid View element, and doc notes to the cell in source.VALIDATEon aninputcell 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-levelFORMAT <tag> <expr>declares tag policies; ruleFORMATactions andRESET FORMATmanage the override layer.PRESENT <Kind>selects a binding's usual standard, declared, or imported view element (a native subject contract or one-subject composite); an explicit kind on a view line has higher priority. Direct cell-address inputs retain their writable binding, validation and presentation in Views, including equivalent A1/R1C1 references and sheet-qualified addresses. StandaloneVALIDATE FIELDdeclarations now lower exact model-input record paths to mandatory native contracts, sharing whole-record and proposed-batch semantics. Compiler authoring create/update/remove/undo is exercised natively. Full field-contract delivery verification (including host recovery, performance and browser save/reopen) remains in progress. -
predicate reviewed(by: string)declares a typed payload schema.x is :reviewed(reviewer) = 1attaches it; the readability articles inx is a :reviewed(...)andx 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 throughPREDICATES(x).reviewed.byorx.predicates.reviewed.by. Field contracts fail closed; absent fields read asBLANK. Fieldless predicates such as:happyremain 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, andmanyinstances remain parallel:appliesedges. -
(supported) -
predicate releasable means ...defines a proposition about its implicit subject. Facts, natural predicate laws,EXISTS/EVERY, named structural routes (THEN,OR,*,REVERSE), BooleanNO path, result-valuedREACHABLE, checkedthereforeconclusions, andWHYshare one Predicate engine. RecursiveEVERYcomponents use dependency-SCC-scoped greatest fixed points. General modality uses independent support/refutation evidence:EVIDENCE(atom)returnsneither,supported,refuted, orboth;MUSTreads support,MAYmeans not refuted, andCANNOTreads refutation. Thebothstate 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 buildand topology facts such asparcel inside districtshare bounded family-local inference with conceptual-set facts such asvip included in active. Topology is authored asseparate from,touches,partially overlaps,coincides with,inside,encloses, andintersects, with optionalwith boundary contact/without boundary contactrefinement. Conceptual sets useincluded in,includes,disjoint from,overlaps with, andsame members as, with optionalstrictlyrefinement. Empty extents retain exact equality, inclusion, overlap, and disjointness meaning. Plain queries meanMUST;MAY,CANNOT, alternatives, complements, reactiveIF/UNLESS,RELATION,RELATION_STATUS,WHY, family selection, and contradiction isolation are supported. -
(supported) -
default B1 = …marks an overridable base a rule mayset,RESETto the base, orCLEAR. -
STATE counter = 0declares 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) - component slots such as
Name!type,Name!config,Name!data, andName!sourceare qualified named wires that can be assigned and referenced without requiring grid coordinates. -
(supported) -
A1:A5 = 0expands to per-cell assignments. -
(supported) -
[total, avg, ...rest] = SUMMARY(B1:B10). -
A1 = NOW() ONCE,A1 = NOW() EVERY 5min, andA1 = TRUE AT dt"...". -
predicate
WHEN, settled-valueCHANGES/BECOMES, and scheduledEVERY/ATblocks with eager rule-action assignments.WHENsupportsSERIAL/boundedCONCURRENTadmission andLATEST, boundedQUEUE, or durableLEDGERevent retention using captured event-time inputs. -
(supported) -
STOCK,PREV, andDELAYdeclare model-time state whileSIM_TIME()andSIM_STEP()expose the active simulation clock. Simulation resolves use explicit or persistedt0/dt/step configuration and isolated scenario inputs; Euler is the default integrator, while RK4 is available for all-STOCKmodels and rejects discrete-state mixtures. -
declarative goal-seek and bounded optimization over cells:
SOLVE Z9 = A2 IN [0, 1] GOAL A3 = 200000, orMINIMIZE/MAXIMIZEan objective cell. Result, variable, and goal accept cell addresses or named wires; bounds and goal targets accept expressions evaluated from the current inputs. For example,SOLVE Recommended = Candidate IN [0, Capacity] GOAL Residual = Target. The result cell receives the solved value; solves are reactive and never mutate the variable cell. Seeassignments.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, andNOTare 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 ... ENDcreates an immutable grammar value.grammar USING LALR|EARLEY|PACKRAT|DFA|AUTOcreates a portable parser recipe,GENERATOR ...makes the strategy independently authorable, andPARSE(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, andTHEOREM— including bounded solver search, saturation, and checked theorems as proved equation sources. Seegrammars.md. -
(supported) - contextual
symbol xdeclarations create immutable mathematical variables that compose through ordinary Grid operators, references, and admitted functions. TheSYMBOLIC.*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, including linear and quadratic equations with coefficients in a real quadratic field and exact substitution into those expressions. Results retain conditions, bounded work, completeness, and replayable Tree certificates; there is no held-body syntax, string evaluator, or alternate public AST. Seesymbolic-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, andCASE. -
allowed in function calls, array literals, object literals, and
MATCHarms.
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.GRAPHnodes;relates toadds directed edges andconnects toadds bidirectional logical relationships, with typed payloads, list expansion, and stable identity. - (supported) -
MODEL.TAGSretains the unary-only:<predicate> -> "model symbol"projection for source compatibility. - (supported) -
MODEL.PREDICATEScombines 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.relationprojects an arbitrary resident GraphHandle into Predicate v10 with exact string, symbol, and integer node identity.WITH PROPERTIESadds joinablegraph_node,graph_edge,graph_node_property, andgraph_edge_propertyfacts for typed scalar properties.WHYretains 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 hopsstates 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 iterationsexposes 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 Graph Authoring. - (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 throughGAME.NORMAL_FORM; theextensive = Treeform 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.VERIFYclaims 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 throughMECHANISM.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_000and0.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"}`. TRUEandFALSE, case-insensitive.- (supported) -
glob"*.csv",wild"inv-????", andBLANK. date"...",dt"...",duration"...",cron"...", and domain literals such asurl"...",mol"...",dna"...",color"...",note"...",bin"...",b64"...", and markup typed stringshtml"...",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 anddecimal"0.1"for exact fixed-precision decimals, plus theBIGINT(...)constructor. Exact values keep their precision through arithmetic and number-theory functions such asISPRIME,MODPOW,GCD,ISQRT, andRANDPRIME;decimal"0.1" + decimal"0.2"equalsdecimal"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).
- duration suffixes (
- (supported) -
unit smoot = 1.7018 mand derived scale-only units extend dimensional inference without shadowing built-ins or using affine bases. Declarations and inferred dimensions persist in compiled module metadata. - (supported) -
fx_rate R1C2 = EUR/USDmarks an ordinary numeric rate cell as a directional currency conversion. Dimensional checking accepts the declared direction, rejects the reverse use, and retains the declaration in compiled module metadata. #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 toHSTACKfor horizontal concatenation.{name: "Ada", level: 9}and{"first name": "Ada"}.- (supported) -
(1 + 2) * 3.
References, Ranges, And Access
$A$1,AA100,R1C1, andR[1]C[-2].- (supported) -
Revenue = A1gives the existing reactive binding a semantic address; calculated or decorated named assignments remain distinct bindings. R1C1:R3C3.- (supported) -
A:A,A:C,1:1, and1:3in expression positions. A1#refers to the full spilled rectangle anchored atA1.- (diagnostic) -
@A:Awas removed (it never reduced a range to a row/column value —UnaryOp::Atwas pure identity). A prefix@on a reference now rejects withGRID_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, including addressed fields such asA1.valueandR1C1.value. data[-1]anddata[^1].data[2:5],data[:3],data[3:], anddata[1:10:2].- (supported) -
Sales[Revenue]. QUERY(data, "SELECT * WHERE col1 > 5")for table-like arrays.- (supported) -
table Orders = { schema: "orders" }declares durable table state, whiletable PaidOrders = SELECT ... FROM Ordersdeclares a continuously maintained live table. Connector-backed table declarations retain their authored schema and ingestion contract as model metadata. - (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 asSELECT 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 andTuple/Vector/Dequecollections ofRecordrows 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.WHEREuses a canonical recursive predicate tree with SQLNOT/AND/ORprecedence and three-valued blank/NULLbehavior.LIKE/ILIKEuse SQL%and_wildcards. Computed projections use a typed scalar tree and requireAS; arithmetic, searched and simpleCASE,COALESCE,NULLIF,ABS,SQRT,FLOOR,CEIL/CEILING,ROUND,POWER,LOWER,UPPER,LENGTH,CAST,TRY_CAST,IN, and inclusiveBETWEENshare the same backend-neutral contract. Cast targets canonicalize tonumber,string, orboolean;CASTreports an invalid conversion whileTRY_CASTreturns null.CASEis ordered, first-true, and treats unknown conditions as fallthrough.FETCH FIRST|NEXT n ROW|ROWS ONLYis the SQL-standard spelling of the same bounded result stage asLIMIT n.LIMIT n OFFSET mandOFFSET 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|LASTcontrols blank/ null placement for outer and analytic-window ordering; omitted placement remains null-last in both directions. OuterORDER BYaccepts 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, andRANGEbounds share cached key values across those backends.COUNT(*)plusCOUNT,COUNT(DISTINCT ...),SUM,AVG,MIN, andMAXover portable scalar expressions execute for resident values, Frames, Polars, DataFusion, and supported warehouse pushdown. Post-aggregateHAVINGuses the same predicate tree.SELECT DISTINCTdeduplicates typed projected rows before outer ordering and limiting across resident relations and source-proven Frames. SQLUNION,INTERSECT, andEXCEPT, with optionalALL, compose complete query results positionally. Typed duplicate/null semantics, SQL multiset counts,INTERSECTprecedence, left-arm column names, and final-result ordering/limits are shared by resident collections and source-proven Frames. Analytic projections supportROW_NUMBER,RANK,DENSE_RANK,NTILE,PERCENT_RANK,CUME_DIST,LAG,LEAD,FIRST_VALUE,LAST_VALUE,NTH_VALUE, and windowedCOUNT/SUM/AVG/MIN/MAXwithPARTITION BYandORDER BY, shared by resident values, Frames, local analytics, and warehouse pushdown.LAG/LEADaccept bounded offsets and scalar defaults; aggregate and value windows accept validated explicitROWS BETWEEN ... AND ...andRANGE BETWEEN ... AND ...frames. Grouped queries stageWHERE, aggregation,HAVING, windows, outer ordering/result-window, and final projection in SQL logical order. Parenthesized relation subqueries and non-recursive SQLWITH 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-correlatableEXISTS,NOT EXISTS, correlatedIN, and null-aware correlatedNOT INover 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 RECURSIVEexecutes as a bounded fixpoint group over header arrays and native record sequences, with column lists, multiple bindings, simultaneous mutual recursion, per-bindingUNION/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 aliasedINNER,LEFT,RIGHT, andFULLequi-joins lower toREL_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 aframevalue for filtering, projections, and columnar analytics. ABOVE,BELOW,LEFT,RIGHT, and directional offset forms.NEIGHBORSandNEIGHBORS(N).-
A1@-1,A1@dt"...", and temporal-coordinate shorthands such asA1@today,A1@monday,A1@january,A1@1776,A1@5000BCE, andA1@2026-12-31read historical values from model history.
ROW_INDEX,COL_INDEX,IS_FIRST,IS_LAST, andCELL_COUNTinside 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!, andNOT.- (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 toFILTER(values, MAP(values, value => predicate) [, if_empty]). OrdinaryFILTER(values, include_mask [, if_empty])is unchanged outside a pipe; the legacyFILTER(_, _ > 0)pipe spelling remains accepted but is not canonical. Seecollections.md. - function-first mirror of pipe:
ABS() OF A1≡A1 >> ABS();ROUND(_, 2) OF ABS() OF A1is right-associative and ≡A1 >> ABS() >> ROUND(_, 2). The left operand must be a function call (ABS(), not bareABS); the right operand must be a value (cell, literal, or expression without_placeholders). CallableOFcallable is rejected.%OFis unrelated (percent-of →PERCENTOF);IS MULTIPLE OFstays on the comparison layer. Seeinfix-operators.md. 50%is0.5.- exponentiation** (supported) -
2 ^ 3 ^ 2parses as2 ^ (3 ^ 2). 2 ** 3.7 // 2(floor division). UseQUOTIENT(n, d)for truncate-toward-zero division (Excel semantics). Backslash\is not a division operator.10 %% 3,10 MOD 3, or10 MODULO 3(all desugar toMOD).10 DIVIDES 5,10 NOT DIVIDES 3, or10 /? 5(desugar toMOD(a, b) = 0). Seeinfix-operators.md.8 COPRIME 15(desugar toGCD(a, b) = 1).- (supported) -
a BITAND b,BITOR,BITXOR,BITLSHIFT/SHL, andBITRSHIFT/SHR. [1, 2] ++ [3, 4]desugars toVSTACK.[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 equatesNaN, and distinguishes infinity signs.5!and7!!.- (supported) -
"ha" * 3repeats text. AND,OR,XOR,NOT,&&, and||.A1 ?? 0;DEFAULTis the canonical spelling.-
value IN [1, 2, 3]andvalue NOT IN set.
- both
<>and!=. 5 BETWEEN 1 AND 10, plusNOT BETWEEN."Jon" LIKE "J*n"andNOT LIKE.- operators** (supported) -
STARTS WITH,ENDS WITH,ILIKE, and theirNOTforms;CONTAINSis 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 asvalue IS URL.0 <= score <= 100.A1 <=> B1returns-1,0, or1.INTERSECT,EXCEPT.- synonym for
EXCEPT. +/ A1:A10,*/ A1:A10, and&/ A1:A10.- (supported) -
SIN.([1, 2, 3])andROUND.(values, 2). 25 %OF 200and100 TO 200.- (supported) -
n CHOOSE k→COMBIN(n, k);n PERMUTE k→PERMUT(n, k);n MULTICHOOSE k→COMBINA(n, k). Bind tighter than*,/,//, and%%(5 * 3 CHOOSE 2is5 * COMBIN(3, 2)). InfixCHOOSEis unrelated to the lookup functionCHOOSE(index, ...). -
100 +/- 5and100 +/- measurement_error.
Expressions And Control Flow
-
SUM(A1:A3), dotted function names such asZ.TEST(...), and the full generated catalog infunctions.md.BIO_OMICS_EMBED_V2(matrix, components, "pca")requires an explicit supported method and positive integer component count; older runtimes refuse this identity. The legacyBIO_OMICS_EMBEDretains omitted-method SVD semantics. DNA motif arguments are strings.BOOTSTRAP_ZERO_CURVE.EXACT(...)performs a sequential regular-schedule discount-factor bootstrap;.REPORT(...)adds instrument repricing details. The legacy undotted curve function retains its approximate method. -
ROUND(3.14159 AS number, 2 AS digits). -
(supported) -
score > 0 THEN "positive" ELSE "non-positive". -
LET(x, 2, x + 3). -
helpers** (supported) -
apply_to(operation, value) = operation(value)accepts statically inferred callable arguments.LETandDOmay bind and call local lambdas. Data bindings preserve built-in calls; an already inferred callable binding can shadow a built-in. Unconstrained collisions select the built-in and retain a data-only parameter constraint. Self-application, unknown callable invocation, and escaping callable values are compile errors; callables remain confined to expression scope. See named functions. -
(supported) -
ITERATE(seed, bound, step) UNTIL predicatetests the seed and each new state.ITERATE.REPORTaddsvalue,steps, and a:converged/:limitstatus. The mandatory bound remains at most one million steps; predicates are pure, and Tensor-resident iteration rejects this data-dependent exit. See collections. -
bindings ending in a result expression. Async calls are dependency-aware: independent bindings launch concurrently,
AWAITadds a barrier,DO SYNCserializes async bindings, and the result waits for all active stages. -
TRAVERSEapplies one effectful named function serially andPAR_TRAVERSEapplies 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 | :reddeclares a one-of enum that makesMATCHcheck exhaustiveness;CHOICES perms = :read | :write | :execdeclares a flag set, whereperms HAS :read + :writetests membership. -
CHOICE Reply = Ok(value: number) | Rejected(reason: string)declares payload-bearing constructors such asReply.Ok(7). Constructor-patternMATCHis exhaustive, fields may recursively reference the enclosing type, and nested values are bounded to 64 levels. -
(supported) -
CHOICE Maybe<T> = None | Some(value: T)supports inferred constructors (Maybe.Some(42)), explicit applications (Maybe<number>.None()) and constructor-patternMATCHthrough LET, immutable named/cell values, functions and recursive fields. Typed patterns constrain static arguments; runtime values retain schema identity while erasing those arguments. Compiled artifact save/load preserves the contracts. Source-created values now cross typed process inputs, childRUNcalls and results, with readable inspection and durable argument recovery. Inspection JSON is data, not a constructor. A compiler resolver can supply installed data-onlyops:packages throughUSE "ops:fixtures/review@1.0.0" AS serviceorEXPOSING (Draft). Package content pins nominal identity; aliases share it. Owner-only exports admit pattern matching but refuse source construction. Imports require no execution grant and start no owner. Sequential operation exports now have source compilation support and selected internal volatile execution (see team/process declarations); durable recovery, concrete catalogue installation, owner-issued runtime values, remaining refinements and legacy v1 ADT migration remain unfinished. -
x => x * 2,(acc, x) => acc + x. -
MAP(rows) WITH row DO ... ENDandREDUCE(0, values) WITH total, value DO ... ENDlower to the helpers' existing final lambda argument. Also supported bySCAN,ITERATE,BYROW,BYCOL, andMAKEARRAY, with checked parameter arity.
-
LAMBDA(x, x + 1). A lambda assigned to a named wire can be called by name, including inside another lambda:F = LAMBDA(x, x + Offset),MAP({1, 2}, LAMBDA(x, F(x))). Calls check arity and use current inputs. -
DEFINE hypot(a, b) = SQRT(a^2 + b^2)names a reusable, non-recursive helper; theDEFINEkeyword is optional (hypot(a, b) = …) andDEFis 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. OrdinarySUMhas a numeric result contract for scalar or array inputs. Errors retain their normal evaluation behavior. One shared callable body supports direct forward calls and_partial application in supported callback positions; recursion and storing callable values in cells remain unsupported. See named functions. -
(supported) -
ARGS(fn),BODY(fn), andFUNCTION(fn)fold at compile time to ordinary Grid values.BODYexposes 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.DERIVATIVEandINTEGRATEare the long-form aliases. -
LINEAR_PROGRAM.REPORT,MIXED_INTEGER_PROGRAM.REPORT,PORTFOLIO_QP_WEIGHTS.REPORT, andCS_MAX_FLOW.REPORTexpose existing solver results and certificates through explicit resident records. See the OR teaching guide. -
BOUNDED_MINIMIZE_N.REPORT(fn, initial, lower, upper[, tolerance, max_iterations])retains the actual stopping reason, objective at the returned coordinates, evaluation count and a bounded candidate. Readreport.parametersto reuse the same solve. Local convergence concerns objective spread, not global optimality or parameter accuracy; ordinary budget-limited calls now fail explicitly. See OR research and teaching. -
CURVE_FIT.REPORT(model, xs, ys, initial[, tolerance, max_iterations])returns coefficients, residuals, stopping reason, and bounded final-Jacobian rank/conditioning from the existing unweighted solve. Uncertainty is off by default. See the fitting guide. -
Economic lags and annual growth use declared calendar periods; missing periods stay missing, invalid/duplicate dates fail explicitly, and resampling discloses completeness or requires complete buckets.
-
REGRESSoptions select residual-df t, cluster-df t, or normal inference and label coefficients. Results andREGRESS.TABLEdisclose covariance corrections, distribution and degrees of freedom. -
LOGIT.FITandPROBIT.FITexplain complete separation when a strict linear separating direction is established. Other numerical failures keep their own diagnostics; failure to find a certificate does not establish overlap. -
Explicit
lowerandupperoptions select v4 constrained fitting reports. Scalars broadcast; vectors follow parameter order;BLANKomits an endpoint. Equal endpoints fix a parameter. Feasible iterates, exact active limits and projected stationarity are reported, with optional observation weighting. Local covariance intervals explicitly decline for bounds. See the chemistry guide. -
Explicit
uncertainty:"bootstrap_normal"options request seeded normal-data refits with the authored starts, weights, bounds and solver controls. The v5 report retains every refit, failures, noise scale, percentile limits, spread and bias. Any ineligible refit prevents interval publication; fixed parameters have blank inferred uncertainty. Small, weak and boundary designs can have inaccurate coverage. See the fitting guide and decay example. -
CURVE_FIT.REPORTacceptsweightsorstandard_deviationsin argument seven, with optional matchinglocal_relativeorlocal_knownuncertainty. v3 separates raw residuals from the weighted objective and names its error model; v1/v2 remain available. Without explicit bounds parameters remain unconstrained, and local intervals may have poor nonlinear coverage. See the chemistry guide. -
DERIVATIVE.REPORT(fn, x, h?)exposes the actual automatic or finite-difference method, value, point, step and fallback reason from one calculation. A finite- difference estimate is not a proof of differentiability. See the applied mathematics guide. -
ODE_REPORT(fn, initial, start, end, {format: "record", ...})returns the declaredgrid.ode.report.v1schema with the concrete method, completed interval, terminal state, local tolerance controls and numerical work. Omitformator select"row"for the existing numeric row. Publication reuses the same solve and numeric memo payload; reading fields does not integrate again. Units follow the authored model, and local tolerance settings do not establish global accuracy. See the ODE guide. -
(supported) - An explicit seventh-argument options record
{uncertainty: "local_iid", confidence: 0.95}selects local linearized covariance and individual Student-t intervals, estimating a common observation variance from residuals. Rank, degrees of freedom, variance and stationarity eligibility are explicit; unavailable intervals are not replaced by finite defaults. This assumes independent equal-variance normal observation errors and does not establish nonlinear interval coverage for arbitrary models. -
(supported) -
SAMPLE(fn, coordinates)realizes explicit points;SAMPLE(fn, start, end[, count_or_tolerance])produces fixed-resolution or adaptivex/yrows whose reactive bounds can be driven by a chart viewport. Multi-parameter families select a varying parameter and bind the others by name;SAMPLE_INFOreports 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..<10excludes 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_; afterDO, steps may be separated byTHEN,>>, or|>. OptionalELSEwraps the chain inIFERROR(classicWITH name = … THENbindings are unchanged). -
(supported) -
value >> TAPpasses the value through for inspection. -
(supported) -
value >> ABS() IF conddesugars toIF(cond, ABS(value), value). Each pipe step may have its own trailingIF; seeinfix-operators.md.
Function Catalog
The function catalog is the user-callable function reference:
functions.mdlists every built-in function, grouped by category, with signature, return type, aliases, compatibility notes, and external contracts.function-compatibility.mdlists every canonical name and alias with its compatibility label.