Cap'n Proto Schema Language

The Cap'n Proto schema language is used to define message types in .capnp files that are then compiled into native code for each supported language. The schema language defines structs, unions, enums, interfaces (for RPC), groups, generics, and annotations, and carefully specifies evolution rules so schemas can be extended without breaking forward or backward compatibility.

API entry from apis.yml

apis.yml Raw ↑
aid: capn-proto:capn-proto-schema-language
name: Cap'n Proto Schema Language
description: The Cap'n Proto schema language is used to define message types in .capnp files that are
  then compiled into native code for each supported language. The schema language defines structs, unions,
  enums, interfaces (for RPC), groups, generics, and annotations, and carefully specifies evolution rules
  so schemas can be extended without breaking forward or backward compatibility.
humanURL: https://capnproto.org/language.html
tags:
- Code Generation
- Schema
- Specification
properties:
- type: Specification
  url: https://capnproto.org/language.html
- type: Documentation
  url: https://capnproto.org/language.html
- type: GitHubRepository
  url: https://github.com/capnproto/capnproto
x-features:
- Struct, union, enum, interface, and group definitions
- Generic parameters for reusable types
- Annotations for custom metadata
- Schema evolution rules for forward and backward compatibility
- Compilation to native code in multiple languages
- Cross-language ABI through a canonical wire format
x-use-cases:
- Defining message types for zero-copy IPC
- Describing RPC interfaces across language boundaries
- Long-lived storage formats with schema evolution
- Replacing Protocol Buffers for latency-sensitive workloads