|
|
@@ -1,77 +1,84 @@
|
|
|
-# Blaise phase sync map (checked 2026-09-20 against graemeg/blaise master)
|
|
|
+# Blaise phase sync map (refreshed 2026-09-23 vs graemeg/blaise master)
|
|
|
|
|
|
-Blaise's 10 phases (README status: 1–5 + 7 complete, 6 ongoing,
|
|
|
-8–10 planned). This file tracks where m2compiler-V3 stands against
|
|
|
-each, and records deliberate divergences so they aren't
|
|
|
-rediscovered. Refresh after every major step.
|
|
|
+Blaise's plan is now **11 phases**; it is fully self-hosting (byte-
|
|
|
+for-byte fixpoint, FPC no longer required after stage 1), ships two
|
|
|
+backends (native x86-64 default, QBE opt-in), two targets (Linux +
|
|
|
+FreeBSD x86_64, bidirectional cross-compile via internal assembler/
|
|
|
+linker), and 4977+ tests. This file compares m2compiler-V3.
|
|
|
|
|
|
## Phase table
|
|
|
|
|
|
-| Blaise | Status there | Us | Status here |
|
|
|
+| Blaise | Blaise status | V3 | V3 status |
|
|
|
|---|---|---|---|
|
|
|
-| 1 Bootstrap pipeline | ✅ | Step 1 (M2→QBE hello) | ✅ done (`v3-step1`) |
|
|
|
-| 2 Type system (classes, records, ARC, exceptions) | ✅ | Steps 2–4.3 (scalars ✅, composites ✅, calls/frames/recursion ✅, nested + display ✅, separate compilation ✅) | ✅ complete modulo deliberate outs |
|
|
|
-| 3 Generics + interfaces | ✅ | Explicitly OUT (R10 blueprints rejected) | ❌ deliberate |
|
|
|
-| 4 OPDF debug info | ✅ | Deferred (listing only) | ❌ deferred |
|
|
|
-| 5 Self-hosting | ✅ | Step 8 (last) | ⚠️ same mechanism, later slot |
|
|
|
-| 6 RTL/StdLib expansion | 🔄 ongoing | Step 5 (Benjamin stdlib) | Not started |
|
|
|
-| 7 Native backend | ✅ | Not planned (QBE is terminal) | ❌ deliberate |
|
|
|
-| 8 Windows/macOS ARM64 | Planned | Out of scope (amd64_sysv) | ❌ |
|
|
|
-| 9 LSP + VS Code | Planned | Deferred vaguely | ❌ |
|
|
|
-| 10 Migration analyser | Planned | 1.12 TopSpeed grammar, 662-file corpus parse-clean | ✅ convergent |
|
|
|
+| 1 Bootstrap pipeline | ✅ | step 1 | ✅ |
|
|
|
+| 2 Type system (classes, records, ARC, exceptions) | ✅ | steps 2–4.3 | ✅ modulo deliberate outs (no ARC, no exceptions) |
|
|
|
+| 3 Generics + zero-GUID interfaces | ✅ | — | ❌ deliberate (R10 blueprints rejected) |
|
|
|
+| 4 OPDF debug info | ✅ | — | ❌ deferred (listing only) |
|
|
|
+| 5 Self-hosting | ✅ | step 8 | 🔄 in progress (V3 cannot yet compile its own sources; gaps below) |
|
|
|
+| 6 Language + expand RTL & StdLib | 🔄 ongoing | step 5 | 🄾 partial (`stdlib/`: SysIO, TextIO, Strings, WholeIO, Math, Files, Storage; `runtime/syslib`: SysShim, FileIO) |
|
|
|
+| 7 Native backend + internal asm/linker | ✅ | — | ❌ deliberate (QBE is terminal) |
|
|
|
+| 8 FreeBSD x86_64 target | ✅ | — | ❌ out of scope (Linux/amd64_sysv) |
|
|
|
+| 9 Windows + macOS ARM64 | ⏳ planned | — | ❌ |
|
|
|
+| 10 LSP + VS Code extension | ⏳ planned | — | ❌ |
|
|
|
+| 11 Migration analyser (FPC/Delphi) | ⏳ planned | 1.12 | ~ convergent (TopSpeed-V3 grammar, 662-file corpus parse-clean) |
|
|
|
|
|
|
-## What "in sync" means here
|
|
|
+## Bottom line
|
|
|
+
|
|
|
+V3 corresponds to **Blaise phases 1–2 done**, **phase 5 (self-hosting)
|
|
|
+in progress**, **phase 6 (RTL/StdLib) partial**; phases 3, 4, 7–10 are
|
|
|
+**deliberate divergences or deferrals**; phase 11 has a convergent
|
|
|
+sidecar. In raw maturity Blaise is far ahead (4977+ tests, self-
|
|
|
+hosting, two backends/targets); V3 is 103 tests and has not yet
|
|
|
+closed the self-hosting loop.
|
|
|
|
|
|
-Process, not phases: phased steps with per-step design docs (their
|
|
|
-`design.adoc` rhythm → our `summary_stepN.md`), test-guarded
|
|
|
-progress, QBE-first backend for speed-to-hosting (their stated
|
|
|
-reason, ours too), fixpoint verification (their 3-stage
|
|
|
-byte-identical bootstrap → our planned `bootstrap/fixpoint.sh`
|
|
|
-over `.ssa`).
|
|
|
+## What "in sync" means here
|
|
|
|
|
|
-Two places we're ahead of their learning curve, per graemeg's own
|
|
|
-v0.12.0 retrospective: our harness has been end-to-end
|
|
|
-(`qbe→cc→run`) since step 1 — exactly the gap (IR-only tests
|
|
|
-missing link/runtime bugs) he's now closing. Keep it that way:
|
|
|
-no step lands on IR inspection alone.
|
|
|
+Process, not phases: phased landings with per-step design docs (their
|
|
|
+`docs/design.adoc` → our `docs/summary_stepN.md`), test-guarded
|
|
|
+progress, QBE-first (their historical reason, ours by choice), and
|
|
|
+fixpoint verification (their 3-stage byte-identical bootstrap → our
|
|
|
+planned `bootstrap/fixpoint.sh` over `.ssa`).
|
|
|
|
|
|
## Warnings adopted from Blaise experience
|
|
|
|
|
|
-- **Rolling bootstrap.** Their `scripts/rolling-bootstrap.sh` exists
|
|
|
- because new parser features break old binaries: once M2 compiles
|
|
|
- itself (step 8), a grammar extension can strand the stage-1
|
|
|
- binary. Our `fixpoint.sh` must rebuild commit-by-commit from the
|
|
|
- last green binary, not just diff three stages. (Recorded pre-emptively;
|
|
|
- hits at step 8.)
|
|
|
-- **Stabilisation cycles.** Their v0.12.0 goes thin-on-features to
|
|
|
- harden the suite. After step 3.4 (composites complete), do the
|
|
|
- same before step 4 calls: a hardening pass over the 50+ suite
|
|
|
- (fuzz bounds, cross-span copies, trap paths) instead of new syntax.
|
|
|
-- **Turnkey gap.** Self-hosting ≠ turnkey: they still need GCC/FPC
|
|
|
- scaffolding. Our step 8 must define "done" as: pinned `qbe`+`cc`
|
|
|
- plus documented host-gm2 bootstrap, nothing else.
|
|
|
+- **Rolling bootstrap** (`scripts/rolling-bootstrap.sh`): new parser
|
|
|
+ features strand old binaries. Our `fixpoint.sh` must rebuild
|
|
|
+ commit-by-commit from the last green binary, not just diff stages.
|
|
|
+- **Stabilisation cycles** (their v0.12.0): go thin-on-features and
|
|
|
+ harden the suite periodically. We did this once (step 3.7); repeat
|
|
|
+ before the fixpoint.
|
|
|
+- **End-to-end tests, not IR-only**: our harness has run
|
|
|
+ `qbe → cc → run` since step 1 — exactly the gap graemeg closed in
|
|
|
+ v0.12.0. Keep it.
|
|
|
+- **Turnkey gap**: self-hosting ≠ turnkey. V3's "done" = pinned
|
|
|
+ `qbe`+`cc` plus a documented host-gm2 bootstrap, nothing else.
|
|
|
|
|
|
## Deliberate divergences (do not relitigate without cause)
|
|
|
|
|
|
-- No ARC/GC, no exceptions, no generics, no native backend, no
|
|
|
- second platform: Modula-2 scope discipline, not Pascal parity.
|
|
|
-- Self-hosting last, not middle: full-language-first was locked;
|
|
|
- the cost is accepted (hygiene rules from step 1 pay it down).
|
|
|
+- No ARC/GC, no exceptions, no generics, no native backend, no second
|
|
|
+ platform, no LSP: Modula-2 scope discipline, not Pascal parity.
|
|
|
+- Self-hosting last, not middle: full-language-first was locked.
|
|
|
- Two grammars, not one: modern `M2.atg` + legacy
|
|
|
- `TopSpeed-V3-M2.atg` (1.12). This mirrors their phase-10
|
|
|
- split (modern core + migration sidecar) and quarantines the
|
|
|
- opposite dialect decisions (`_`, `<>`, `H`/`C`/`B` suffixes).
|
|
|
- Never merge them; the modern grammar stays Redux-clean.
|
|
|
+ `TopSpeed-V3-M2.atg` (1.12) — mirrors their phase-11 split and
|
|
|
+ quarantines the opposite dialect decisions.
|
|
|
+
|
|
|
+## Remaining to reach V3's phase 5
|
|
|
+
|
|
|
+1. Named-CONST constant folding (biggest unblocker) and type-operand
|
|
|
+ `TSIZE`/`SIZE` so V3 can compile `SymTab`/`QbeGen`.
|
|
|
+2. Cross-stage `FileIO` selection (stage 1 host library, stage 2
|
|
|
+ `runtime/syslib/FileIO`).
|
|
|
+3. `bootstrap/fixpoint.sh` (Stage1 gm2 → Stage2 V3 → Stage3 V3,
|
|
|
+ byte-identical `.ssa`, suite green on all stages).
|
|
|
|
|
|
## Drift log
|
|
|
|
|
|
-- 2026-09-20: map created. `plan.md` refreshed (0x-only,
|
|
|
- no-AST-module reality, two-grammar strategy, step-3 substeps).
|
|
|
-- 2026-09-22: 3.5 showcase8, 3.6 pointers, 3.7 hardening (68/68);
|
|
|
- Phase-2 row → near-complete (calls remaining = step 4).
|
|
|
-- 2026-09-22: 4.1 call emission (79/79); Phase-2 row →
|
|
|
- complete modulo deliberate outs (ARC/exceptions/generics).
|
|
|
-- 2026-09-22: 4.2 nested procedures + static-link display (81/81).
|
|
|
-- 2026-09-22: 4.3 separate compilation, single-image session (87/87).
|
|
|
- Step 4 complete; Phase-2 row closed.
|
|
|
-- Next refresh: start of step 5 (Benjamin stdlib).
|
|
|
+- 2026-09-20: map created.
|
|
|
+- 2026-09-22: steps 3.5–4.3 (composites, calls, nesting, separate
|
|
|
+ compilation) — Phase-2 row closed.
|
|
|
+- 2026-09-22: steps 5.1–5.7 (FFI, stdlib, module-qualified symbols,
|
|
|
+ ADDRESS/Storage) — phase 6 partial.
|
|
|
+- 2026-09-22/23: steps 6.1–6.2 (built-ins, 64-bit longs), 7–7.1
|
|
|
+ (syslib port analysis + self-hosted `SysShim`/`FileIO`), 8.1
|
|
|
+ (Redux sweep + self-compile gap analysis) — phase 5 in progress.
|
|
|
+- 2026-09-23: refreshed against Blaise's 11-phase plan (was 10).
|