DEV Community

COMMENTERTHE9
COMMENTERTHE9

Posted on • Originally published at cx-lang.com

Cx Dev Log — 2026-03-16

Generics v1 has officially shipped. This isn't a halfway parser prototype; it's full-stack coverage straight from parsing, through semantic analysis, to runtime, with three verification tests. Plus, GitHub Actions CI went live—built and debugged in just four commits.

Generics v1

Our implementation tangled with six files: ast.rs, parser.rs, semantic.rs, semantic_types.rs, lower.rs, and runtime.rs. We introduced Type::TypeParam at the AST level and SemanticType::TypeParam in the semantic layer, integrated type_params in FuncDef, SemanticFunction, FunctionInfo, handled `parsing, and ensured type consistency at call sites. Thetypes_compatiblefunction now transparently handlesTypeParam`.

Testing isn't a hand-wavy success story. We ran three specific tests: t37 for basic generic function calls, t38 for generic array returns using [N]T, and t39 for scenarios with multiple arguments sharing a type parameter. This was all achieved with just 88 insertions—mindfully compact, while ensuring full compiler layer interaction. We intentionally scoped to single type parameters: no struct dependencies or bounds. This keeps v1 lean, laying the groundwork for v2 (multi-parameter support) and v3 (bounds) without refactoring core principles.

CI from zero to green

Our GitHub Actions CI came online with commit 1514c16, designed to run a 113-line workflow managing frontend and backend verification, including a stale-base gate. The CONTRIBUTING.md rolled out alongside, laying out four branch rules for collaborators, whether human or automated.

We hit two bugs right off. First, an unintentional Windows target-dir in .cargo/config.toml inserted a C:\Users\Gabri\cx-build path separator error on Ubuntu runners. That was cleaned up quickly. Secondly, merge commits to main tripped the branch protection guard, failing CI until we exempted these from the branch name check.

These hiccups revealed a key point: development primarily happens on Windows, but CI runs on Ubuntu. Platform-specific path issues like our target-dir snafu are precisely why cross-platform CI exists. Detecting these on day one is a win.

Documentation and infrastructure

A busted memory_safety.md link was culled from the README. The roadmap pushed to v3.1, mapping out the arrival of generics v1, CI status, next steps for structs, and generics v2's graduation to active development.

Meanwhile, on the site branch, we started testing an automated blog post notification setup via Telegram. Though not quite production-ready, the foundational work is underway.

Backend IR: stashed, not abandoned

Right before generics and CI merged into main, we stashed backend IR development. An ir/validate.rs module and associated imports were part of this pause, intended to streamline merging stable features. Function lowering is progressing; next in line is working if/else constructs into the process.

What's next

Naturally, generics v2 takes precedence. Multi-type-parameter support (fnc swap(a: A, b: B)) is already noted as active. Thanks to the v1 groundwork, the parser extension needed here is minimal.

Another live effort is in our backend IR stream. We'll pick back up on the validation module where progress left off. These projects work on distinct compiler layers, so they can operate simultaneously.

Now with CI, regression is not an optional diagnosis—it's actively policed. This adjustment in our workflow marks a genuine shift to proactive error detection before main integration.


Follow the Cx language project:

Originally published at https://cx-lang.com/blog/2026-03-16

Top comments (0)