CBCL language reference
CBCL has three layers. The reader converts text into values. The message parser interprets those values as acts. An installed dialect gives more verbs their meaning.
- Text and values — write a string, symbol, address, list, integer, float, or decimal.
- Messages, scope, and wrappers — send a core act, use a custom verb, or exchange a dialect.
- Dialect definitions and templates — define verbs, substitute arguments, select a template branch, or set expansion limits.
- Shapes and types — declare field types, defaults, constraints, and named types.
- Protocols and roles — specify order, alternatives, joins, repetition, participants, and evidence.
- State language — calculate state, define a threshold, freeze a result, or allocate rights.
On this page
How to read a form
In the reference tables, names such as verb, role, and value identify values that you supply. A word in head position, such as define or shape, selects the operation. You can copy a complete definition into a dialect file.
The formal grammar gives the productions for tokens, messages, dialects, protocols, shapes, types, and state. Installation also checks relationships between declarations. For example, a shape must refer to a verb that the dialect defines or inherits.
How to check an input
| Input | Check | What the result tells you |
|---|---|---|
| Any CBCL value | cbcl-cli parse --sexpr | The reader can consume the complete expression. |
| A message | cbcl-cli parse | The message passes the CLI parsing and validation pipeline. |
| A dialect file | cbcl-cli verify < file.cbcl | The CLI reports the checks that it performed. |
| A dialect for use by an application | Install it in the Rust registry or with the JavaScript SDK. | The host has a definition for subsequent operations. |
| An act in a thread | Check admission against the authenticated history. | The result is accepted, pending, or rejected. |
For a complete trace through a receiver, see JavaScript or Rust. To study an existing definition, see Annotated dialects.