Building with DHL
DHL is the language Mandala uses to write down how a business works: what a record is, who may change it, how, and when it must refuse. A contract in DHL is short, readable Markdown, and the engine enforces it on every change, whoever asks: you, a colleague, an API client or your accomplice.
From one contract Mandala derives:
- the records and their history, each change signed by who made it;
- the back office in Data, with forms, previews and refusals in words;
- your accomplice's tools, one per action and query;
- a generated HTTP, GraphQL and gRPC API;
- how changes merge when several devices work offline.
contract (.dhl) ──compile──► artifact (schema + Wasm, identified by its hash)
│ │
│ optional UI file (.ui.md) ├──► Data page: tables, forms, refusals in words
└──────────────────────────────┼──► accomplice tools
└──► /v1 API (REST, GraphQL, gRPC)
Learn
- DHL concepts — contracts, records, actions, queries, signers.
- Tutorial: your first contract — write, try and install your first contract in 20 minutes.
Reference
- DHL language reference — the file format and every block.
- DHL types — the value types.
- DHLQ query reference — the query language.
- UI files — labels, formats, forms and refusals in words.
- Durability classes — how soon a write is on disk.
- Merge rules for sync — how concurrent changes merge.
- Upgrading a contract — changing a contract that already has records.
- The generated API — the HTTP API every contract gets.
Practice
- The Workbench — write, try and install from the app.
- Testing contracts — check that the rules accept and refuse what they should.
- DHL best practices — patterns that age well.
- Example contracts — real contracts to read and copy.