Sign in

Context-Generic Programming

@contextgeneric.dev
37 followers 1 following 56 posts

A new modular paradigm for Rust. Project account managed by @maybevoid.com. More info at contextgeneric.dev

PostsRepliesMedia
Context-Generic Programming @contextgeneric.dev · 08/03/2026
How to stop fighting with coherence and start writing context-generic trait impls in Rust contextgeneric.dev/blog/rustlab... This blog post contains the slides and transcript for my presentation of Context-Generic Programming at RustLab 2025.
contextgeneric.dev
How to stop fighting with coherence and start writing context-generic trait impls - RustLab 2025 transcript | Context-Generic Programming
This blog post contains the slides and transcript for my presentation of Context-Generic Programming at RustLab 2025.
010
Context-Generic Programming @contextgeneric.dev · 04/03/2026
My RustLab presentation on **How to stop fighting with coherence and start writing context-generic trait impls** is now available on YouTube: www.youtube.com/watch?v=gXIf...
youtube.com
How to stop fighting with coherence and star writing context-generic trait impls - Soares Chen
YouTube video by RustLab Conference
000
Context-Generic Programming @contextgeneric.dev · 02/03/2026
Supercharge Rust functions with implicit arguments using CGP v0.7.0 🚀 contextgeneric.dev/blog/v0.7.0-...
contextgeneric.dev
Supercharge Rust functions with implicit arguments using CGP v0.7.0 | Context-Generic Programming
CGP v0.7.0 has been released, bringing a major expansion to the CGP macro toolkit. The centerpiece of this release is a suite of new annotations — #[cgpfn], #[implicit], #[uses], #[extend], #[useprovi...
000
Context-Generic Programming @contextgeneric.dev · 21/02/2026
Context-Generic Programming (CGP) now has a new website! We have now migrated from Zola to Docusaurus. This blog post explains the reasons behind the move. contextgeneric.dev/blog/2026/02...
000
Context-Generic Programming @contextgeneric.dev · 02/02/2026
We're excited to announce the release of cgp v0.6.1, which brings several quality-of-life improvements to Context-Generic Programming in Rust. contextgeneric.dev/blog/v0-6-1-...
contextgeneric.dev
CGP v0.6.1 Release: Improving Ergonomics and Debugging | Context-Generic Programming
000
Context-Generic Programming @contextgeneric.dev · 03/11/2025
I am excited to announce the release of cgp-serde, a modular serialization library for Serde that leverages the power of Context-Generic Programming (CGP). contextgeneric.dev/blog/cgp-ser...
contextgeneric.dev
Announcing cgp-serde: A modular serialization library for Serde powered by CGP | Context-Generic Programming
121
Context-Generic Programming @contextgeneric.dev · 26/10/2025
I’m excited to announce the release of CGP v0.6.0! This version introduces major ergonomic improvements that make provider and context implementations simpler and more intuitive to write. contextgeneric.dev/blog/v0-6-0-...
contextgeneric.dev
CGP v0.6.0 Release - Major ergonomic improvements for provider and context implementations | Context-Generic Programming
000
Context-Generic Programming @contextgeneric.dev · 12/10/2025
I am thrilled to announce the release of CGP v0.5.0! This new release includes many exciting features and improvements, including auto dispatchers, extensible datatype improvements, monadic computation, emulation of RTN, sneak preview of cgp-serde. #RustLang contextgeneric.dev/blog/v0-5-0-...
contextgeneric.dev
CGP v0.5.0 Release - Auto dispatchers, extensible datatype improvements, monadic computation, RTN emulation, modular serde, and more | Context-Generic Programming
020
Context-Generic Programming @contextgeneric.dev · 26/08/2025
I will be presenting at RustLab on how to stop fighting with coherence and start writing context-generic programs with CGP. Use the discount code SP20FR to attend the conference with 20% discount!
000
Reposted by Context-Generic Programming
RustLab Conference @rustlab.it · 26/08/2025
Tired of fighting Rust’s coherence rules? S@maybevoid.com introduces Context-Generic Programming: a new way to write flexible trait impls without breaking the rules. 🧩 How to Stop Fighting with Coherence and Start Writing Context-Generic Trait Impls #rustlang #rustlab2025
122
Reposted by Context-Generic Programming
Soares Chen @maybevoid.com · 23/08/2025
I will be presenting at @rustlab.it on how to stop fighting with coherence and start writing context-generic programs with @contextgeneric.dev. Use the discount code SP20FR to attend the conference with 20% discount! rustlab.it/talks/how-to...
rustlab.it
RustLab | How to Stop Fighting with Coherence and Start Writing Context-Generic Trait Impls
Soares Chen at RustLab 2025
142
Context-Generic Programming @contextgeneric.dev · 05/08/2025
The third and fourth parts of Extensible Data Types for Rust - the design and implementation of extensible records and variants - has been published! contextgeneric.dev/blog/extensi... contextgeneric.dev/blog/extensi...
contextgeneric.dev
Programming Extensible Data Types in Rust with CGP - Part 3: Implementing Extensible Records | Context-Generic Programming
000
Context-Generic Programming @contextgeneric.dev · 10/07/2025
I am excited to share the second part of my blog series on Extensible Data Types with CGP. This post dives into how CGP leverages extensible variants to elegantly solve the expression problem. contextgeneric.dev/blog/extensi...
contextgeneric.dev
Programming Extensible Data Types in Rust with CGP - Part 2: Modular Interpreters and Extensible Visitors | Context-Generic Programming
100
Context-Generic Programming @contextgeneric.dev · 07/07/2025
I'm excited to share the release of CGP v0.4.2, with new support for extensible records and variants! contextgeneric.dev/blog/extensi... In short extensible data types allows us to read, construct, and deconstruct a *generic* struct or enum without needing access to the concrete type.
contextgeneric.dev
Programming Extensible Data Types in Rust with CGP - Part 1: Highlights and Extensible Records Demo | Context-Generic Programming
100
Context-Generic Programming @contextgeneric.dev · 17/06/2025
Now that Hypershell is finally published, it is finally time to go back to working on the core CGP implementation and add new features. The new CGP builder pattern is being developed pretty smoothly. Here is a snippet Rust code on the test code and macro expansion!
000
Context-Generic Programming @contextgeneric.dev · 14/06/2025
Announcing Hypershell: a modular, type-level DSL for shell-scripting in Rust, powered by Context-Generic Programming! contextgeneric.dev/blog/hypersh...
contextgeneric.dev
Hypershell: A Type-Level DSL for Shell-Scripting in Rust | Context-Generic Programming
010
Context-Generic Programming @contextgeneric.dev · 09/05/2025
I am excited to share about the new release of #CGP v0.4.0! This update solves a major challenge in debugging CGP-related errors in Rust, simplifies the developer experience with new macros, and added new features such as presets and datatype-generic programming. contextgeneric.dev/blog/v0-4-0-...
contextgeneric.dev
CGP v0.4.0 is Here: Unlocking Easier Debugging, Extensible Presets, and More! | Context-Generic Programming
CGP v0.4.0 is officially released, bringing transformative improvements! Experience dramatically easier debugging, powerful new features, and a smoother developer journey for modular Rust programming.
001
Context-Generic Programming @contextgeneric.dev · 03/05/2025
It is now possible to do OOP-like inheritance at the type-level in #RustLang using #CGP! Our latest PR brings significant improvements to defining and using presets in CGP, with support for multiple-inheritance, and override mechanism to overcome the diamond inheritance problem.
101
Context-Generic Programming @contextgeneric.dev · 23/03/2025
A lot of new features have been added to the `#[cgp_getter]` macro! For the basic use cases, you can now define getter methods that return &str or Option<&T>, and the macro will generate getter implementations that read from String or Option<T> fields. github.com/contextgener...
github.com
Refactoring and Improvements on `#[cgp_getter]` by soareschen · Pull Request #81 · contextgeneric/cgp
Summary This PR brings several quality of life improvements on the proc macros #[cgp_getter] and #[cgp_auto_getter], allowing them to support more general getter interfaces to be defined. Specializ...
101
Context-Generic Programming @contextgeneric.dev · 12/03/2025
A great article that gives an overview of the coherence problem in typeclasses/traits has been surfaced on Hacker News. I am trying to take the opportunity to pitch about CGP and how it helps solve the given coherence problems. Help give me an upvote here: news.ycombinator.com/item?id=4334...
news.ycombinator.com
Shameless plug: I am working on a solution in Rust that solves the coherence pro... | Hacker News
111
Context-Generic Programming @contextgeneric.dev · 09/03/2025
CGP now has a new logo! The website has been updated with the new logo and color theme: contextgeneric.dev There are many exciting features in the upcoming v0.4.0 release. In particular, CGP now shows much more informative compile errors that makes it much easier to debug CGP code.
112
Context-Generic Programming @contextgeneric.dev · 11/01/2025
You should still care about modularity, even if you don't write modular code yourself. Because modularity allows you to reuse modular code written by *others*, so that you can write much less non-modular code yourself. #CGP #RustLang
132
Context-Generic Programming @contextgeneric.dev · 09/01/2025
We have just published an update blog post on the release of #CGP v0.3.0, along with new book chapters! #RustLang contextgeneric.dev/blog/v0-3-0-...
contextgeneric.dev
CGP Updates: v0.3.0 Release and New Chapters | Context-Generic Programming
We’re excited to announce the release of v0.3.0 of the cgp crate, along with several new chapters of the CGP Patterns book!
101
Context-Generic Programming @contextgeneric.dev · 08/01/2025
#CGP v0.3.0 has been released! This release includes a lot of QoL improvements, including the new `cgp_type!` and `#[cgp_getter]` macros, and the new `cgp-error-anyhow` crate. #RustLang The CGP Patterns book has also been updated with significant revision on based on the new features.
111
Context-Generic Programming @contextgeneric.dev · 06/01/2025
A new chapter for #CGP Patterns have been released! patterns.contextgeneric.dev/field-access... This time, we go into deep dive various ways of defining and implementing field accessors using CGP, the HasField trait, and context-generic accessor providers. #RustLang
patterns.contextgeneric.dev
Field Accessors - Context-Generic Programming Patterns (DRAFT)
012
Context-Generic Programming @contextgeneric.dev · 05/01/2025
Another new chapter for #CGP Patterns have been released! patterns.contextgeneric.dev/error-wrappi... This time, we walk through an example config loader provider that reads a config file and parses the content as JSON, and how to wrap around #RustLang errors like std::io::Error with more details.
patterns.contextgeneric.dev
Error Wrapping - Context-Generic Programming Patterns (DRAFT)
021
Context-Generic Programming @contextgeneric.dev · 02/01/2025
Another new chapter for #CGP Patterns has been released! This time on error reporting: patterns.contextgeneric.dev/error-report... The chapter walks through how we can decouple #RustLang code that produce errors from code that handles/report errors.
patterns.contextgeneric.dev
Error Reporting - Context-Generic Programming Patterns (DRAFT)
112
Context-Generic Programming @contextgeneric.dev · 01/01/2025
Happy new year! Another new chapter for #CGP #RustLang has been released: Error handling using delegated error raisers - patterns.contextgeneric.dev/delegated-er... This chapter dives into some advanced techniques in CGP to make it so that we can declaratively handle different source error types.
patterns.contextgeneric.dev
Delegated Error Raiser - Context-Generic Programming Patterns (DRAFT)
011
Context-Generic Programming @contextgeneric.dev · 31/12/2024
New chapter released for #CGP Patterns: Error Handling. patterns.contextgeneric.dev/error-handli... The introduction to error handling in CGP is very important, as it is very different from how error handling is typically done in #RustLang.
patterns.contextgeneric.dev
Error Handling - Context-Generic Programming Patterns (DRAFT)
131
Context-Generic Programming @contextgeneric.dev · 28/12/2024
New chapter for CGP Patterns has been released! With the introduction of associated types, we can now walk through more practical examples of using CGP to validate authentication tokens using abstract time and auth token types. patterns.contextgeneric.dev/associated-t...
patterns.contextgeneric.dev
Associated Types - Context-Generic Programming Patterns (DRAFT)
111
Context-Generic Programming @contextgeneric.dev · 25/12/2024
A reddit commentator has mentioned that #CGP looks similar to Scala's cake pattern. I have looked into one of the example code that uses cake pattern, and drafted an equivalent CGP #RustLang code that follows as closely with the original example: gist.github.com/soareschen/f...
gist.github.com
Scala Cake in CGP
Scala Cake in CGP. GitHub Gist: instantly share code, notes, and snippets.
111
Context-Generic Programming @contextgeneric.dev · 24/12/2024
#CGP is now shared at the front page of Lobste.rs! Looking forward to see any feedback and comments posted there! #RustLang
021
Context-Generic Programming @contextgeneric.dev · 24/12/2024
we are getting a lot of engagement with the #CGP announcement on #RustLang r/rust Reddit! Thank you for all your feedback and questions! www.reddit.com/r/rust/comme...
reddit.com
From the rust community on Reddit
Explore this post and more from the rust community
212
Context-Generic Programming @contextgeneric.dev · 23/12/2024
Announcing Context-Generic Programming (CGP) - a new modular programming paradigm for #RustLang! contextgeneric.dev #CGP allows strongly-typed Rust components to be implemented and composed in a modular, generic, and type-safe way. Check out the website to learn more.
contextgeneric.dev
Context-Generic Programming
050