raz / commit b847cb77

commit
b847cb7770d807c5d133b5ed17fede86d5ac5624
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
ce8052e0
Docs: the library's whole interface; this compiler's choices

The report's section 11 gives every library module's exports, as
tools/Doc.raz prints them, in place of deltas; Sys's core procs added,
a repeated paragraph dropped. Exported vars: a slice in one may be
sliced. Min div -1 in a const is an error. INT widening in several
results said right. Which reports the thaw breaks.

compiler.md: OneStatement; a new section, "This compiler's choices".
README: true sizes, code procs in assembly.

patch · log

3 files changed, +253 -66

README.md (history) modified +6 -5

@@ -24,7 +24,7 @@
2424 $ examples/Hello
2525 hello, world
2626
27-The compiler is about 6,000 lines of Free Pascal: one pass, no
27+The compiler is about 7,600 lines of Free Pascal: one pass, no
2828 intermediate form, no optimizer. It writes x86-64 machine code and the
2929 ELF executable itself, with no assembler or linker, and compiles about
3030 a million lines a second.
@@ -133,10 +133,10 @@
133133 arguments, `Map(K, V; hash, eq)`.
134134 - Every variable starts at zero, and behaviour is defined everywhere
135135 but through pointers.
136-- `extern` procedures and variables from C; code procedures written as
137- bytes of machine code; `SYSCALL`.
136+- `extern` procedures and variables from C; code procedures written in
137+ the target's assembly language; `SYSCALL`.
138138
139-The report, `doc/raz.md`, says all of it in about 1,000 lines.
139+The report, `doc/raz.md`, says all of it in about 2,000 lines.
140140
141141 ## The library
142142
@@ -144,7 +144,8 @@
144144 (buffered output), `C`, `Lock`, `Thread` (threads without C), `Mem`,
145145 `Heap`, `Arena`, `Str`, `Buf`, `Fmt`, `Math`, `Files`, `Opt` (a command
146146 line read through one table), `List(T)`, `Map(K, V; hash, eq)` and
147-`Sort(T; less)`. `tools/Doc.raz` prints any of them:
147+`Sort(T; less)`. Section 11 of the report gives each one's interface,
148+and `tools/Doc.raz` prints it from the module's file:
148149
149150 $ ./raz -o Doc tools/Doc.raz && ./Doc lib/Str.raz
150151

doc/compiler.md (history) modified +64 -1

