From ac309c8cec7523396b4c516c55f1762a385841a7 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Tue, 13 Oct 2026 15:12:35 +0100 Subject: [PATCH] PLAN: Self, the compiler in raz; self/ apart from the seed --- diff --git a/PLAN.md b/PLAN.md index c9a07a3..026f5b8 100644 --- a/PLAN.md +++ b/PLAN.md @@ -7,7 +7,36 @@ v0.9.1, the latest release, is tagged by the owner's word. All before v0.7.1 is approved by the owner; v0.7.1, v0.8.0, v0.9.0 and v0.9.1 wait -for the owner's review. No milestone is under way. +for the owner's review. One milestone is under way: Self. + +## Self: the compiler in raz (under way) + +For: a compiler written in raz that compiles itself, so that raz needs +no Free Pascal. The Pascal compiler in `src/` is the **seed**: it is +never edited for this, and stays the one `make check` builds. The new +compiler lives in `self/`, one raz module to a seed unit, the same +names, and has its own targets; nothing in `src/` or `lib/` changes. + +Each unit is ported in the seed's order (leaves first) and tested on +its own against the seed's, on the same inputs, since no program can +link both. The language and the library are frozen: a gap found goes +on the wish list, a defect is mended. + +Steps: + +1. `diag` and `scan`: the trial. Measure `scan`'s speed against the + seed's and list what `Sys` and the library lacked. Stop for review: + if the cost is too high, mend the code generator first. +2. `chunk`, `sym`, `link`, `elf`, `x64`. +3. `gen`, `item`. +4. `parse`, `raz`: the first compiler that builds. +5. Fixpoint: the seed builds `self`, that builds `self`, that builds + `self` again, and the last two are byte for byte the same. Then + the seed's last tag is the bootstrap, and the split of `src/` from + the rest is the owner's to decide. + +Done when step 5 passes with `make check` and `make bench` on the +compiler it made, and the budget of lines kept. ## Next, when the owner says diff --git a/self/README.md b/self/README.md new file mode 100644 index 0000000..68fa4e9 --- /dev/null +++ b/self/README.md @@ -0,0 +1,8 @@ +# self: the compiler in raz + +The port of the Pascal compiler, the **seed** in `../src/`, to raz. +`../PLAN.md`, "Self", says what it is for and the order of its units. + +One module to a seed unit, with the seed's name, written to the same +rules: plain code, each module opening with what it is, what it +depends on and what it leaves out. The seed is never edited from here.