Examples
Start with a complete Zig conversation, or try Rooms in your browser. Start building covers setup and explains the call.
Learn the Zig API
Start with 01_connect_and_serve.zig. It shows both ends of one session: listen, publish, connect, fetch, and call, over Noise TCP, which proves the listener’s key to the dialer.
zig build quick-start
Run it from a working checkout. It starts both peers and checks a Hello, world reply. Use zig build examples --summary all to run every example.
Continue with these examples:
- 02_introduce_and_redeem.zig hands a capability to a third peer and leaves the introducer behind.
- 06_pipeline_and_attenuate.zig calls through an unresolved promise and wraps a capability with a smaller interface.
- 07_durable_card.zig keeps a card in Loam, restarts everything, and finds the card’s state still there.
The complete example guide covers actors, bootstrap lookup, the raw engine, explicit buffers, and managing many sessions. Concepts explains handoff and pipelining, and the modules page shows which API level each chapter uses.
A complete application
Rooms is a browser chat application in which the page is a glowcap peer. It holds room capabilities, hosts inboxes, retains history, and opens direct conversations after a room introduces two members.
zig build rooms-web
Open the web ui address it prints once the build is ready. The first-room walkthrough continues from there, and the Rooms section covers the rest.
Use it from C
host_embedder_pump.c is the first C program to read. It drives two byte-fed GlowcapHost instances through the C CapTP application API. Continue with the C guide for linking, ownership, the host allocator, and transport composition.
Try another application
Tasks, tools, and accountability are smaller applications that run across several languages. The application list says what each one shows and how to run it. They double as binding examples, and the bindings overview points to each language.