@@ -566,6 +566,69 @@
566566 rest of raz's `argv`. Nothing is left on disk, and the program's
567567 status is the command's.
568568
569+## This compiler's choices
570+
571+What the report's appendix A leaves to an implementation, and what
572+this one does.
573+
574+- **The target.** x86-64 Linux, `linux-x86_64`: `INT` is 64 bits, and
575+ there are reals. Every module of a program is compiled together, in
576+ one run, into a static ELF executable, or a dynamic one if the
577+ program uses C; no object files.
578+- **Finding modules.** `raz Main.raz` looks for `X`, imported, in
579+ `Main.raz`'s directory, then in each `-I dir` in the order given
580+ (16 at most), then in `lib` beside the `raz` executable, following
581+ a link to it (`make install` puts `raz` and `lib/` together in
582+ `PREFIX/lib/raz`). In each directory it tries `X.linux-x86_64.raz`,
583+ `X.linux.raz`, `X.x86_64.raz` and `X.raz`, in that order, and takes
584+ the first found (`ModuleFile`, `parse.pas`).
585+- **Errors.** Every error in a run is reported, up to 20 (`MaxErrors`,
586+ `diag.pas`); then the compiler stops. Two errors at the same place
587+ are told as one. Any error is status 1.
588+- **Warnings.** Of a declaration never used, or a variable only
589+ assigned (`Warn`, `parse.pas`): not of what is exported, a name that
590+ starts with `_`, an enumeration's names or a generic module's
591+ parameters. A procedure naming itself doesn't use it; a type named by
592+ a pointer in its own declaration does. Assigning a variable whole
593+ (`x :=`, `a, b :=`) doesn't read it; anything else does. Warnings
594+ come only for a module with no errors, and a generic module's only
595+ for its first instance. `-Werror` makes each an error.
596+- **Several results** come back through a hidden pointer to the
597+ caller's slots; a code procedure returns two in rax and rdx.
598+- **Reals.** A real constant is held as an F64. An `F32` in a register
599+ is its low 32 bits; the upper ones are left as they fall.
600+- **How a failure is caught.** A division by zero, a stack overflow
601+ (the guard page under the stack), a call to `nil` and a load or
602+ store within 4 KB of address 0 are caught by the machine, as
603+ signals; a field of a `nil` pointer further on is tested for in the
604+ code. The smallest value of a signed type divided by -1 faults as the
605+ machine does for 64 bits; for a narrower type the code makes it
606+ fault.
607+- **Run-time failures.** A failed check says on standard error what
608+ failed and with what values, at the place of the offending
609+ expression, then the calls under way and their variables, and ends
610+ the program by `Rt.exit` with status 2; `Rt.stop` says its message
611+ and ends it the same way. A signal
612+ is told at the place of the statement it stopped in, or of the
613+ procedure for a stack overflow in its prologue, and then ends the
614+ program, so its status is the signal's. The handlers run on a stack
615+ of their own: `Rt`'s for the main thread, one in each `Thread`
616+ thread's mapping. C's threads have none, so a stack overflow in one
617+ ends the program by the signal with no message.
618+- **Locks.** `Heap` and `Out` lock with `Lock`, a spinlock that yields,
619+ since they serve C's threads and `Thread`'s alike; `Thread.Mutex` is
620+ a futex.
621+- **C.** A program uses C if a module it uses has an `extern` or a
622+ `link` of a library. C's symbols are reached through quadwords the
623+ loader fills in (GLOB_DAT), with no PLT; the executable exports
624+ nothing. Its entry point stores C's `exit` in `Rt.cExit` before any
625+ module body runs.
626+- **Frames.** A deferred statement's slots stay reserved for the rest
627+ of its procedure. A generic instance first used in a procedure, or in
628+ a module's body, is made before that code begins (`InstancesFor`).
629+- **The executable** carries DWARF line numbers and the names of
630+ procedures for gdb, and `Rt`'s own table of places (`Rt.places`).
631+
569632 ## Where to start changing it
570633
571634 - **A built-in procedure:** an entry in `sym.pas`'s universe, a case in
@@ -576,7 +639,7 @@
576639 - **A machine:** a new `gen.pas`, answering the same calls, and an
577640 encoder and assembler for it in place of `x64.pas`.
578641 - **A statement:** a reserved word in `scan.pas` (in `TSym` and `Words`,
579- in the same order), a case in `Statement`, and a routine beside the
642+ in the same order), a case in `OneStatement`, and a routine beside the
580643 others.
581644 - **A check that fails:** `Check` in `gen.pas`, and the message in
582645 `lib/Rt.raz`'s `fail`; a reason a signal gives, `onSignal` there.

doc/raz.md (history) modified +183 -60

