| | @@ -7,7 +7,36 @@ |
| 7 | 7 | |
| 8 | 8 | v0.9.1, the latest release, is tagged by the owner's word. All before |
| 9 | 9 | v0.7.1 is approved by the owner; v0.7.1, v0.8.0, v0.9.0 and v0.9.1 wait |
| 10 | | -for the owner's review. No milestone is under way. |
| 10 | +for the owner's review. One milestone is under way: Self. |
| 11 | + |
| 12 | +## Self: the compiler in raz (under way) |
| 13 | + |
| 14 | +For: a compiler written in raz that compiles itself, so that raz needs |
| 15 | +no Free Pascal. The Pascal compiler in `src/` is the **seed**: it is |
| 16 | +never edited for this, and stays the one `make check` builds. The new |
| 17 | +compiler lives in `self/`, one raz module to a seed unit, the same |
| 18 | +names, and has its own targets; nothing in `src/` or `lib/` changes. |
| 19 | + |
| 20 | +Each unit is ported in the seed's order (leaves first) and tested on |
| 21 | +its own against the seed's, on the same inputs, since no program can |
| 22 | +link both. The language and the library are frozen: a gap found goes |
| 23 | +on the wish list, a defect is mended. |
| 24 | + |
| 25 | +Steps: |
| 26 | + |
| 27 | +1. `diag` and `scan`: the trial. Measure `scan`'s speed against the |
| 28 | + seed's and list what `Sys` and the library lacked. Stop for review: |
| 29 | + if the cost is too high, mend the code generator first. |
| 30 | +2. `chunk`, `sym`, `link`, `elf`, `x64`. |
| 31 | +3. `gen`, `item`. |
| 32 | +4. `parse`, `raz`: the first compiler that builds. |
| 33 | +5. Fixpoint: the seed builds `self`, that builds `self`, that builds |
| 34 | + `self` again, and the last two are byte for byte the same. Then |
| 35 | + the seed's last tag is the bootstrap, and the split of `src/` from |
| 36 | + the rest is the owner's to decide. |
| 37 | + |
| 38 | +Done when step 5 passes with `make check` and `make bench` on the |
| 39 | +compiler it made, and the budget of lines kept. |
| 11 | 40 | |
| 12 | 41 | ## Next, when the owner says |
| 13 | 42 | |