Skip to content

Commit aedb95b

Browse files
committed
Update Stage 3 plan for Stage 2 reality
Record program-level HIR/MIR, module namespaces, and per-module codegen/mangling. Clarify core placement in sysroot and multi-module run-pass fixtures.
1 parent 8065447 commit aedb95b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

implementation_plans/STAGE3.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Enable nominal user-defined types and enforce Wyrm’s ownership model end-to-en
4646
## 1. Fixed inputs and prerequisites (do not reopen)
4747

4848
- Stage 2 module system and static imports are in place.
49+
- HIR/MIR are program-level (`hir::Program`, `mir::Program`) with cross-module export tables; Stage 3 should extend these rather than reintroducing per-module-only flows.
50+
- Module-level `let` bindings are const-only and require explicit types (Stage 2 decision); Stage 3 should not assume runtime module init via top-level code.
51+
- Module namespaces and module-qualified path resolution are already implemented (imported modules bind namespaces; exports resolve via module paths).
4952
- Explicit `self` parameter in methods is required (WYRM §3.6).
5053
- Surface syntax does **not** expose `&` / `&mut` (ADR-0001).
5154
- Memory model uses ARC for shared ownership and deterministic drops.
@@ -67,6 +70,7 @@ Enable nominal user-defined types and enforce Wyrm’s ownership model end-to-en
6770
- `compiler/wyrmc_hir` / `wyrmc_typeck`: add type/impl/method tracking, ownership checks.
6871
- `compiler/wyrmc_mir`: add aggregate/field operations and drop/refcount statements.
6972
- `compiler/wyrmc_passes`: add ownership/drop elaboration pass.
73+
- `compiler/wyrmc_resolve`: already provides module graphs and resolution; Stage 3 should build on its output.
7074
- `libraries/wyrm_runtime`: add refcount and allocation helpers.
7175
- `libraries/wyrm_core`: add `Option`, `Result`, and ownership wrapper types.
7276

@@ -212,6 +216,8 @@ borrows for views. Stage 3 must enforce:
212216
- [ ] Generate functions for struct/enum constructors and methods.
213217
- [ ] Lower drop glue calls into LLVM calls.
214218
- [ ] Lower refcount operations to runtime calls.
219+
- [ ] Use the existing Stage 2 mangling scheme for new symbols (`wyrm$<mod_path>$<name>`; keep `wyrm_main` unmangled).
220+
- [ ] Follow per-module LLVM emission (one LLVM module per Wyrm module).
215221

216222
---
217223

@@ -225,6 +231,7 @@ borrows for views. Stage 3 must enforce:
225231
### 10.2 Ownership wrappers
226232
- [ ] Provide surface wrappers for `Box[T]`, `Rc[T]`, `Arc[T]` in `core`.
227233
- [ ] Keep implementations minimal and compiler-friendly.
234+
- [ ] Place `core` modules under `<sysroot>/modules/core` to match Stage 2 sysroot resolution.
228235

229236
---
230237

@@ -252,6 +259,7 @@ borrows for views. Stage 3 must enforce:
252259
- [ ] `Box` allocation + drop.
253260
- [ ] `Rc` clone/drop (refcount sanity).
254261
- [ ] `Option`/`Result` usage in `core`.
262+
- [ ] Use directory-based run-pass fixtures for multi-module tests (supported since Stage 2).
255263

256264
### 12.3 Compile-fail tests
257265
- [ ] Use-after-move.

0 commit comments

Comments
 (0)