DEV Community

COMMENTERTHE9
COMMENTERTHE9

Posted on • Originally published at cx-lang.com

Cx Dev Log — 2026-04-25

Breaking through the six-day stagnation on submain, we've finally hit a major milestone with four committed changes pushing Cx 0.1 over to release candidate status. A significant memory boundary audit unveiled a critical StrRef soundness bug, now resolved, and all nine hard blockers are cleared up, leaving the merge gap the last major step before declaring release.

Audit Part 2 and Type Parser Refactor

The stalled audit Part 2 is no longer a hurdle. Commit a576f20 brought this to life, touching parser.rs, semantic.rs, main.rs, runtime.rs, and adding six new matrix tests (t109 to t114). Of particular interest was a critical refactor of the type parser, moving from flat alternatives to a recursive() approach. This change opens the door to parsing nested types like Result> and Handle, previously a roadblock for complex generics.

Other updates in this commit saw the semantic pass enhancing field type resolution from struct definitions for DotAccess LValues and rejecting mismatched types, while apply_numeric_cast in runtime adapts using the declared type of LValues for both Assign and CompoundAssign. A new dedicated 64 MB stack thread supports the interpreter, safeguarding against stack overflow, a real risk in recursive Cx programs. The numbers tell the tale: 17 files changed, with a net increase of 119 lines.

Memory Boundary Soundness Audit Findings

Commit 41099fb added 12 targeted test programs in examples/audit_memory/, scrutinizing Handle lifecycle, copy semantics, and string arena operations. Results? Nine tests passed cleanly, one known limitation on arena growth remains (accepted for v0.1), one intentional semantic rejection, and importantly, one critical soundness bug identified.

StrRef Escape Challenge

The fix for the crucial StrRef issue (b057340) is now in place. This bug allowed StrRef values into struct fields, sidestepping current escape checks blocking such entries in variable assignments and function returns. New safety layers in semantic.rs now block these potential escapes during struct field assignment and instantiation. Added matrix test t115 confirms the fix with a planned failure, ensuring stricter scope adherence for arena-backed string references. Additional escape paths? None found, but vigilance remains key.

Key Design Decisions

Three pivotal decisions shape the future path:

  • StrRef and Struct Fields: We've shut off all StrRef escape routes via struct fields. This change aligns with our existing policy, sealing the last loophole.

  • Handle Double-Drop as Silent No-op: Confirmed safe by the audit, the handle's generational indexing handles double-drops without incident. Future releases might add warnings, but for now, it's a silent guardian.

  • 64 MB Interpreter Stack Approach: Opting for a simple solution over complex optimizations, a 64MB stack on a dedicated thread solves stack overflow issues for recursive Cx programs without delving into per-frame stack tweaks. It's efficient for v0.1; further reductions remain on the horizon.

Charting the Roadmap to v5.0 and Beyond

The culmination of these efforts shows in commit 587bd20, escalating the submain roadmap to v5.0, complete with the removal of all nine barrier benchmarks. Known limitations are transparent rather than hidden. With submain adjusting to these changes, the main branch roadmap moves to v4.9, noting that the crucial merge work lingers.

What's Next on This Journey

The merge stands as the immediate goal. Submain leads with 19 new commits, while main trails with about 15 that need integrating. This merge won't be trivial — it promises to boost the main matrix from 78 to 117 tests, incorporating all hard blocker resolutions on the main stage.

Post-merge, the focus is on operational tidying — think daily-log branches — and enhancing the quality gate with := type inference and pattern matching advancements. IR lowering for new constructs beckons in the distance, shaping future versions. Though not immediate blockers for v0.1, these will eventually enhance the competing developer experience.

All soundness issues patched, all blockers resolved, and the path from RC to stable release is clear. Now, it's all about integration and refinement, making the magic happen for Cx 0.1.


Follow the Cx language project:

Originally published at https://cx-lang.com/blog/2026-04-25

Top comments (0)