From 7619f20cd654e8e77a51ac6abc2796b12b4d6baf Mon Sep 17 00:00:00 2001 From: Brummel Date: Thu, 7 May 2026 11:19:36 +0200 Subject: [PATCH] =?UTF-8?q?JOURNAL:=20Iter-5-Sub-Schritte=205a/5b/5c/5d=20?= =?UTF-8?q?pr=C3=A4zisiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/JOURNAL.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/JOURNAL.md b/docs/JOURNAL.md index 56a72b9..c09a4fa 100644 --- a/docs/JOURNAL.md +++ b/docs/JOURNAL.md @@ -193,3 +193,30 @@ ailang-codegen + 7 ailang-core. **Plan Iteration 5:** Modulsystem mit Imports. Cross-Module-Hashing, Import-Auflösung, mehrere `.ail.json`-Files in einem Build. Multi- Diagnose-Refactor erst danach. + +Sub-Schritte: + +- **5a — Workspace-Loader.** `ailang_core::Workspace { modules: + BTreeMap }` plus `load_workspace(entry: &Path)`, das + `imports` rekursiv vom Eintrittsmodul folgt. Konvention: `import { + module: "foo" }` löst auf `/foo.ail.json` neben dem Entry. Zyklus- + Erkennung. CLI: bestehende Subkommandos arbeiten weiter auf einzelnem + Modul; ein neues `ail workspace ` listet alle erreichbaren + Module mit Hash. Tests: zwei kleine Beispielmodule mit + Import-Beziehung; Zyklus-Test. +- **5b — Cross-Module-Typcheck.** Typchecker bekommt `&Workspace` + statt `&Module`. Imports werden im Env als Namespace eingehängt + (`alias.def` oder bei fehlendem Alias `module.def`). Neue Diagnostic- + Codes: `unknown-module`, `unknown-import`, `import-cycle`, + `ambiguous-name`. Tests pro Code. +- **5c — Cross-Module-Codegen.** Emitter erzeugt IR für alle Module im + Workspace, prefix-mangelt mit `@ail__`. E2E-Test: + Programm, das eine Funktion aus Modul B in Modul A nutzt, liefert + korrektes Ergebnis im Binary. +- **5d — Tooling-Anpassungen.** `manifest`, `describe`, `deps`, `diff` + bekommen einen `--workspace`-Modus (rekursiv). Single-Modus bleibt + Default für Rückwärtskompatibilität. + +Während Iter 5 gleich beim Bau **`source_filename` pfad-unabhängig +halten** (nur Modulname, kein Verzeichnis-Prefix), sonst kippen die +IR-Snapshots.