Learn

A step-by-step tutorial

Fourteen chapters, hands-on. Every chapter has a runnable program and one focused new idea. Read it in order on the first pass; come back as a reference later. No prior capability-language experience is assumed: if you have written Python, Go, Rust, or any C-family language, you will feel at home.

Before you start

Three things you need

  • Capa installed and on your PATH. Check with capa --version; if not, see Get started.
  • A text editor. Any editor works; for syntax highlighting and the language server, see editor integration on the install page.
  • A terminal. Every chapter has a capa --run file.capa step.
The capability discipline starts to bite in chapter 8: the first seven chapters are a normal-looking language so the surface stays familiar before the unusual ideas arrive. Chapter 12 is a worked example, chapter 13 adds information-flow control, and chapter 14 turns the discipline into audit artefacts.
The fourteen chapters

From zero to real programs

Each chapter is short: 5-10 minutes of reading plus typing. You can stop after any chapter and have a working program.

Companions

The dense references for later