raz / commit 24062e34

commit
24062e342c4fe8c75213eaf4f464de28e888a389
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
7e721e08
Report 2026-10.22: the errors the tests pin are stated; version bumped, history entry

patch · log

3 files changed, +33 -10

doc/raz.md (history) modified +17 -9

@@ -13,7 +13,7 @@
1313 This report defines the language. It is short on purpose. Whatever it
1414 doesn't allow, raz doesn't have.
1515
16-This is version 2026-10.21 of the report; section 11 says where each
16+This is version 2026-10.22 of the report; section 11 says where each
1717 version's changes are told. 2026-10.11 and 2026-10.12 are a thaw the owner chose,
1818 for a language anyone can build again. They break programs written
1919 for 2026-10.10 and before: for 2026-10.9, say, the report of compiler
@@ -50,7 +50,7 @@
5050
5151 A program is written in UTF-8. The compiler rejects a file that isn't
5252 valid UTF-8: a malformed or overlong sequence, a surrogate, or a code
53-point beyond 10FFFFH. Everything outside strings, characters and
53+point beyond 10FFFFH, and a file with a NUL byte. Everything outside strings, characters and
5454 comments is ASCII. Spaces, tabs and line breaks separate symbols and
5555 are otherwise ignored.
5656
@@ -81,7 +81,8 @@
8181 all in capitals. `1.5` and `2.0E-3` are reals; a real always has a
8282 digit on both sides of its point, and its exponent, if it has one, is
8383 `E`, a sign if wanted, and digits. A decimal number above the largest
84-`I64`, or a hexadecimal one above the largest `U64`, is an error.
84+`I64`, or a hexadecimal one above the largest `U64`, is an error; so is
85+a real above the largest `F64`. A real below the least `F64` is 0.
8586
8687 An integer is an untyped constant, which takes the type it is used as,
8788 up to the largest `I64`. A hexadecimal number above that, such as
@@ -103,7 +104,7 @@
103104 `"é"` is the two bytes 0C3H, 0A9H. Both characters and strings take the
104105 escapes `\n` (line feed), `\t` (tab), `\r` (carriage return), `\0`
105106 (zero), `\\`, `\'`, `\"`, `\u{H...}` (the code point with hexadecimal
106-value H..., in a string its UTF-8) and, in strings only, `\xHH` (the
107+value H..., up to 10FFFFH, in a string its UTF-8) and, in strings only, `\xHH` (the
107108 byte with hexadecimal value HH, which needn't make valid UTF-8). In
108109 an escape, the hexadecimal digits may be capitals or not. A character
109110 or a string ends on the line it starts on.
@@ -759,7 +760,7 @@
759760 | `F32` | `F64` | the same value |
760761 | `F64` | `F32` | the nearest `F32`; too big a value gives an infinity |
761762 | enumeration | integer | its position |
762-| integer | enumeration | the name at that position; a position out of range is a failed check (6.5) |
763+| integer | enumeration | the name at that position; a position out of range is a failed check (6.5), and in a constant an error |
763764 | set | integer | its bits |
764765 | integer | set | the low bits, as many as the set has |
765766 | `INT`, `UINT` | pointer, procedure | the address |
@@ -960,7 +961,9 @@
960961 program writes them. Copying a whole record or array through a
961962 volatile pointer is not allowed, since it can't be one access.
962963
963-A `^VOLATILE T` doesn't convert to `^T` without a written conversion.
964+A `^VOLATILE T` doesn't convert to `^T` without a written conversion,
965+and a volatile variable isn't passed as a `var` argument, which would
966+lose its volatility.
964967
965968 `FENCE` also orders the program's ordinary accesses against those of
966969 other processors and devices.
@@ -1166,8 +1169,9 @@
11661169 ```
11671170
11681171 **forward.** `proc f(x: I64): I64; forward;` declares `f` so that it
1169-can be called before its body appears; the body comes later with the
1170-same signature, though its parameters may have other names.
1172+can be called before its body appears; the body comes later in the
1173+module, with the same signature, though its parameters may have other
1174+names; a `forward` with no body is an error.
11711175
11721176 A name after a procedure's `end`, if written, is the procedure's own.
11731177
@@ -1323,7 +1327,11 @@
13231327 say what is wrong and make no executable. Such a rule is one whose
13241328 breach would leave the program with no meaning this report can give: a
13251329 mistake of types, a name that isn't declared or is declared twice, an
1326-assignment to what is read-only, a module that imports itself. A fault
1330+assignment to what is read-only, a call with the wrong number of
1331+arguments, a type name or a procedure with no result used as a value,
1332+type arguments given to a module that isn't generic, or too many, an
1333+import that can't be found, a procedure declared `forward` and never
1334+defined, a module that imports itself. A fault
13271335 that is only a lint isn't an error: a name declared and never used, or
13281336 a result that a call standing on its own drops (`Sys.write(fd, s);`,
13291337 where `_ := Sys.write(fd, s);` says it is meant). A program with one is

doc/report-history.md (history) modified +15 -0

@@ -110,3 +110,18 @@
110110 becomes a reserved word, which breaks a program with a name `try`.
111111 - **2026-10.21.** An arm of a `match` on an enumeration may name
112112 several of its names (section 7.4).
113+- **2026-10.22.** Mends and trims, from an audit of the report against its
114+ tests. What is an error is stated once (section 10), by meaning; the
115+ words of messages, the number of them and the warnings are an
116+ implementation's. Every stop of a running program, a nil pointer, a
117+ division by zero, a stack overflow, a failed check, ends with status 2,
118+ after the `Rt.atExit` procedures (section 10). Readings the compiler
119+ had taken are in the report: `check` and `off` aren't reserved, an
120+ untyped constant converts to a pointer as an `INT` does, a shift of an
121+ untyped constant, which types `match` takes, `lo` above `hi`, a `defer`
122+ in a `defer`, where an `INT` widens, a real above the largest `F64`, a
123+ code point above 10FFFFH, a NUL byte, a volatile variable passed by
124+ `var`, and a `forward` with no body. The core of the library is what
125+ `conform/` tests (appendix A); the rest of the library is the standard
126+ library. The report is in two volumes, `doc/raz.md` and `doc/raz-lib.md`,
127+ and its history is here.

src/Raz.raz (history) modified +1 -1

@@ -29,7 +29,7 @@
2929 import Sys, Out, Version, Files, Fmt, Diag, Scan, Sym, Chunk, X64, Gen, Parse, Link, Elf;
3030
3131 const
32- Report = "2026-10.21"; (* the version of doc/raz.md it follows *)
32+ Report = "2026-10.22"; (* the version of doc/raz.md it follows *)
3333 MemfdCreate = 319; (* the system call *)
3434 MfdCloexec = 1; (* an ELF still executes: the kernel opens it first *)
3535 Execve = 59;