CBCL / DocumentationDocs v0.3.1

Messages, scope, and wrappers

A message is a nonempty list with a symbol in the first position. That symbol selects a core verb, a wrapper, a meta operation through meta, or a dialect through lang.

On this page

Core verbs and arguments

VerbsConventional use
tell, ask, replySend information, request information, or answer a request.
ok, errorReport success or a problem.
hello, bye, cancelGreet a participant, end communication, or request cancellation.
(tell (@alice @bob) "Ready" :thread "friday" :sender @carol :caused-by begin)

The recipient position follows the verb. It accepts one address or a nonempty list of addresses. The parser stores a recipient group as a set.

The first remaining positional value is the content. More positional arguments and keyword pairs are parameters. An address can be a keyword value. A bare address in a subsequent positional slot is an error.

Each keyword must have a value. A duplicate keyword at the same level causes an error. Three keywords have dedicated fields:

KeywordValue
:threadA string or symbol that identifies the conversation.
:senderThe sender identifier. The receiving host must authenticate the sender independently.
:caused-bybegin, one predecessor address, or a nonempty list of predecessor addresses.

Stateful acts also use fields such as :from, :clock, and :replaces. Their meaning comes from the relevant act and state rules. Use the intent binder to supply causal and replacement references. A wire content address starts with f1220 and has 64 more lowercase hexadecimal digits.

Dialect scope and meta operations

FormUse
(lang name message)Select the dialect for the inner message. A custom verb must have a dialect scope.
(meta (query expression))Ask about a capability or definition.
(meta (define …))Carry a definition as the meta operation.
(meta (teach @peer definition))Send a definition to a participant. The receiving host can accept or refuse installation.
(meta (teach @bob
  (define greeting (cbcl) @alice
    (extend greet (to) (tell to "Hello")))))

After adoption, a sender can use the new verb:

(lang greeting (greet @bob))

Wrapper forms

The inner message must be the last element. Put wrapper parameters before it. A wrapper preserves an enclosing dialect scope. A nested lang selects its own dialect.

HeadPurpose
envelopeCarry routing information around a message. An explicit outer :to gives the routing audience.
signedCarry signature material for an inner message. The host must check the signature with the applicable key and signature discipline.
with-limitsCarry limits with an inner message. The dialect also has installation limits.
with-rolesCarry a cast in the root of a thread. An optional :dialect field pins the dialect address.
(envelope :to @archive (tell @bob "Ready"))

A redacted envelope is a separate evidence format. It can give the verifier authenticated header fields for a causal check. A header check uses no payload. To examine the payload, the receiver must have the full message. The canonical encoding reference specifies message addresses and the signature inputs for each discipline.