raz / commit c6872e07

commit
c6872e07137a4647f8d22096def7ae8bd4ad3441
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
0081856c
release
v0.18.0
Docs: 2026-10.32 told whole; an example kept with its paragraph

report-history names Vec.pop; raz-lib reflowed where links and pop
went in; report.css keeps a paragraph on the page of the code it leads
to (31 pages, 22 for volume 2); CLAUDE.md: where things stand, the
reading of the empty slice constant.

patch · log

5 files changed, +19 -12

CLAUDE.md modified +8 -2

@@ -69,7 +69,7 @@
6969 commented throughout, most of all where it is obscure or needs a
7070 compiler writer's knowledge; at least 400,000 lines of raz a second;
7171 the report, `doc/raz.md`, under 40 pages as `make pdf` renders it,
72- checked by hand after each milestone (30 at report 2026-10.31).
72+ checked by hand after each milestone (31 at report 2026-10.32).
7373 - Clarity comes first, before speed and size: the compiler must be a
7474 model of plain code that a beginner can follow. Every rewrite of the
7575 code it makes is explained where it is done, with the code before
@@ -90,7 +90,9 @@
9090 compiler in raz, built by itself (Self, done); the seed in `seed/` is
9191 frozen, and v0.9.1 was the last release it built. The compiler takes
9292 1.4 times the Pascal one's time; `make kernels` measures `test/bench`
93-against FPC `-O2`. Next: what the owner chooses. What
93+against FPC `-O2`. Since then, not yet released: report 2026-10.32,
94+the eighth thaw (a constant typed `[]T` may be `[]`), with `Vec.pop`
95+and `Sys.Info.links`. Next: what the owner chooses. What
9496 each version of the report changed is in `doc/report-history.md`, and
9597 what each step did is in git; don't repeat it here.
9698
@@ -225,6 +227,10 @@
225227 local slice variable or a record, stored, or come back from a call,
226228 isn't, and is left undefined (10). `ret` and `keep`, in
227229 PROPOSALS.md, would close it; the owner keeps it open for now.
230+- An empty slice constant, `const E: []T = [];` (report 2026-10.32),
231+ is 16 zero bytes in read-only data, read as an array constant is;
232+ `LEN` of it is no constant. A constant's slice part takes `[]`, and
233+ names a constant whole, of any module, by its type, not its text.
228234 - An array a call returns is a temporary of the statement (report
229235 2026-10.28, 8): a slice of it kept past the statement is undefined
230236 (10), and isn't caught.

doc/raz-lib.md (history) modified +5 -6

@@ -360,9 +360,9 @@
360360 program following links finds that one has led it back into a
361361 directory it is already in. `Info.links` is how many names the file
362362 has: more than 1 if a hard link shares it, so that writing to it
363-writes to a file named elsewhere too; 0 on a target that doesn't say. `Info.mode` holds the nine
364-bits of `rwxrwxrwx`, and `chmod` sets them, 1EDH (755) for a program,
365-1A4H (644) for data.
363+writes to a file named elsewhere too; 0 on a target that doesn't say.
364+`Info.mode` holds the nine bits of `rwxrwxrwx`, and `chmod` sets them,
365+1EDH (755) for a program, 1A4H (644) for data.
366366
367367 **Programs.** `openPty` makes a pseudo-terminal, a terminal that a
368368 program, a terminal emulator, plays the screen and the keyboard of:
@@ -637,7 +637,7 @@
637637 proc init*(v: ^Vec; a: ^Mem.Allocator);
638638 proc room*(v: ^Vec; n: INT): BOOL; (* room for n more; false if the allocator has none *)
639639 proc push*(v: ^Vec; x: T); (* x added at the end *)
640-proc pop*(v: ^Vec): (T, BOOL); (* the last element, taken off; false if empty *)
640+proc pop*(v: ^Vec): (T, BOOL); (* the last element, taken off; false if the array is empty *)
641641 proc add*(v: ^Vec): ^T; (* a new element at the end, zero, to fill in place *)
642642 proc tryPush*(v: ^Vec; x: T): BOOL; (* push; false, and v as it was, if there is no room *)
643643 proc tryAdd*(v: ^Vec): (^T, BOOL); (* add; nil and false, and v as it was, if there is no room *)
@@ -683,8 +683,7 @@
683683 long it grows. `all` gives the elements as a slice, indexed and
684684 checked as any is, and `v.len` is their number; the slice, and what
685685 `add` gives, are good until the array next grows. `pop` takes the last
686-element off, keeping the memory. `push`, `add` and
687-`resize` stop the program, as `Buf.add` does, if the allocator has no
686+element off, keeping the memory. `push`, `add` and `resize` stop the program, as `Buf.add` does, if the allocator has no
688687 room; `room` asks first: `import Lines := Vec([]U8);`. `Fmt`'s format takes the next argument at each
689688 `{}`; `{{` and `}}` stand for `{` and `}`. A `Map` hashes and
690689 compares its keys with the procedures it is given:

doc/raz.md (history) modified +1 -1

@@ -407,7 +407,7 @@
407407
408408 ```
409409 const Wide: [][2]I32 = [[1100H, 115FH], [2E80H, 303EH], [0AC00H, 0D7A3H]];
410- Count = LEN(Wide); (* 3, a constant *)
410+ Count = LEN(Wide); (* 3, a constant *)
411411 Narrow: [][2]I32 = []; (* the empty slice *)
412412 ```
413413

doc/report-history.md (history) modified +3 -3

@@ -195,6 +195,6 @@
195195 literal is `[]` is the empty slice, a value of type `[]T`, and no
196196 array; `LEN` of it is 0, not a constant. A slice part of a constant
197197 may be the empty slice, by `[]` or by such a constant's name (section
198- 4). Before, both were errors, since an array has at least one element. It breaks no
199- program. `Sys.Info` gains `links`, how many names a file has
200- (volume 2).
198+ 4). Before, both were errors, since an array has at least one
199+ element. It breaks no program. `Vec` gains `pop`, and `Sys.Info`
200+ `links`, how many names a file has (volume 2).

doc/report.css (history) modified +2 -0

@@ -9,6 +9,8 @@
99 pre, code { font-family: "DejaVu Sans Mono", monospace; font-size: 8.8pt; }
1010 /* a block of code or grammar is never split across pages */
1111 pre { background: #f6f6f3; padding: 6px 9px; border-left: 2px solid #bbb; break-inside: avoid; white-space: pre-wrap; }
12+/* and stays on the page of the paragraph that leads to it */
13+p:has(+ div.sourceCode, + pre) { break-after: avoid; }
1214 table { border-collapse: collapse; font-size: 9.5pt; }
1315 td, th { border-bottom: 1px solid #ddd; padding: 2px 8px; text-align: left; }
1416 nav#TOC { break-after: page; }