Skip to main content

Programming Extensible Data Types in Rust with CGP - Part 1: Modular App Construction and Extensible Builders

36 min read
Soares Chen
Creator of Context-Generic Programming

I鈥檓 excited to announce the release of CGP v0.4.2, a major milestone that significantly expands the expressive power of generic programming in Rust. With this release, CGP introduces full support for extensible records and variants, unlocking a range of new capabilities for developers working with highly modular and reusable code.

Extensible records and variants allow developers to write code that operates on any struct containing specific fields or any enum containing specific variants, without needing their concrete definition. This makes it possible to write truly generic and flexible logic that is decoupled from rigid type definitions.

CGP v0.4.1 Release: new cgp-handler crate, improved preset macros, and more.

4 min read
Soares Chen
Creator of Context-Generic Programming

We are excited to announce the release of CGP v0.4.1! This release brings several new features, quality-of-life improvements for macro usages, and a new crate cgp-handler.

Here are some of the highlights:

  • New cgp-handler crate: Provides abstract interfaces for defining components with common method signatures.
  • cgp_preset! macro improvement: Now supports wrapping of Preset::Provider.
  • #[cgp_component] macro improvement: Now supports automated derivation of UseDelegate.
  • Improved Documentation: Added inline Rust documentation for common CGP constructs.