All projects

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.

Pure expressionsInferred static typesExact rational numbers

Edit the formula and its live inputs.

The editor runs LambdaScript and Cells in your browser, parsing and type-checking formula edits while value changes flow through the existing compiled graph.

λscript

Compiling typed graph

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

After the host declares available values and their types, LambdaScript infers the remaining types and rejects invalid operators, function arguments, and field access before replacing the live graph.

Keep the result connected

An expression compiles into Cells so that changes to a source recompute only the affected downstream values.

Calculate exact ratios

Arbitrary-size rational arithmetic supports integers beyond 53 bits and makes expressions such as 1 / 3 + 1 / 3 + 1 / 3 return exactly 1.

Expose only named capabilities

Formulas can access only host-supplied values and typed functions; access to the DOM, filesystem, network, process, clock, and surrounding JavaScript scope requires explicit host support.

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

LambdaScript is designed for computed fields, prices, allocations, scores, scenario models, and visual rule builders, with general automation and latency-critical policy loops better suited to other languages.

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.

Host functions and resource limits need review.

Review host functions

Review every host function exposed to a formula, since custom functions can perform side effects within the otherwise pure language.

Set resource limits

Set size, time, and operational limits for multi-tenant products because large expressions and expensive arithmetic can consume substantial resources.

Choose exact input forms

Preserve exact values through parsing by supplying audit-critical decimal inputs as integers or explicit ratios such as 17/100.

Inspect the parser, type checker, evaluator, and tests.

The open-source repository includes the language toolkit and the Cells-backed reactive evaluator used by this demo.

GitHub