Announcement
I am thrilled to announce the release of cgp
v0.4.2, along with full support for using extensible records and variants in Rust!
Read the blog series Programming Extensible Data Types in Rust with CGP for more details:
- Part 1: Modular App Construction and Extensible Builders
- Part 2: Modular Interpreters and Extensible Visitors
- Part 3: Implementing Extensible Records
Overview
Context-generic programming (CGP) is a new programming paradigm for Rust that allows strongly-typed components to be implemented and composed in a modular, generic, and type-safe way.
To learn more about the high level overview of CGP, check out the overview page.
Current Status
As of 2025, CGP remains in its early stages of development. While promising, it still has several rough edges, particularly in areas such as documentation, tooling, debugging techniques, community support, and ecosystem maturity.
As such, adopting CGP for serious projects comes with inherent challenges, and users are advised to proceed at their own risk. The primary risk is not technical but stems from the limited support available when encountering difficulties in learning or applying CGP.
At this stage, CGP is best suited for early adopters and potential contributors who are willing to experiment and help shape its future.
Getting Started
There are several places where you can get started learning and using CGP.
Hello World Tutorial
The Hello World Tutorial gives a high level walkthrough of various CGP features using a hello-world style example.
Book
To better understand CGP, the best approach is to dive into our book, Context-Generic Programming Patterns. It provides a comprehensive guide to understanding and working with CGP.
Applications
You can also explore real-world applications and projects that use CGP, such as Hermes SDK, to gain a deeper understanding of its practical uses.
Resources
Check out the Resources page for more materials and learning tools to help you get up to speed with CGP.