NewsCrawler.org

CGP v0.8.0: cargo-cgp, new documentation, and namespaces

CGP v0.8.0: cargo-cgp, new documentation, and namespaces
Image: Reddit

Context-Generic Programming (CGP)[1] v0.8.0 is out, and this release aims to make CGP easier to learn and maintain. It adds cargo-cgp[2], a new tool for compile errors that describe macro-generated code instead of the code the developer wrote. cargo-cgp explains these errors in the developer's terms, for example by naming a missing field and saying which field to add.

The post gives a small example: a Rectangle struct without a height field, used by an area provider[3]. Running cargo cgp check reports the missing field and the dependency chain behind it, while plain cargo check describes the same mistake through generated traits and a nested Symbol type. cargo-cgp requires Rust 1.96 or newer, is tested only on Linux so far, and runs its checks on a pinned nightly compiler, while applications keep their normal toolchain.

Namespaces let a single wiring entry choose providers for a whole group of components as an application grows. The release also introduces expanded documentation and AI agent support. The author says earlier CGP explanations mostly appeared in blog posts, and that CGP is a side project, which made writing fuller documentation difficult.

Read the original contextgeneric.devDiscussion

Sources

Published: First seen: Читать по-русски

Open as a page