From 24062e342c4fe8c75213eaf4f464de28e888a389 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Wed, 14 Oct 2026 11:57:40 +0100 Subject: [PATCH] Report 2026-10.22: the errors the tests pin are stated; version bumped, history entry --- diff --git a/doc/raz.md b/doc/raz.md index 94339f9..cecc89b 100644 --- a/doc/raz.md +++ b/doc/raz.md @@ -13,7 +13,7 @@ This report defines the language. It is short on purpose. Whatever it doesn't allow, raz doesn't have. -This is version 2026-10.21 of the report; section 11 says where each +This is version 2026-10.22 of the report; section 11 says where each version's changes are told. 2026-10.11 and 2026-10.12 are a thaw the owner chose, for a language anyone can build again. They break programs written for 2026-10.10 and before: for 2026-10.9, say, the report of compiler @@ -50,7 +50,7 @@ A program is written in UTF-8. The compiler rejects a file that isn't valid UTF-8: a malformed or overlong sequence, a surrogate, or a code -point beyond 10FFFFH. Everything outside strings, characters and +point beyond 10FFFFH, and a file with a NUL byte. Everything outside strings, characters and comments is ASCII. Spaces, tabs and line breaks separate symbols and are otherwise ignored. @@ -81,7 +81,8 @@ all in capitals. `1.5` and `2.0E-3` are reals; a real always has a digit on both sides of its point, and its exponent, if it has one, is `E`, a sign if wanted, and digits. A decimal number above the largest -`I64`, or a hexadecimal one above the largest `U64`, is an error. +`I64`, or a hexadecimal one above the largest `U64`, is an error; so is +a real above the largest `F64`. A real below the least `F64` is 0. An integer is an untyped constant, which takes the type it is used as, up to the largest `I64`. A hexadecimal number above that, such as @@ -103,7 +104,7 @@ `"é"` is the two bytes 0C3H, 0A9H. Both characters and strings take the escapes `\n` (line feed), `\t` (tab), `\r` (carriage return), `\0` (zero), `\\`, `\'`, `\"`, `\u{H...}` (the code point with hexadecimal -value H..., in a string its UTF-8) and, in strings only, `\xHH` (the +value H..., up to 10FFFFH, in a string its UTF-8) and, in strings only, `\xHH` (the byte with hexadecimal value HH, which needn't make valid UTF-8). In an escape, the hexadecimal digits may be capitals or not. A character or a string ends on the line it starts on. @@ -759,7 +760,7 @@ | `F32` | `F64` | the same value | | `F64` | `F32` | the nearest `F32`; too big a value gives an infinity | | enumeration | integer | its position | -| integer | enumeration | the name at that position; a position out of range is a failed check (6.5) | +| integer | enumeration | the name at that position; a position out of range is a failed check (6.5), and in a constant an error | | set | integer | its bits | | integer | set | the low bits, as many as the set has | | `INT`, `UINT` | pointer, procedure | the address | @@ -960,7 +961,9 @@ program writes them. Copying a whole record or array through a volatile pointer is not allowed, since it can't be one access. -A `^VOLATILE T` doesn't convert to `^T` without a written conversion. +A `^VOLATILE T` doesn't convert to `^T` without a written conversion, +and a volatile variable isn't passed as a `var` argument, which would +lose its volatility. `FENCE` also orders the program's ordinary accesses against those of other processors and devices. @@ -1166,8 +1169,9 @@ ``` **forward.** `proc f(x: I64): I64; forward;` declares `f` so that it -can be called before its body appears; the body comes later with the -same signature, though its parameters may have other names. +can be called before its body appears; the body comes later in the +module, with the same signature, though its parameters may have other +names; a `forward` with no body is an error. A name after a procedure's `end`, if written, is the procedure's own. @@ -1323,7 +1327,11 @@ say what is wrong and make no executable. Such a rule is one whose breach would leave the program with no meaning this report can give: a mistake of types, a name that isn't declared or is declared twice, an -assignment to what is read-only, a module that imports itself. A fault +assignment to what is read-only, a call with the wrong number of +arguments, a type name or a procedure with no result used as a value, +type arguments given to a module that isn't generic, or too many, an +import that can't be found, a procedure declared `forward` and never +defined, a module that imports itself. A fault that is only a lint isn't an error: a name declared and never used, or a result that a call standing on its own drops (`Sys.write(fd, s);`, where `_ := Sys.write(fd, s);` says it is meant). A program with one is diff --git a/doc/report-history.md b/doc/report-history.md index 6284aae..563cfa2 100644 --- a/doc/report-history.md +++ b/doc/report-history.md @@ -110,3 +110,18 @@ becomes a reserved word, which breaks a program with a name `try`. - **2026-10.21.** An arm of a `match` on an enumeration may name several of its names (section 7.4). +- **2026-10.22.** Mends and trims, from an audit of the report against its + tests. What is an error is stated once (section 10), by meaning; the + words of messages, the number of them and the warnings are an + implementation's. Every stop of a running program, a nil pointer, a + division by zero, a stack overflow, a failed check, ends with status 2, + after the `Rt.atExit` procedures (section 10). Readings the compiler + had taken are in the report: `check` and `off` aren't reserved, an + untyped constant converts to a pointer as an `INT` does, a shift of an + untyped constant, which types `match` takes, `lo` above `hi`, a `defer` + in a `defer`, where an `INT` widens, a real above the largest `F64`, a + code point above 10FFFFH, a NUL byte, a volatile variable passed by + `var`, and a `forward` with no body. The core of the library is what + `conform/` tests (appendix A); the rest of the library is the standard + library. The report is in two volumes, `doc/raz.md` and `doc/raz-lib.md`, + and its history is here. diff --git a/src/Raz.raz b/src/Raz.raz index c1cb2d7..bc847bd 100644 --- a/src/Raz.raz +++ b/src/Raz.raz @@ -29,7 +29,7 @@ import Sys, Out, Version, Files, Fmt, Diag, Scan, Sym, Chunk, X64, Gen, Parse, Link, Elf; const - Report = "2026-10.21"; (* the version of doc/raz.md it follows *) + Report = "2026-10.22"; (* the version of doc/raz.md it follows *) MemfdCreate = 319; (* the system call *) MfdCloexec = 1; (* an ELF still executes: the kernel opens it first *) Execve = 59;