Skip to content

Commit 764bbdb

Browse files
committed
Prepare for publishing
1 parent fcd0978 commit 764bbdb

5 files changed

+11
-5
lines changed

content/blog/2025-07-07-extensible-datatypes-part-1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Soares Chen"]
88

99
# Overview
1010

11-
I’m 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.
11+
I’m excited to announce the release of [**CGP v0.4.2**](https://github.com/contextgeneric/cgp/releases/tag/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.
1212

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

@@ -30,7 +30,7 @@ Here is a revised version of your “Content Organization” section, rewritten
3030

3131
This article is the first in a five-part series exploring the examples and implementation of extensible data types in CGP. Below is an overview of what each part covers:
3232

33-
**Part 1: Highlights and Extensible Records Demo** – In this introductory part, we present a high-level overview of the key features enabled by extensible data types. We then dive into a hands-on demonstration showing how extensible records can be used to build and compose modular builders for real-world applications.
33+
**Part 1: Highlights and Extensible Records Demo** (this post) – In this introductory part, we present a high-level overview of the key features enabled by extensible data types. We then dive into a hands-on demonstration showing how extensible records can be used to build and compose modular builders for real-world applications.
3434

3535
**Part 2: Extensible Variants Demo** – This part continues the demonstration by introducing extensible variants. We use them to address the [**expression problem**](https://en.wikipedia.org/wiki/Expression_problem), implementing a set of reusable interpreter components for a small toy language.
3636

@@ -176,7 +176,7 @@ let employee = Employee::builder()
176176
.finalize_build();
177177
```
178178

179-
Here’s what’s happening: The `builder()` method on `Employee` initiates a *partial record* builder, an intermediate structure that initially contains none of the target fields. Each call to `build_from` takes a struct that contributes one or more of the remaining fields and returns a new builder with those fields filled in. Once all required fields have been supplied, the `finalize_build()` method consumes the builder and produces a fully constructed `FooBarBaz` instance.
179+
Here’s what’s happening: The `builder()` method on `Employee` initiates a *partial record* builder, an intermediate structure that initially contains none of the target fields. Each call to `build_from` takes a struct that contributes one or more of the remaining fields and returns a new builder with those fields filled in. Once all required fields have been supplied, the `finalize_build()` method consumes the builder and produces a fully constructed `Employee` instance.
180180

181181
Just like enum upcasting and downcasting, the struct builder is implemented entirely in **safe**, **panic-free** Rust. There’s no runtime reflection or unsafe code involved. The only requirement is that the participating structs must have compatible fields and derive the CGP-provided traits `HasFields` and `BuildField`.
182182

@@ -331,7 +331,7 @@ This opens the door to a new style of constructor logic: one that is **modular**
331331

332332
# Extensible Builders
333333

334-
In this section, we’ll revisit the constructor examples we’ve already seen — and show how to rewrite them using CGP’s new builder pattern to achieve clean, modular, and reusable construction logic.
334+
In this section, we’ll revisit the constructor examples we’ve already seen — and show how to rewrite them using CGP’s new builder pattern to achieve clean, modular, and reusable construction logic. A full version of the example code covered in this section is available on our [GitHub repository](https://github.com/contextgeneric/cgp-examples/tree/main/builder)
335335

336336
## Modular SQLite Builder
337337

content/blog/2025-07-09-extensible-datatypes-part-2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description = ""
66

77
authors = ["Soares Chen"]
88

9+
draft = true
10+
911
+++
1012

1113
# Extensible Variants Demo

content/blog/2025-07-11-extensible-datatypes-part-3.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description = ""
66

77
authors = ["Soares Chen"]
88

9+
draft = true
10+
911
+++
1012

1113
# Implementation of Extensible Records

content/blog/2025-07-13-extensible-datatypes-part-4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description = ""
66

77
authors = ["Soares Chen"]
88

9+
draft = true
10+
911
+++
1012

1113

content/hire.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ weight = 2
1010

1111
## Who I Am
1212

13-
Hi! 👋 I’m **Soares Chen** (a.k.a. [@MaybeVoid](#)), the **creator of Context-Generic Programming (CGP)** and a passionate **Rust Engineer**. I'm currently looking for **new opportunities** to contribute to impactful software projects. You can view my [CV](#) and contact me at [[email protected]](mailto:[email protected]).
13+
Hi! 👋 I’m **Soares Chen** (a.k.a. [@MaybeVoid](#)), the **creator of Context-Generic Programming (CGP)** and a passionate **Rust Engineer**. I'm currently looking for **new opportunities** to contribute to impactful software projects. You can view my [CV](/cv-soareschen-2025-07.pdf) and contact me at [[email protected]](mailto:[email protected]).
1414

1515
My expertise lies in:
1616

0 commit comments

Comments
 (0)