LambdaScript
Turn a formula into a live, typed part of your application.
LambdaScript is the core language for customizing Chainwall policies and interactions. It compiles formulas written by users or loaded from configuration into Cells, so each result stays connected to every input that can change.
Edit the formula. Then edit its live inputs.
The editor below runs LambdaScript and Cells in your browser. Formula changes are parsed and type-checked. Value changes flow through the compiled graph without running the parser again.
Compiling the expression into Cells…
A formula feature usually becomes four systems.
Most products eventually let someone change a formula without shipping new application code. LambdaScript handles the parser, type checker, exact numbers, and live dependency graph together, so the formula remains readable without gaining the full authority of JavaScript.
Catch a bad formula before it runs
The host declares each available value and its type. LambdaScript infers the rest, then rejects invalid operators, function arguments, and field access before replacing the live graph.
Keep the result connected
An expression compiles into Cells instead of returning a snapshot. When a source Cell changes, only the affected downstream Cells recompute.
Calculate exact ratios
Numbers use arbitrary-size rational arithmetic. Integers do not stop at 53 bits, and expressions such as 1 / 3 + 1 / 3 + 1 / 3 return exactly 1.
Expose only named capabilities
The host supplies the values and typed functions a formula may use. LambdaScript does not expose the DOM, filesystem, network, process, clock, or surrounding JavaScript scope by default.
Inspect the program as a graph
Named formulas can discover their own dependencies, reject cycles, and evaluate in dependency order. The parser, syntax tree, formatter, and source ranges are available to editor tooling.
Build for a narrow job
Use LambdaScript for computed fields, prices, allocations, scores, scenario models, and visual rule builders. Use another language for general automation or latency-critical policy loops.
Use it when a formula should stay alive.
LambdaScript fits logic that is edited separately from application code and must remain connected to changing values.
Computed forms and workflows
Keep totals, defaults, validation, and next-step conditions connected to current fields.
Prices, fees, and allocations
Let a product own the available inputs while users edit formulas with exact ratios.
Scores and scenario models
Change an assumption and update only the formulas downstream from that input.
Text and visual rule builders
Use one syntax tree for stored formulas, editor errors, formatting, and a graph view.
A constrained language is not a complete sandbox.
Review host functions
The language is pure, but a custom function can still perform a side effect. Every exposed function remains part of the trust boundary.
Set resource limits
Large expressions and expensive arithmetic can consume time and memory. Multi-tenant products still need size, time, and operational limits.
Choose exact input forms
Rational arithmetic is exact after parsing. Audit-critical decimal inputs should arrive as integers or explicit ratios such as 17/100.
Inspect the parser, type checker, evaluator, and tests.
LambdaScript is open source. The repository includes the language toolkit and the Cells-backed reactive evaluator used by this demo.