DEV Community

COMMENTERTHE9
COMMENTERTHE9

Posted on • Originally published at cx-lang.com

Cx Dev Log — 2026-05-05

Seven commits in a single session, and the spotlight is on CX-22, CX-23, and CX-24. They leap ahead in the backend roadmap, laying down the critical components of the differential harness, Cranelift lowering skeleton, and the JIT host boundary contract. These are the essential pieces for any Cx program to run through the JIT path. Meanwhile, the trio of CX-18, CX-19, and CX-20 have successfully merged into submain, wrapping up the array lowering sequence from Phase 11.

What Merged

CX-20 (PR #70): This commit delivered array element writes via the IR. Introducing the SemanticLValue::Index variant into semantic analysis, the interpreter, and IR lowering, it ensures that arr:[i] = value and compound assignments like arr:[i] += value function as intended. This involved adding 428 lines across five files. Filed on May 4th, it secured its place in submain today.

CX-18 (PR #67): Commits here verified that Array(N, Struct) lowers correctly, addressing type mapping along with one-, two-, and three-element scenarios. This patch was crucial, closing a test gap from previous array literal work done in CX-16.

CX-19 (PR #68): This update swapped out the generic unsupported!("Range") panic with LoweringError::UnsupportedSemanticConstruct, offering a structured, descriptive error message instead. It was a minimal change but significant for transforming panic indications into useful error values.

Jumping Ahead: Execution Infrastructure

The momentum is with the three recent branch-local commits, blazing a trail beyond the backend roadmap. Phases 12 and 13, tagged as "Next" items following Phase 11, found an early spotlight. Getting them up and running was strategic—their completion doesn't rely on Phase 11, and they're prerequisites for any JIT execution.

CX-23: Differential Harness Shell (Phase 12, sub-packet 1): A fresh src/diff_harness.rs popped up, hosting structures and functions like the TestExpectation enum, TestFixture struct, and others. The shell also includes a function to enumerate all 116 fixtures and run them through an interpreter subprocess capture mechanism. Interesting to note is the consistency in the subprocess method used for both interpreter and JIT paths.

CX-22: Cranelift Lowering Skeleton (Phase 13): Laid down the mapping groundwork for all nine IrType variants, set up scaffolding for module traversal, and established function, block, and instruction dispatch stubs. It also introduced the CraneliftLoweringError type with distinct variants to handle various exceptions. These +460 lines craft the framework Cranelift codegen will eventually inhabit.

CX-24: JIT Runtime Host Boundary: Establishes the contract between the JIT backend and the host process. Notably, JIT operates within the host process—no forking. This lines up with the subprocess output strategy of the differential harness, streamlining output comparisons.

CX-21: MethodCall Structured Error: It rides the same wave as CX-19, refining unsupported!("MethodCall") with an error that details the instance and method name (e.g., "MethodCall 'p.take_damage'"). A small change but one that significantly enriches error clarity during debugging.

These commits remain on branch locals, awaiting their merger into submain.

Decisions Worth Noting

Leaping ahead in the phase sequence is the pivotal decision from this latest stretch. Although Phases 12 and 13 were slated to follow Phase 11, they hold no strict sequencing reliance. Initiating them ensures crucial infrastructure is in place without waiting for the entirety of Phase 11.

The architectural choice embedded in CX-24 is critical. By deciding that JIT operations should occur in-process, the team avoids process forking. This matches seamlessly with the differential harness's design, which uses subprocess execution for capturing outputs, simplifying the comparison logic and ensuring consistency across paths.

What's Next

The submain now carries over 26 commits ahead of the main—a gap that's widening as submain accumulates more changes. The last merge to main (PR #57) corrected a 37-day divide. Reducing this divergence remains the highest priority, highlighted in daily logs.

Immediate tasks on the docket include folding in CX-21 through CX-24 into submain and pushing a submain merge to main sooner rather than later. On the roadmap, the next Phase 11 task involves method call lowering, which currently returns errors instead of generating IR. The upcoming challenge lies in translating obj.method(args) to actual call instructions.

Phase 12's subsequent sub-packet will focus on embedding Cranelift baseline captures within the differential harness, enabling side-by-side comparisons of interpreter and JIT outputs.

Matrix status stands at: 117 PASS / 0 FAIL / 117 total. The numbers remain steady.


Follow the Cx language project:

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

Top comments (0)