@@ -10,8 +10,11 @@
1010 doesn't allow, raz doesn't have.
1111
1212 This is version 2026-10.13 of the report; section 12 says what each
13-version changed. It is a thaw the owner chose, for a language anyone
14-can build again, and it breaks programs written for 2026-10.10.
13+version changed. 2026-10.11 and 2026-10.12 are a thaw the owner chose,
14+for a language anyone can build again. They break programs written
15+for 2026-10.10 and before: for 2026-10.9, say, the report of compiler
16+0.5.0, the last release before them; and 2026-10.12 breaks code
17+procedures written for 2026-10.11.
1518
1619 The language is frozen, softly, from this version on: it changes only
1720 to mend a defect, and its library grows only by what breaks no program
@@ -138,8 +141,10 @@
138141 not a variable: nothing that could write it, or let something else
139142 write it, may name it or a field or element of it. So it can't be
140143 assigned, passed as a `var` argument, changed by `INC`, `DEC` or
141-`NEW`, given to `ADR`, sliced, or used where a slice is expected (the
142-silent conversion of an array, section 5.10); in `match`, its arms'
144+`NEW`, or given to `ADR`; an array in it can't be sliced, or used
145+where a slice is expected (the silent conversion of an array, section
146+5.10), though a slice in it may be sliced, since that makes a new
147+slice and can't change the variable; in `match`, its arms'
143148 names stand for the fields of a copy. It can be read, copied and
144149 compared, and a copy is the importer's own. What a pointer or a slice
145150 in it points at is another variable, and isn't held to this: with
@@ -294,7 +299,8 @@
294299 of arrays and strings. A constant is an integer, a real, a `BOOL`, a
295300 name of an enumeration, a set, a string, an array or an `ERROR`. A constant of an integer type wraps as the
296301 program would: `U8(250) + 10` is 4. Dividing by zero in a constant is
297-an error. A string constant can be indexed and sliced as an array of
302+an error, and so is dividing the smallest value of a signed type by -1,
303+with `div` or `mod`, which stops a program (section 6.1). A string constant can be indexed and sliced as an array of
298304 `U8` is, and its `LEN` is its length in bytes. `+` joins two string
299305 constants into one:
300306
@@ -556,8 +562,9 @@
556562 Nothing else converts silently. In particular, there is no other
557563 conversion between integer types, between integers and reals, or
558564 between `F32` and `F64`, without a written conversion (section 6.7).
559-Several results, and `return f(x)`, need the same types exactly: an
560-`INT` result doesn't pass up as an `I64`.
565+Results passed on whole need the same types exactly: in `a, b :=
566+f(x)` and in `return f(x)`, an `INT` result doesn't pass up as an
567+`I64`. Elsewhere, `return n, n` included, an `INT` widens as above.
561568
562569 ## 6. Expressions
563570
@@ -1208,15 +1215,114 @@
12081215 target is an `I64`: a file's size and position, a time in nanoseconds,
12091216 and a number read from text.
12101217
1218+What follows is each module's interface, as `tools/Doc.raz` prints it
1219+from the module's file; `...` stands for fields that are the module's
1220+own. A module's `main`, where it has one, is its test, and is left
1221+out here.
1222+
12111223 ```
1224+module Rt;
1225+const Full*: ERROR = "too many procedures to run at exit";
1226+proc atExit*(p: proc): ERROR; (* p run when the program ends by exit *)
1227+proc exit*(status: INT); (* the atExit procedures, the last first, then the end *)
1228+proc stop*(msg: []U8); (* msg on standard error, then exit with status 2 *)
1229+proc trace*; (* the calls under way, and their variables, on standard error *)
1230+```
1231+
1232+`Rt` also holds what the compiler's checks call when they fail, and
1233+the handlers of the signals that stop a program (section 10). `exit`
1234+takes each procedure off the list before it runs it, so it runs once
1235+even if it fails or calls `exit` itself; in a program that uses C, it
1236+ends through C's `exit`, so that C flushes its buffers too.
1237+
1238+```
12121239 module Mem;
12131240 type
12141241 Allocator* = record
1215- alloc*: proc(a: ^Allocator; size, align: INT): ^U8;
1242+ alloc*: proc(a: ^Allocator; size, align: INT): ^U8; (* nil if out of room *)
12161243 free*: proc(a: ^Allocator; p: ^U8);
12171244 end;
1218-...
1219-end Mem.
1245+const Page* = 4096;
1246+proc pages*(size: INT): ^U8; (* size bytes, in whole pages, zeroed; or nil *)
1247+proc unmap*(p: ^U8; size: INT); (* pages given back *)
1248+proc alloc*(a: ^Allocator; size, align: INT): ^U8; (* a^.alloc(a, size, align) *)
1249+proc free*(a: ^Allocator; p: ^U8); (* a^.free(a, p) *)
1250+
1251+module Heap;
1252+var heap*: ^Mem.Allocator;
1253+
1254+module Arena;
1255+type Arena* = record
1256+ base*: Mem.Allocator; (* first, so that ^Arena(a) finds the rest *)
1257+ ...
1258+end;
1259+proc init*(ar: ^Arena; size: INT): BOOL; (* an arena of size bytes; false if the system has none *)
1260+proc reset*(ar: ^Arena); (* every allocation forgotten; the memory used again *)
1261+proc done*(ar: ^Arena); (* its memory given back *)
1262+```
1263+
1264+`NEW(p, a)` calls `a^.alloc`. `Heap` keeps blocks of nine sizes, from
1265+16 to 4096 bytes with their header, each with a list of the free ones;
1266+a bigger block gets pages of its own. An arena hands out memory from
1267+one block: its `free` does nothing, and `reset` forgets everything.
1268+
1269+```
1270+module Lock;
1271+type Lock* = record ... end;
1272+proc take*(l: ^Lock);
1273+proc give*(l: ^Lock);
1274+
1275+module Thread;
1276+const Failed*: ERROR = "can't start a thread";
1277+type
1278+ Thread* = record ... end;
1279+ Mutex* = record ... end; (* zero is free *)
1280+proc spawn*(p: proc(arg: ^U8); arg: ^U8): (^Thread, ERROR); (* p(arg) in a new thread *)
1281+proc join*(t: ^Thread); (* waits for t to end, then frees its stack *)
1282+proc lock*(m: ^Mutex);
1283+proc unlock*(m: ^Mutex);
1284+```
1285+
1286+A `Lock` is for short sections: a thread that finds it taken tries
1287+again, giving up the processor now and then. A `Mutex` sleeps. Each of
1288+`Thread`'s threads runs on a stack of its own, with a page below it
1289+that can't be touched, so that running off the stack stops the program.
1290+A program that uses C makes its threads with C's `pthread_create`, and
1291+so can't use `Thread`.
1292+
1293+```
1294+module Out;
1295+proc str*(s: []U8);
1296+proc char*(c: U8);
1297+proc ln*; (* a line feed *)
1298+proc int*(n: I64); (* n in decimal *)
1299+proc hex*(n: U64; digits: INT); (* n in hexadecimal, digits digits at least *)
1300+proc flush*;
1301+```
1302+
1303+**Out and C's stdio.** `Out` keeps a buffer of `Sys.outSize` bytes,
1304+4 KB on Linux. It writes it out
1305+when it is full, at each line feed when standard output is a terminal,
1306+at `Out.flush`, and when the program ends by `Rt.exit`. A lock keeps
1307+what each call writes together when threads write at once. C's `stdio`
1308+keeps a buffer of its own for the same standard output. A program that
1309+writes with both flushes one before writing with the other, or the
1310+text comes out of order:
1311+
1312+```
1313+module Both;
1314+import Out, C; (* C: printf, fflush and C's FILE *stdout *)
1315+
1316+proc main*;
1317+begin
1318+ Out.str("from raz\n");
1319+ Out.flush;
1320+ C.printf("from C\n");
1321+ C.fflush(C.stdout);
1322+ Out.str("from raz again\n");
1323+end;
1324+
1325+end Both.
12201326 ```
12211327
12221328 **Sys** gives every target the same procedures, so that a program
@@ -1225,6 +1331,7 @@
12251331 number, minus an errno, as on Linux; 0 is success.
12261332
12271333 ```
1334+module Sys;
12281335 const
12291336 stdin* = 0; stdout* = 1; stderr* = 2;
12301337 outSize* = 4096; (* the bytes Out keeps; each target has its own *)
@@ -1258,10 +1365,18 @@
12581365 end;
12591366 Status* = (running, exited, killed, stopped);
12601367
1368+proc write*(fd: INT; s: []U8): INT; (* the bytes written *)
1369+proc read*(fd: INT; buf: []U8): INT; (* the bytes read; 0 at the end *)
12611370 proc open*(path: []U8; how: Accesses): INT; (* its fd *)
12621371 proc openRead*(path: []U8): INT; (* open(path, {reading}) *)
12631372 proc create*(path: []U8): INT; (* open(path, {writing, creating, truncating}) *)
12641373 proc seek*(fd: INT; pos: I64; fromEnd: BOOL): I64; (* the new position *)
1374+proc close*(fd: INT);
1375+proc isTerminal*(fd: INT): BOOL;
1376+proc mmap*(size: INT): ^U8; (* size bytes of zeroed memory, in whole pages; or nil *)
1377+proc munmap*(p: ^U8; size: INT);
1378+proc yield*; (* the processor given to another thread *)
1379+proc exit*(status: INT); (* the program ended at once, without Rt's atExit *)
12651380
12661381 proc rename*(old, new: []U8): INT; (* replaces what new names *)
12671382 proc remove*(path: []U8): INT; (* a file, not a directory *)
@@ -1279,7 +1394,7 @@
12791394 proc rawMode*(fd: INT): BOOL; (* the terminal on fd: no echo, no lines, no signals *)
12801395 proc restoreMode*(fd: INT); (* as rawMode found it *)
12811396 proc termSize*(fd: INT): (INT, INT); (* columns and rows; 80 and 24 if unknown *)
1282-proc ready*(fd: INT; ms: INT): BOOL; (* something to read within ms, or ever if ms < 0 *)
1397+proc ready*(fd, ms: INT): BOOL; (* something to read within ms, or ever if ms < 0 *)
12831398 proc readyOf*(fds: []INT; ms: INT): INT; (* the first of fds with something to read within ms, or -1 *)
12841399 proc readyFor*(reads, writes: []INT; ms: INT): INT; (* readyOf, and the first of writes with room to write *)
12851400 proc setBlocking*(fd: INT; yes: BOOL): INT; (* if not yes, a read or write that would wait is -11 at once *)
@@ -1330,19 +1445,6 @@
13301445 CR to NL; and with output, NL to CR NL. A program that turns it on
13311446 restores it before it ends: `Rt.atExit` is the place.
13321447
1333-`connect` is for talking to a server on the same machine, an X server
1334-at `/tmp/.X11-unix/X0` say; what it receives comes by `read`, what it
1335-sends goes by `send`, and `close` ends it. `send` is `write` for a
1336-socket, except when the other end has closed it: `write` would stop
1337-the program with the signal SIGPIPE, where `send` returns -32
1338-(EPIPE), so that a program learns its server has gone and can end as
1339-it wants. `readyOf` waits on several file
1340-descriptors at once, as a program does that listens to a server and a
1341-terminal both; a descriptor at its end, or failed, counts as ready,
1342-since a read of it won't wait. It looks at the first 64 of `fds`, and
1343-`connect` takes a path of at most 107 bytes, as `struct sockaddr_un`
1344-holds; a longer one is -36 (ENAMETOOLONG).
1345-
13461448 **Files.** `open` gives a file for what `how` asks: `reading`,
13471449 `writing` or both; `creating` it if it is missing, readable by all and
13481450 writable by its owner; with `exclusive`, failing with -17 (EEXIST) if
@@ -1442,10 +1544,15 @@
14421544 write on any of `writes`. A descriptor in both is given once, when it
14431545 is ready for either; the 64 it looks at are `reads`, then `writes`.
14441546
1445-**Str, Map, Sort, Math and Fmt** gain these:
1547+**Strings, buffers and collections.**
14461548
14471549 ```
14481550 module Str;
1551+proc cmp*(a, b: []U8): INT; (* -1, 0 or 1 as a sorts before, with or after b, byte by byte *)
1552+proc eq*(a, b: []U8): BOOL;
1553+proc hash*(s: []U8): U64; (* FNV-1a, 64 bits *)
1554+proc find*(s, sub: []U8): INT; (* where sub first starts in s, or -1 *)
1555+proc hasPrefix*(s, p: []U8): BOOL;
14491556 proc encode*(c: I32): ([4]U8, INT); (* c in UTF-8: its bytes, and how many *)
14501557 proc decode*(s: []U8): (I32, INT); (* the character s starts with, and its length in bytes *)
14511558 proc toInt*(s: []U8): (I64, BOOL); (* s, in decimal; false if it isn't a number an I64 holds *)
@@ -1454,8 +1561,45 @@
14541561 proc putLE*(s: []U8; v: U64); (* v into s, the lowest byte first *)
14551562 proc putBE*(s: []U8; v: U64); (* v into s, the highest byte first *)
14561563
1564+module Buf;
1565+type Buf* = record len*: INT; ... end;
1566+proc init*(b: ^Buf; a: ^Mem.Allocator);
1567+proc room*(b: ^Buf; n: INT): BOOL; (* room for n more bytes; false if the allocator has none *)
1568+proc add*(b: ^Buf; c: U8);
1569+proc str*(b: ^Buf; s: []U8);
1570+proc bytes*(b: ^Buf): []U8; (* what it holds, until it next grows *)
1571+proc reset*(b: ^Buf); (* emptied, its memory kept *)
1572+proc done*(b: ^Buf); (* its memory given back *)
1573+
1574+module Fmt;
1575+type Arg* = variant
1576+ int(i: I64);
1577+ uint(u: U64);
1578+ hex(h: U64);
1579+ str(s: []U8);
1580+ char(c: U8);
1581+ bool(b: BOOL);
1582+ real(r: F64; places: INT);
1583+end;
1584+proc print*(f: []U8; args: []Arg); (* to standard output *)
1585+proc write*(b: ^Buf.Buf; f: []U8; args: []Arg); (* added to b *)
1586+
1587+module List(T);
1588+type
1589+ Node* = record next*: ^Node; val*: T; end;
1590+ List* = record head*: ^Node; len*: INT; ... end;
1591+proc init*(l: ^List; a: ^Mem.Allocator);
1592+proc push*(l: ^List; v: T): BOOL; (* v at the front; false if the allocator has no room *)
1593+proc pop*(l: ^List): (T, BOOL); (* the front value, taken off; false if the list is empty *)
1594+proc reverse*(l: ^List);
1595+proc clear*(l: ^List);
1596+
14571597 module Map(K, V; hash: proc(k: K): U64; eq: proc(a, b: K): BOOL);
1598+type Map* = record len*: INT; ... end;
1599+proc init*(m: ^Map; a: ^Mem.Allocator);
1600+proc put*(m: ^Map; k: K; v: V): BOOL; (* k now maps to v; false if there was no room *)
14581601 proc remove*(m: ^Map; k: K): BOOL; (* false if k wasn't there *)
1602+proc get*(m: ^Map; k: K): (V, BOOL); (* what k maps to, and whether it maps to anything *)
14591603 proc next*(m: ^Map; i: INT): (INT, K, V); (* the entry after i *)
14601604
14611605 module Sort(T; less: proc(a, b: T): BOOL);
@@ -1465,16 +1609,19 @@
14651609 const pi* = 3.141592653589793;
14661610 proc sqrt*(x: F64): F64;
14671611 proc floor*(x: F64): F64;
1468-proc sin*(x: F64): F64;
1469-proc cos*(x: F64): F64;
1470-proc atan2*(y, x: F64): F64;
14711612 proc exp*(x: F64): F64;
14721613 proc ln*(x: F64): F64;
1473-
1474-module Fmt;
1475-type Arg* = variant ... real(r: F64; places: INT); end;
1614+proc sin*(x: F64): F64;
1615+proc cos*(x: F64): F64;
1616+proc atan2*(y, x: F64): F64; (* the angle of (x, y) from the x axis, from -pi to pi *)
14761617 ```
14771618
1619+A `Buf`, a `List` and a `Map` take their memory from the allocator
1620+`init` gives them. `Fmt`'s format takes the next argument at each
1621+`{}`; `{{` and `}}` stand for `{` and `}`. A `Map` hashes and
1622+compares its keys with the procedures it is given:
1623+`import Count := Map([]U8, INT, Str.hash, Str.eq);`.
1624+
14781625 `Str` reads and writes UTF-8. `encode` writes a character, of at most
14791626 10FFFFH, in one to four bytes; a number that isn't one becomes FFFDH,
14801627 the character that stands for a wrong one. `decode` reads the first
@@ -1641,30 +1788,6 @@
16411788 name with `=` in it, a letter `-`, and `-h` or `--help` in the table,
16421789 since they are `Opt`'s.
16431790
1644-**Out and C's stdio.** `Out` keeps a buffer of `Sys.outSize` bytes,
1645-4 KB on Linux. It writes it out
1646-when it is full, at each line feed when standard output is a terminal,
1647-at `Out.flush`, and when the program ends by `Rt.exit`. C's `stdio`
1648-keeps a buffer of its own for the same standard output. A program that
1649-writes with both flushes one before writing with the other, or the
1650-text comes out of order:
1651-
1652-```
1653-module Both;
1654-import Out, C; (* C: printf, fflush and C's FILE *stdout *)
1655-
1656-proc main*;
1657-begin
1658- Out.str("from raz\n");
1659- Out.flush;
1660- C.printf("from C\n");
1661- C.fflush(C.stdout);
1662- Out.str("from raz again\n");
1663-end;
1664-
1665-end Both.
1666-```
1667-
16681791 ## 12. Versions
16691792
16701793 A version of this report is named by the month it was made in and a
@@ -1731,8 +1854,8 @@
17311854 Pointers, procedures, `ERROR`s, slices and variants' tags are sized
17321855 by the address, and basic types aligned as the target's C aligns
17331856 them (section 5). Reals are a target's to have or not (section
1734- 5.1). An exported variable can't be changed, passed by `var`,
1735- addressed or sliced outside its module (section 3). `check off;`
1857+ 5.1). An exported variable can't be changed, passed by `var` or
1858+ addressed outside its module, nor an array in it sliced (section 3). `check off;`
17361859 leaves a module's index and slice checks out (sections 3, 6.4 and
17371860 6.5). An index of any integer type is checked by its value (6.5). A
17381861 shift counts modulo its operand's width, and the smallest value of
@@ -1761,9 +1884,9 @@
17611884
17621885 Everything in this report binds every implementation of raz, except
17631886 what follows, which each chooses for itself and documents. This
1764-compiler's choices are in `doc/compiler.md`. The programs in
1765-`conform/` are how an implementation shows that it follows this
1766-report: it passes them all, its reals aside where its target has none;
1887+compiler's choices are in `doc/compiler.md`, under "This compiler's
1888+choices". The programs in `conform/` are how an implementation shows
1889+that it follows this report: it passes them all, its reals aside where its target has none;
17671890 `conform/check.sh` runs them.
17681891
17691892 - **The target.** Which machines and systems it compiles for, and the