WeftManual

Documentation

The Weft manual

Build a frontend whose actions and information flows you can check. Start with a one-button program, then follow the same reasoning through a private ballot and a vault that keeps a key at its owner.

Start with a working program

The approval latch starts at zero. Pressing Approve sets it to one and disables the button. Its entire behavior fits on a few lines, including the claim that connects the displayed state to the control. The tutorial walks through building it, checking the actual Wasm, and breaking a rule on purpose.

Build your first component →

Find a chapter

Language design

How ownership, finite state, pure views, guarded actions, and explicit outputs fit together.

Syntax and primitives

Every core declaration, expression, operator, and type rule, with its permitted contexts.

Proving UI behavior

Choose an invariant, an action postcondition, or a channel policy. Read the failing proof when a guard changes.

Pages and styling

Write a page tree, bind it to a verified component, and style it for different screen widths.

WebAssembly and hosts

Inspect the exact binary checks and implement a host using the v1 calling convention.

Tools and diagnostics

Install the compiler, run each CLI command, replay solver queries, and diagnose a failed build.

Follow the examples

Approval latch · one state bit
Use it to trace a transition by hand and compare the result with the owner’s runtime trace.
Private ballot · two recipients
Choose a two-bit vote, annotate private confidence, and release two shares after review. The vote is reconstructible by both recipients together. The confidence is protected even against that coalition.
Vault status · server-owned secret
Rotate an externally initialized eight-bit field at the vault owner. The browser receives a single public health value through its channel.
Open the runnable latchRead ballot.weftRead vault.weft