Phase 8. Query DSL
| Field | Value |
|---|---|
| MEP | MEP-45 §Phases · Phase 8 |
| Status | COMPLETE 2026-05-26 09:06 (GMT+7) |
| Started | 2026-05-25 17:16 (GMT+7) |
| Landed | 2026-05-26 09:06 (GMT+7) |
| Tracking issue | — |
| Tracking PR | — |
Gate
Query fixture suite (~60 cases: filter, map, group-by, order-by, distinct, union, intersect, except, inner/left/cross join) compiles + runs byte-equal vs vm3 on host triple.
Goal-alignment audit
Query DSL (from x in xs where cond select expr) is the highest-value language feature for dataset and AI workflows. Without it programs that process collections must use explicit for-loops + append; the query surface is significantly more readable and matches the MEP-45 target examples. Phase 8.0 lands the core filter+map path and unblocks the majority of realistic single-collection query programs. Aligns directly with user-facing goal.
Sub-phases
| # | Scope | Status | Commit | PR |
|---|---|---|---|---|
| 8.0 | Query algebra lowering: from x in src [where cond] select expr desugars to a for-loop + append inside the lower pass. lowerQueryExpr mirrors lowerMatchExpr (emits into l.currentBlock, returns a VarRef to a fresh temp list). No new IR node needed. 8 fixtures under tests/transpiler3/c/fixtures/query/. TestPhase8QueryDSL gate green. | LANDED 2026-05-25 17:16 (GMT+7) | — | — |
| 8.1 | order by (sort_asc), skip N (list_slice start), take N (list_slice end): ListSortAscExpr + ListSliceExpr IR nodes; emit as mochi_list_<T>_sort_asc and mochi_list_<T>_slice; 8 fixtures; TestPhase8QueryDSL gate extended. | LANDED 2026-05-25 17:40 (GMT+7) |