raz / commit ac309c8c

commit
ac309c8cec7523396b4c516c55f1762a385841a7
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
54ea3716
PLAN: Self, the compiler in raz; self/ apart from the seed

patch · log

2 files changed, +38 -1

PLAN.md (history) modified +30 -1

@@ -7,7 +7,36 @@
77
88 v0.9.1, the latest release, is tagged by the owner's word. All before
99 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.
1140
1241 ## Next, when the owner says
1342

self/README.md added +8 -0

@@ -0,0 +1,8 @@
1+# self: the compiler in raz
2+
3+The port of the Pascal compiler, the **seed** in `../src/`, to raz.
4+`../PLAN.md`, "Self", says what it is for and the order of its units.
5+
6+One module to a seed unit, with the seed's name, written to the same
7+rules: plain code, each module opening with what it is, what it
8+depends on and what it leaves out. The seed is never edited from here.