| | @@ -1,8 +1,9 @@ |
| 1 | 1 | # Working on raz |
| 2 | 2 | |
| 3 | 3 | Read `PLAN.md` (the milestone under way and its steps), `doc/raz.md` |
| 4 | | -(the language report) and `doc/compiler.md` (the guide to the |
| 5 | | -compiler) first. The report defines the language; where the plan |
| 4 | +(the language report, volume 1) and `doc/compiler.md` (the guide to the |
| 5 | +compiler) first; `doc/raz-lib.md` is volume 2, the library, and |
| 6 | +`doc/report-history.md` what each version of the report changed. The report defines the language; where the plan |
| 6 | 7 | disagrees, the report wins and the plan is fixed. |
| 7 | 8 | |
| 8 | 9 | ## Setup and checks |
| | @@ -108,7 +109,8 @@ |
| 108 | 109 | defect, and the library grows only by what breaks no program written |
| 109 | 110 | for it. A wish for more, the owner's or yours, goes on the list in |
| 110 | 111 | `PLAN.md`, for a later thaw; it isn't built. v0.6.0 was such a thaw, |
| 111 | | -by the owner's word: report 2026-10.12; the compiler follows 2026-10.21, whose `match` on an enumeration takes |
| 112 | +by the owner's word: report 2026-10.12; the compiler follows 2026-10.22, an audit of the report (mends, trims, |
| 113 | +two volumes, status 2 for every stop), and 2026-10.21, whose `match` on an enumeration takes |
| 112 | 114 | several names to an arm (10.21), and 2026-10.20, whose `try` returns an error that isn't |
| 113 | 115 | nil from the procedure it stands in (10.20, the owner's word), and 2026-10.19, |
| 114 | 116 | whose `Sys` writes without waiting, for rat's pastes (10.13), and |
| | @@ -130,7 +132,7 @@ |
| 130 | 132 | `.github/workflows/ci.yml`, which checks it and makes the GitHub |
| 131 | 133 | release with a tarball of `raz` and `lib/`; it also checks every push |
| 132 | 134 | to `main`. `README.md`'s "Versions" gives the commands. v0.3.0 is |
| 133 | | -the first; v0.10.1, report 2026-10.21, the latest: the compiler in raz, |
| 135 | +the first; v0.11.0, report 2026-10.22, the latest: the compiler in raz, |
| 134 | 136 | built by itself, and 1.4 times the Pascal one's time (v0.9.1 was the last |
| 135 | 137 | built by the Pascal seed). The tarball has `tools/`, which the website |
| 136 | 138 | offers from 0.7.1 on. |
| | @@ -187,28 +189,28 @@ |
| 187 | 189 | - Past an extern's parameters, a string goes as a C string and an |
| 188 | 190 | integer constant as an `INT`. |
| 189 | 191 | - A real constant is held as an F64; one typed `F32` holds a value an |
| 190 | | - F32 can hold. An `F32` in a register is its low 32 bits; the upper |
| 192 | + F32 can hold (the report says so, 2). An `F32` in a register is its low 32 bits; the upper |
| 191 | 193 | ones are left as they fall. |
| 192 | 194 | - `Heap` and `Out` lock with `Lock`, a spinlock that yields, since they |
| 193 | 195 | serve C's threads and `Thread`'s alike; `Thread.Mutex` is a futex. |
| 194 | 196 | - A failed check says what failed and with what values, at the place |
| 195 | 197 | of the offending expression. A signal is told at the place of the |
| 196 | 198 | statement it stopped in, or of the procedure for a stack overflow in |
| 197 | | - its prologue. The handlers run on a stack of their own: `Rt`'s for |
| 199 | + its prologue, and the program ends by `Rt.exit(2)`, after its |
| 200 | + `atExit` procedures, as a failed check does (report 2026-10.22; a |
| 201 | + fault inside `Out`'s or `Heap`'s lock would hang there). The handlers run on a stack of their own: `Rt`'s for |
| 198 | 202 | the main thread, and one in each `Thread` thread's mapping. C's |
| 199 | | - threads have none, so a stack overflow in one ends the program by |
| 200 | | - the signal with no message. |
| 203 | + threads have none, so a stack overflow in one still ends the program |
| 204 | + by the signal with no message. |
| 201 | 205 | - The smallest value of a signed type divided by -1 stops the program |
| 202 | 206 | (SIGFPE), as 6.1 says, `mod` as `div`; for a type narrower than 64 |
| 203 | 207 | bits the code makes the division fault, as the machine wouldn't. In |
| 204 | 208 | a constant it is an error, as dividing by zero is. |
| 205 | 209 | - `INT` widens to `I64` (and `UINT` to `U64`) wherever a value is |
| 206 | 210 | assigned, passed or returned, `return a, b` included; not in `a, b := |
| 207 | | - f(x)`, `return f(x)`, a `for` or `INC`/`DEC`. An untyped constant |
| 208 | | - converts to a pointer, as an `INT`. |
| 209 | | -- Another module's exported variable, or a field or array element of |
| 210 | | - it, is read-only: an `extern` one too. A slice in it may be sliced, |
| 211 | | - since that can't change the variable; an array in it may not. |
| 211 | + f(x)`, `return f(x)`, a `for` or `INC`/`DEC` (in the report, 5.10). |
| 212 | +- An `extern` module variable is read-only for an importer, as the |
| 213 | + report says of every exported variable (3). |
| 212 | 214 | - Warnings come only for a module with no errors. A procedure naming |
| 213 | 215 | itself doesn't use it; a type named by a pointer in its own |
| 214 | 216 | declaration does. An enumeration's names are never warned of, nor a |