plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
996aea8
— Peter John
2026-11-04T15:36:10+05:30
docs(plans): compiler cleanup plan re-verified on 217e404 (written by another session)
docs/plans/2026-11-04-compiler-cleanup.review.md
CHANGED
|
@@ -27,7 +27,8 @@ This plan removes the repetition and dead code first, then adds shared building
|
|
|
27
27
|
| 1 | Small duplicates | Merges the copied re-check step, the copied receiver-name helper and the 7 copies of the primitive-name table | S | a fast helper |
|
|
28
28
|
| 1 | Shared test helpers | One test-support crate (parse that fails on syntax errors, load, compile, run, engine) used by every test file | M | a careful helper |
|
|
29
29
|
| 1 | Fewer test programs | Merges the small end-to-end test files into one per crate, removes duplicate tail-call and closure tests, makes the examples sweep look inside sub-folders | M | a careful helper |
|
|
30
|
-
| 2 | Tree walker | One shared walker and
|
|
30
|
+
| 2 | Tree walker | One shared walker, renamer and generic-type substitution (now 4 copies, plus a "single capital letter means generic" guess in the tail-recursion pass); every pass switches to it one at a time | L | careful helpers, one per pass |
|
|
31
|
+
| 2 | Generics by scope | The parser collects each function's generic names once (today they are implied by single capital letters); every later pass asks "is this name declared in scope?" instead of guessing from its spelling, and the enum fallback that infers generics from field names goes | M | a careful helper |
|
|
31
32
|
| 2 | Real tree queries | Replaces the debug-text searches in tail-recursion and closure passes with walker queries | S | a careful helper |
|
|
32
33
|
| 2 | Host crate | One crate with the engine setup, string passing and all host imports; CLI, runtime and game use it | M | a careful helper |
|
|
33
34
|
| 2 | One front end | One lowering entry used by both the loader and single-file parsing; `test` blocks are turned into functions there instead of in codegen | M | a careful helper |
|
|
@@ -74,7 +75,7 @@ flowchart TB
|
|
|
74
75
|
Each phase gets its own machine plan and its own commit series, and ends with the full workspace test suite and the examples green. I come back to you only between phases if something changed from this plan.
|
|
75
76
|
|
|
76
77
|
## Decisions you can change
|
|
77
|
-
- When to start: after the language-restrictions branch is merged to master (decided by you, 2026-11-04). Then on a fresh branch from master.
|
|
78
|
+
- When to start: after the language-restrictions branch is merged to master (decided by you, 2026-11-04). Then on a fresh branch from master. Re-verified on master 217e404 the same day: all findings still hold.
|
|
78
79
|
- Where it sits in your queue: before native inline variants, because those add more AST variants and walkers (default) | after the benchmark / FBIP work.
|
|
79
80
|
- Enum kinds (phase 5): do it here (default) | fold it into the queued record-into-struct merge.
|
|
80
81
|
- Pass driver: a new small driver crate (default) | a module inside codegen.
|