Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Capa: The Capability-Typed Programming Language

Every function declares what it is allowed to do.

A beginner's book for the Capa programming language, written by Nelson Duarte.

About this book

This is a hands-on introduction to Capa for complete beginners. It assumes no prior programming experience and builds up from your first program to three complete, end-to-end projects.

The book runs to roughly 278 pages and is organised into didactic chapters, each closing with Try It Yourself exercises, followed by three practical projects and a set of appendices. Appendix E contains worked solutions to the exercises.

Contents

Part I: The Basics (the Capa language, from your first program to testing your code)

  1. Getting Started
  2. Values and Simple Types
  3. Lists
  4. Maps and Sets
  5. Control Flow
  6. Functions
  7. Structs and Sum Types
  8. Errors as Values
  9. Your First Capability
  10. Attenuating Capabilities
  11. Defining Your Own Capabilities
  12. Modules, Visibility and Packages
  13. Information-Flow Control
  14. Testing Your Code

Part II: Projects (three complete programs, built end to end)

  1. Project 1: A Grade-Book Tool
  2. Generating the Report
  3. Files, Capabilities, and Robustness
  4. Project 2: Reading an SBOM
  5. Checking a Policy
  6. A CI-Ready Tool
  7. Project 3: Handling Secrets
  8. A Vault Capability
  9. The Service, Proven Safe

Appendices

  • A. Installation and Troubleshooting
  • B. Editors and the Language Server
  • C. Capa for Python Programmers
  • D. Getting Help and Going Further
  • E. Solutions to the Exercises

Read the book

The book is available as a PDF directly in this repository: download Capa-The-Capability-Typed-Programming-Language.pdf.

Compiler version

This edition of the book corresponds to the Capa compiler v1.12.0.

Links

Licence

The book content is licensed under the Creative Commons Attribution-NonCommercial 4.0 International licence (CC BY-NC 4.0). See the LICENSE file for details.

About

Capa: The Capability-Typed Programming Language, a hands-on beginner's book (corresponds to compiler v1.12.0).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors