Expand description
VAPP-191 (eApps Q2): expressions, the Rust twin of
packages/exponential-ui/src/cel.ts (line by line; read its header for
the language). A SUBSET of CEL with ONE number type (a double, like
JSON), hand-written so both twins replay fixtures/expressions.json
exactly: numbers, dates and error texts. No loops, no user functions, a
length cap, no nested comprehensions and a step limit, so it always
terminates. The functions are ONE table shared with the A2UI function
form ({"call": "mul", …}, call_expression_function); dates run in
the team zone (an offset per instant, ExpressionEnv::offset).
Structs§
- Expression
Env - The clock, the team zone and the step limit an evaluation runs with.
Enums§
- Function
Effect - VAPP-194 (E1): what calling a function does. Expressions are PURE: a
binding,
visible, a computed field or a query param never writes. Awritechanges records or the surface data, ahostfunction reaches outside the surface (a toast, an MCP call, a link, another action); both run only as steps of a package action (crate::host::actions). - Node
- A parsed expression (
at= the code point it starts at).
Constants§
- CALENDAR_
UNITS - CALL_
NAMES - The A2UI form’s names in the bind table (
size= the existinglen;expr= the string form,{expr, vars}). - DATE_
UNITS - Every unit
dateAdd/dateDifftake;startOf/endOftake the calendar ones. - DURATION_
FORMATS - The formats
formatDurationwrites. - FUNCTION_
NAMES - THE function table (spec §4.2), positional for CEL, named (
args) for the A2UI form. Generic only: no working days, no holidays. - HOST_
FUNCTIONS - The built-in host functions; every name under a host prefix is one too.
- HOST_
FUNCTION_ PREFIXES - MAX_
DEPTH - MAX_
LENGTH - The cost caps (spec §4.2): characters (code points), nesting, steps.
- MAX_
STEPS - WRITE_
FUNCTIONS - The functions that write (records, the surface data model).
Functions§
- call_
expression_ function - The A2UI function form
{call: name, args}with its arguments resolved. OuterNone= not an expression function; innerNone= no value (an error, like every bind-time function). VAPP-195: a failed call shows itsdefault(absent = no value). - check_
expression - Type-check an expression against the names it may read (a kind’s
fields, a binding’s value): the type, or the error (the parse error, or
the first type error). Types are spelled as JSON (
"number",[T], a row object,{"?": T}for a value that may be missing). - effect_
words - Why an effectful function is refused in a pure place.
- evaluate_
counted - VAPP-194: evaluate a parsed tree and count its steps (an action spends one budget over all of its expressions): the result and the steps used.
- evaluate_
expression - Evaluate an expression over
vars: the value, or the error (a syntax, type, range or cost error). - evaluate_
node - Evaluate a parsed tree (see
parse_expression). - expression_
names - VAPP-214: the free names an expression reads, sorted (a macro’s own variable is not free inside its body).
- format_
timestamp - An instant as
YYYY-MM-DDTHH:MM:SS.sssZ(JStoISOString), years 0..9999. - function_
effect - The effect of a function by name: the signature table’s (every
expression function, every bind-time function) is
pure. - is_
optional - VAPP-195 (E2): a value that may be missing is
T?, spelled{"?": T}(a row never has a field named?). - optional_
type T?(null and an optional stay as they are).- parse_
expression - Parse once (at package validation, or before evaluating): the tree, or
the first syntax / cost error (
at <code point>: <reason>). - parse_
timestamp - An ISO instant (
YYYY-MM-DDTHH:MM[:SS[.fff]][Z|±HH:MM], no offset = UTC) as epoch ms;Nonewhen it is not one. - path_
text - VAPP-195: a value’s path as written (
a.b[0].c,m['k']): names, fields and literal indexes;Nonefor anything else. - required_
type Tof aT?.- type_
display - The name a type prints as in an error: a list
list, a rowmap, an optionalT?. - type_
name - The runtime type name errors print.