今日已更新 264 条资讯 | 累计 23847 条内容
关于我们

标签:#cx

找到 4 篇相关文章

AI 资讯

Cx Dev Log — 2026-07-21

Two substantial slices of gene/phen trait implementation just landed on submain . This shifts the needle significantly—contract checking and the capability for phen methods to actually get called at runtime are in the door. Previously, we only had the basic declarations and coherence working but now methods can type-check, Self can resolve per receiver, and calls execute. The submain branch now sits 15 commits ahead of main , holding the matrix at 321/0. Contract Checking and Self Resolution (Slice 2) Let's zero in on commit fcd3193 , which makes waves with 594 insertions across 23 files. The big takeaway is Pass 0 contract conformance. The collect_gene_phen_registry() function now actively validates every phen against its gene. Consider everything from arity to positional parameter types (post- Self substitution), return types, and even checks for both missing and extra methods. If there's a mismatch, it doesn’t just shout—each one is a precise diagnostic identifying gene, method, position, and expected-vs-actual types. It's pinpoint troubleshooting. The decision to resolve Self at the concrete level before analysis was deliberate. Self in phen signatures and bodies changes to the actual receiver type within the AST thanks to substitute_self_type() . This function even navigates through intricate structures like Array , Handle , and Result wrappers. There was an alternative: treating Self as a floating type parameter. But honestly, it doesn't cut it because types_compatible would unify any type param with anything. Sticking to the design docs, our path— Self is concrete, not a floating parametric. How about ownership? It's strict. There's no room for unauthorized methods beyond the gene's contract. And we're talking multiple enforcement points: from Pass 0 checks to the phen_methods field on Analyzer triggered during per-file analysis, down to cross-gene-method name collisions caught by Pass 0. Every path specified is locked down, as envisioned by the design docs.

2026-07-22 原文 →
AI 资讯

Cx Dev Log — 2026-07-18

Cx Dev Log — 2026-07-18: A Moment of Pause Before the Next Push The Cx codebase has taken a breather. It's been quiet for five days, a rarity in the fast-paced world of solo-developed languages. Main is stable at commit 3430e4e , marked by the last 0.3.1 release tag from July 9. Submain's clocked at 3b7b7f8 with the freshly finalized gene/phen design as of July 14. Even the automated matrix stands firm: 321 tests passing, zero failing. But quiet isn't inactivity—it's anticipation. Where the Project Sits The significant chunk of work that wrapped on July 14 was hefty: the gene/phen design's v1.1 spec. It doesn't just wrap dispatch strategies; we're talking about cleaner Ord mappings, robust Self resolutions, and handling phen lookups with cross-module coherence. Those are down in a 13-commit series on submain, the product of a thorough hammering out of all six outstanding design questions. But it wasn't just theoretical. These commits include necessary parser and semantic adjustments, say, coming out of our recent audit. Scoping issues are in check, width-range enforcement leveled up, and we've put any unnecessary comparison errors on Bool/Enum to bed. There's a crucial runtime patch too—no more enum == / != crashes blowing up the interpreter. We've also streamlined CI through direct run_matrix.sh runs. These advances sit 13 steps ahead of main without a single technical barricade to rushing them into action. This delay in merging? It's purely deliberate, not dictated by troublesome conflicts or failing tests. What's Queued Once Work Resumes So, what's cooking when the fingers start flying across keyboards again? Here's what's lined up: Merge submain to main. We've got 13 commits begging for integration. Expect this to be painless, almost ceremonial, since main's been untouched. 0.3.4: Gene/Phen Implementation. The design spec isn’t a riddle wrapped in an enigma—it's a clear blueprint. It's got everything: pass ordering, canonical key formats, robust collision detect

2026-07-19 原文 →
AI 资讯

Cx Dev Log — 2026-06-28

Labeled break/continue is now live across the entire Cx language stack. From the lexer to the JIT, two commits streamlined the implementation into a complete vertical slice. No parts left out, no corners cut—everything just works. The lexer seam If you're handling character literals and labels in the same codebase, you'll know what a pain this can be. We opted for a Rust-like syntax: 'ident for labels, with no closing quote. The label regex sits right after LiteralChar in the logos enum. Thanks to longest-match, 'x' becomes a char literal, while 'outer is parsed as a label. Escape sequences? They can't match labels because they have a backslash, making 'x' always look cleaner in code. A test fixture ( t_char_literal_guard ) ensures this order and regex integrity hold. Change the lexer rules, and it'll catch any mistakes immediately. Two-commit split We didn't cram this into a single mega-commit. No, we split it into two. Commit f94c6a5 laid down the frontend groundwork—adding the Label token, allowing loops and breaks to carry optional labels, and rejecting any misuse with semantic checks. The interpreter and JIT, however, initially took a back seat, guarding themselves against mislabeled jumps. Then came commit 0f56f1e , which wiped out these guards and enabled real execution on backends. Now all parses and semantic checks play nicely without rogue labeled breaks sneaking into the wrong loops. Interpreter changes The interpreter now handles BreakSignal and ContinueSignal carrying labels. Loops catch these signals when the label is either absent (defaulting to the innermost loop) or matches their own. The difference from before? Zero unlabelled break/continue behavior change while facilitating outward jumps. JIT changes The JIT saw more extensive adjustments, gaining a label field within LoopContext . Push and pop that context on a stack, trace it through lowering calls, and you've got labeled jumps pinpointed. The unlabeled jumps? They get the same treatment as bef

2026-06-29 原文 →
AI 资讯

Cx Dev Log — 2026-05-25

The interpreter's variable lookup is now blazing through arithmetic loops at a 57% faster pace. But this isn't just about raw speed — four tracker items were checked off the list, culminating in a more robust system. All rolled out on submain, a direct result of a thorough four-pillar audit. BindingId replaces string hashing at runtime The heavyweight change came from tracker #009. Previously, our interpreter was busy hashing variable names every time they were accessed. That was a repeat offender in wasted cycles. Now, by using a pre-assigned numeric BindingId, we seize efficiency. The semantic phase was already handing out these IDs, but the runtime kept adding the overhead back. It doesn’t anymore. ScopeFrame.vars has transitioned to a HashMap equipped with a zero-cost identity hasher keyed by u32 binding IDs. Name-based lookups are still around but tucked away for less frequent operations like string interpolation. Fixes were necessary upstream: ConstDecl and semantic_impls now hold onto their BindingId, making sure our semantic phase pipelines gracefully into the interpreter's primary key system — narrowing the gap with JIT's variable handling. Here's how the numbers shine on a Windows release build: arith_loop (5M iterations): from 5744ms down to 2481ms (56.8% boost) nested_loops (4M iterations): from 2675ms down to 1796ms (32.8% boost) fib_recursive: from 6835ms down to 6488ms (merely 5.1% faster due to call-frame constraints) Our findings align with expectations: recursive functions aren't bogged down by variable lookups as much as by setting up call frames. Array bounds errors stop lying Misleading diagnostic labels are on their way out, thanks to tracker #002 and #032. Attempts to access out-of-bounds array indices once triggered an error as unhelpful as variable 'index 5' has not been declared . Not anymore. Changes came in two waves. First, we introduced a new error variant: RuntimeError::IndexOutOfBounds { pos, index, length } . Then, three runtime.rs c

2026-06-09 原文 →