close

DEV Community

COMMENTERTHE9
COMMENTERTHE9

Posted on • Originally published at cx-lang.com

Cx Dev Log — 2026-06-24

Two significant commits hit submain today, closing out the static string subset for the JIT. D2.3d brings print-time string interpolation and f64 print support, and D2.3c adds compile-time literal string concatenation and content equality. The commit sequence moved our parity numbers from 215/71/0 to 222/64/0 across 286 fixtures—submain is advancing fast.

D2.3d: print-time interpolation and f64

This is the heavyweight commit. We've got print("a {x} b") now breaking down into an inline print sequence during lowering. No runtime string construction here; we're passing literals and values through type-suited intrinsics and completing the statement with a cx_print_newline. The aim? Completely sidestep R6 by avoiding dynamic string allocation.

We diverged from the interpreter in a couple of nuanced areas: shadowed names after exiting inner blocks and handling use-before-declaration. Neither scenario is covered by current fixtures, so it's deliberate, not a silent ship. It's linked to an ongoing interpolation-scoping question we've been nudging down the road.

Five new host intrinsics are onboarded in HostBoundarycx_print_str_inline, cx_printn_inline, cx_print_bool_inline, cx_print_f64_inline, and cx_print_newline. Normal print behavior remains unchanged.

f64 print also gets support. Now, print(some_f64) takes the cx_print_f64_inline path, aligning with the interpreter's method using Rust's Display. Previously, f64 was completely off the table for print. Updated fixtures t75_string_interpolation and t55_f64_basic confirm byte-for-byte matches with interpreter output.

D2.3c: literal concat folding and string equality

Technically slightly before midnight, this commit went live on June 23. The str + str concatenation collapses compile-time-known operands into one static descriptor at lowering time—employing the static leak mechanism similar to D2.3b, with runtime skipping beyond R6.

For content equality, we added a cx_str_eq(a_desc, b_desc) callback. It handles descriptors by checking length and memcmp. != is simply == negated. String equality checks, like assert_eq, follow this route. Five fixtures transitioned: t_concat_basic, t_concat_chain, t_concat_empty, t_concat_eq, t78_assert_eq_strings.

Static string subset: done

With D2.3d in, our static string subset is complete. JIT now rolls with string literals, compile-time concat, content equality, and print-time interpolation. Anything necessitating runtime allocation—like dynamic concatenation of non-literals—remains deferred to R6. We've defined a clean boundary: no heap-allocated string type, no dynamic work.

Submain gap keeps growing

There's a 22-commit gulf between submain and main. Submain stands at 222/64/0 across 286 fixtures, while main hovers at 230/230. This separation spans 19 days and counting; predictions of a merge have been off for eight straight days. No technical hurdles in sight—submain's ready.

What's next

Next up is R6 (dynamic strings), signaling a big leap beyond static strings. This means allocation, lifetime management, maybe revisiting the string representation. DotAccess in compound forms is the loose end of Phase 11, predicted for eight days now—a start is overdue. The submain merge remains our best low-effort/high-impact move.


Follow the Cx language project:

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

Top comments (0)