Step 10: v0.6.0 The compiler follows report 2026-10.12; the report drops its note that it lags. doc/compiler.md's table and prose for the eleven units, the listing and the trap report; README's -S, trap report, profiler and versions; CLAUDE.md and PLAN.md say v0.6.0 is done, steps 5 to 10 awaiting review together. 7,632 lines of code; bench 931k lines/s.
| @@ -85,9 +85,10 @@ | ||
| 85 | 85 | **The freeze.** Since v0.5.0 the language changes only to mend a |
| 86 | 86 | defect, and the library grows only by what breaks no program written |
| 87 | 87 | for it. A wish for more, the owner's or yours, goes on the list in |
| 88 | -`PLAN.md`, for a later thaw; it isn't built. v0.6.0 is such a thaw, | |
| 89 | -by the owner's word: report 2026-10.11, approved, which the compiler | |
| 90 | -is being brought to follow (`PLAN.md`). Keep | |
| 88 | +`PLAN.md`, for a later thaw; it isn't built. v0.6.0 was such a thaw, | |
| 89 | +by the owner's word: report 2026-10.12, which the compiler follows, | |
| 90 | +its parser reaching the machine only through `gen.pas` (`PLAN.md`; | |
| 91 | +its steps 5 to 10 await the owner's review). Keep | |
| 91 | 92 | `doc/compiler.md`'s table of lines and its routine names true when the |
| 92 | 93 | compiler changes. |
| 93 | 94 | |
| @@ -98,7 +99,7 @@ | ||
| 98 | 99 | `.github/workflows/ci.yml`, which checks it and makes the GitHub |
| 99 | 100 | release with a tarball of `raz` and `lib/`; it also checks every push |
| 100 | 101 | to `main`. `README.md`'s "Versions" gives the commands. v0.3.0 is |
| 101 | -the first; v0.5.0, report 2026-10.9, the latest. | |
| 102 | +the first; v0.6.0, report 2026-10.12, the latest. | |
| 102 | 103 | |
| 103 | 104 | `test/libc` runs its programs over `lib/Sys.raz`, the C one, through |
| 104 | 105 | a link in its `mods`. A test or example without `.expect` is only |
| @@ -64,11 +64,12 @@ | ||
| 64 | 64 | `doc/compiler.md`'s table, the report's version and the |
| 65 | 65 | compiler's; tag `v0.5.0`. |
| 66 | 66 | |
| 67 | -## Proposed, v0.6.0: raz to be rebuilt by anyone | |
| 67 | +## v0.6.0: raz to be rebuilt by anyone | |
| 68 | 68 | |
| 69 | -Under way: steps 1 to 4 are done, step 3 set aside since. The owner | |
| 70 | -has agreed the rest, to step 10, to be done without stopping. The freeze | |
| 71 | -doesn't hold for this work, by the owner's word. | |
| 69 | +Done, and tagged `v0.6.0`: report 2026-10.12, step 3 set aside. The | |
| 70 | +owner agreed steps 5 to 10 to be done without stopping, so they wait | |
| 71 | +for review together. The freeze didn't hold for this work, by the | |
| 72 | +owner's word. | |
| 72 | 73 | |
| 73 | 74 | **For:** a language a person alone can implement again, from the |
| 74 | 75 | report, on any machine, in weeks; programs that run on small machines |
| @@ -159,7 +160,7 @@ | ||
| 159 | 160 | - [x] 9e. A profiler in `Rt`: a program run with `RAZ_PROFILE` set |
| 160 | 161 | samples where it is, and at its end says which procedures and |
| 161 | 162 | lines took the time. |
| 162 | -- [ ] 10. `doc/compiler.md`, README, the report's version and the | |
| 163 | +- [x] 10. `doc/compiler.md`, README, the report's version and the | |
| 163 | 164 | compiler's; tag `v0.6.0`. |
| 164 | 165 | |
| 165 | 166 | The budget, by the owner's word: a soft limit of 8,000 lines of code, |
| @@ -175,16 +175,16 @@ | ||
| 175 | 175 | The compiler says its own version and that of the report it follows: |
| 176 | 176 | |
| 177 | 177 | $ ./raz --version |
| 178 | - raz 0.5.0, report 2026-10.9 | |
| 178 | + raz 0.6.0, report 2026-10.12 | |
| 179 | 179 | |
| 180 | 180 | The compiler's version is git's name for the commit it was built from: |
| 181 | -`0.5.0` at the tag `v0.5.0`, `0.5.0-5-g38d29a8` five commits past it. | |
| 181 | +`0.6.0` at the tag `v0.6.0`, `0.6.0-5-g38d29a8` five commits past it. | |
| 182 | 182 | To release, check `main` and tag it; the tag's message is what |
| 183 | 183 | `raz --version` will print: |
| 184 | 184 | |
| 185 | 185 | $ make check |
| 186 | - $ git tag -a v0.5.1 -m 'raz 0.5.1, report 2026-10.9' | |
| 187 | - $ git push origin v0.5.1 | |
| 186 | + $ git tag -a v0.6.1 -m 'raz 0.6.1, report 2026-10.12' | |
| 187 | + $ git push origin v0.6.1 | |
| 188 | 188 | |
| 189 | 189 | GitHub then builds and checks the tag, and makes a release of it with |
| 190 | 190 | a tarball of `raz` and its `lib/`. A tag pushed before the workflow |
| @@ -195,7 +195,8 @@ | ||
| 195 | 195 | |
| 196 | 196 | Since v0.5.0 the language is frozen, softly: it changes only to mend a |
| 197 | 197 | defect, and the library grows only by what breaks no program. Wishes |
| 198 | -wait on a list in `PLAN.md`, for a later thaw. | |
| 198 | +wait on a list in `PLAN.md`, for a later thaw; v0.6.0 was one, for a | |
| 199 | +language anyone can build again from its report. | |
| 199 | 200 | |
| 200 | 201 | ## Not here |
| 201 | 202 |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # Reading the raz compiler |
| 2 | 2 | |
| 3 | -The compiler is eleven files of Free Pascal, some 7,000 lines of code. | |
| 3 | +The compiler is eleven files of Free Pascal, under 7,700 lines of code. | |
| 4 | 4 | This guide walks through them in the order they are best read: from the |
| 5 | 5 | characters of a source file to the bytes of an executable. It assumes |
| 6 | 6 | you know the language from `doc/raz.md`, and enough x86-64 to read a |
| @@ -92,7 +92,8 @@ | ||
| 92 | 92 | end; |
| 93 | 93 | ``` |
| 94 | 94 | |
| 95 | -comes out as this (from `objdump -d -M intel`): | |
| 95 | +comes out as this (from `objdump -d -M intel`; `raz -S` shows the same | |
| 96 | +under each line of source, named by the compiler as it made them): | |
| 96 | 97 | |
| 97 | 98 | ``` |
| 98 | 99 | push rbp ; EnterBody: the frame |
| @@ -499,21 +500,23 @@ | ||
| 499 | 500 | line, column and file; and for the trap report, each live procedure's |
| 500 | 501 | address range and name, and its variables, which `Body` (`parse.pas`) |
| 501 | 502 | notes with `NoteVar`: each one's name, its place in the frame and how |
| 502 | -`Rt` shows it (`VarKind`). `Rt` reads them, through `Rt.places`, which the | |
| 503 | -entry point sets, to say where a failed check or a signal was: the | |
| 504 | -place with the highest address up to the one it has. Then it follows | |
| 505 | -the chain of frames, each `rbp` pointing at its caller's, and says | |
| 506 | -each call under way and its variables (`calls`); `Rt.trace` does the | |
| 507 | -same on demand. A thread's first frame has `rbp` zero, which ends it. | |
| 508 | -With `RAZ_PROFILE` set, `Rt`'s body has the kernel send SIGPROF every | |
| 509 | -millisecond of the program's time (`setitimer`); `onProf` notes the | |
| 510 | -address it interrupted, and `exit` has `profile` say which procedures | |
| 511 | -and places those fell in, by the same tables. Its signal | |
| 503 | +`Rt` shows it (`VarKind`). `Rt` reads them, through `Rt.places`, which | |
| 504 | +the entry point sets, to say where a failed check or a signal was: the | |
| 505 | +place with the highest address up to the one it has. Its signal | |
| 512 | 506 | handlers, set in its body, run on a stack of their own, so that they |
| 513 | 507 | can tell a stack overflow, and leave by returning to the faulting |
| 514 | 508 | instruction with the handler reset, so that the signal ends the |
| 515 | 509 | program. |
| 516 | 510 | |
| 511 | +Then `Rt` follows the chain of frames, each `rbp` pointing at its | |
| 512 | +caller's, and says each call under way and its variables (`calls`); | |
| 513 | +`Rt.trace` does the same on demand. A thread's first frame has `rbp` | |
| 514 | +zero, which ends the chain. With `RAZ_PROFILE` set, `Rt`'s body has the | |
| 515 | +kernel send SIGPROF every millisecond of the program's time | |
| 516 | +(`setitimer`); `onProf` notes the address it interrupted, and `exit` | |
| 517 | +has `profile` say which procedures and places those fell in, by the | |
| 518 | +same tables. | |
| 519 | + | |
| 517 | 520 | The layout is chosen so the file can be mapped as it lies: text just |
| 518 | 521 | after the headers, rodata on the next page, then a writable page that |
| 519 | 522 | begins with the dynamic loader's table (in a program that uses C) and |
| @@ -571,7 +574,7 @@ | ||
| 571 | 574 | - **An instruction:** a routine in `x64.pas` built on `OpM` or `OpR`, |
| 572 | 575 | and a line in `test/enctest.pas` to check its encoding. |
| 573 | 576 | - **A machine:** a new `gen.pas`, answering the same calls, and an |
| 574 | - encoder for it in place of `x64.pas`. | |
| 577 | + encoder and assembler for it in place of `x64.pas`. | |
| 575 | 578 | - **A statement:** a reserved word in `scan.pas` (in `TSym` and `Words`, |
| 576 | 579 | in the same order), a case in `Statement`, and a routine beside the |
| 577 | 580 | others. |
| @@ -12,8 +12,6 @@ | ||
| 12 | 12 | This is version 2026-10.12 of the report; section 12 says what each |
| 13 | 13 | version changed. It is a thaw the owner chose, for a language anyone |
| 14 | 14 | can build again, and it breaks programs written for 2026-10.10. |
| 15 | -The compiler follows version 2026-10.10 until it is brought to this | |
| 16 | -one. | |
| 17 | 15 | |
| 18 | 16 | The language is frozen, softly, from this version on: it changes only |
| 19 | 17 | to mend a defect, and its library grows only by what breaks no program |
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | { what git describe says, made by make: 0.3.0 at the tag v0.3.0, |
| 33 | 33 | 0.3.0-5-g38d29a8 five commits past it } |
| 34 | 34 | Version = {$I version.inc}; |
| 35 | - Report = '2026-10.10'; { the version of doc/raz.md it follows } | |
| 35 | + Report = '2026-10.12'; { the version of doc/raz.md it follows } | |
| 36 | 36 | MemfdCreate = 319; { the system call; FPC 3.2.2 has no name for it } |
| 37 | 37 | MfdCloexec = 1; { an ELF still executes: the kernel opens it first } |
| 38 | 38 |