Skip to content

v2: finish flat AST migration#27372

Merged
medvednikov merged 11 commits into
masterfrom
codex/v2-flat-ast-migration
Jun 7, 2026
Merged

v2: finish flat AST migration#27372
medvednikov merged 11 commits into
masterfrom
codex/v2-flat-ast-migration

Conversation

@medvednikov

@medvednikov medvednikov commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • make the v2 flat AST pipeline the default path for parsing, checking, transforming, SSA, and CleanC backend flow
  • migrate transformer passes to operate from flat AST cursors/readers without rehydrating whole files
  • add flat-aware handling for imports, comptime import conditions, type propagation, monomorphization, live reload injection, and runtime init
  • fix compiler-side lowering issues for map or {} expressions and raw array for in codegen so source-level avoids are no longer needed

Root Cause / Impact

The v2 pipeline still had several places that decoded or depended on rehydrated AST files, which blocked using flat AST consistently. During self-hosting, that also exposed compiler bugs around map-index or {} lowering and typed runtime array iteration; those are fixed in compiler code instead of avoided in source.

Validation

  • ./v -g -keepc -o ./vnew cmd/v
  • ./vnew -silent test vlib/v2/gen/cleanc/cleanc_test.v
  • ./vnew -silent test vlib/v2/transformer/transformer_flat_diff_test.v
  • ./vnew -silent test vlib/v2/ssa/optimize/
  • ./vnew -silent test vlib/v2/transformer/
  • ./vnew -silent test vlib/v2/builder/gen_cleanc_parallel_test.v
  • ./vnew -silent test vlib/v2/gen/cleanc/generic_struct_scan_test.v
  • git diff --check
  • cd cmd/v2 && ../../v -o v2 v2.v && ./v2 -o v3 v2.v

@medvednikov medvednikov merged commit 3dd96de into master Jun 7, 2026
77 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant