From bbb1bf35d2d4a5d95410680f7c49760f4c0fd034 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Mon, 12 Oct 2026 10:19:17 +0100 Subject: [PATCH] Step 10: v0.6.0 The compiler follows report 2026-10.12; the report drops its note that it lags. doc/compiler.md's table and prose for the eleven units, the listing and the trap report; README's -S, trap report, profiler and versions; CLAUDE.md and PLAN.md say v0.6.0 is done, steps 5 to 10 awaiting review together. 7,632 lines of code; bench 931k lines/s. --- diff --git a/CLAUDE.md b/CLAUDE.md index cbefd12..f47e5b8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -85,9 +85,10 @@ **The freeze.** Since v0.5.0 the language changes only to mend a defect, and the library grows only by what breaks no program written for it. A wish for more, the owner's or yours, goes on the list in -`PLAN.md`, for a later thaw; it isn't built. v0.6.0 is such a thaw, -by the owner's word: report 2026-10.11, approved, which the compiler -is being brought to follow (`PLAN.md`). Keep +`PLAN.md`, for a later thaw; it isn't built. v0.6.0 was such a thaw, +by the owner's word: report 2026-10.12, which the compiler follows, +its parser reaching the machine only through `gen.pas` (`PLAN.md`; +its steps 5 to 10 await the owner's review). Keep `doc/compiler.md`'s table of lines and its routine names true when the compiler changes. @@ -98,7 +99,7 @@ `.github/workflows/ci.yml`, which checks it and makes the GitHub release with a tarball of `raz` and `lib/`; it also checks every push to `main`. `README.md`'s "Versions" gives the commands. v0.3.0 is -the first; v0.5.0, report 2026-10.9, the latest. +the first; v0.6.0, report 2026-10.12, the latest. `test/libc` runs its programs over `lib/Sys.raz`, the C one, through a link in its `mods`. A test or example without `.expect` is only diff --git a/PLAN.md b/PLAN.md index 3bd2580..7fcd9d0 100644 --- a/PLAN.md +++ b/PLAN.md @@ -64,11 +64,12 @@ `doc/compiler.md`'s table, the report's version and the compiler's; tag `v0.5.0`. -## Proposed, v0.6.0: raz to be rebuilt by anyone +## v0.6.0: raz to be rebuilt by anyone -Under way: steps 1 to 4 are done, step 3 set aside since. The owner -has agreed the rest, to step 10, to be done without stopping. The freeze -doesn't hold for this work, by the owner's word. +Done, and tagged `v0.6.0`: report 2026-10.12, step 3 set aside. The +owner agreed steps 5 to 10 to be done without stopping, so they wait +for review together. The freeze didn't hold for this work, by the +owner's word. **For:** a language a person alone can implement again, from the report, on any machine, in weeks; programs that run on small machines @@ -159,7 +160,7 @@ - [x] 9e. A profiler in `Rt`: a program run with `RAZ_PROFILE` set samples where it is, and at its end says which procedures and lines took the time. -- [ ] 10. `doc/compiler.md`, README, the report's version and the +- [x] 10. `doc/compiler.md`, README, the report's version and the compiler's; tag `v0.6.0`. The budget, by the owner's word: a soft limit of 8,000 lines of code, diff --git a/README.md b/README.md index c5ef181..685a590 100644 --- a/README.md +++ b/README.md @@ -175,16 +175,16 @@ The compiler says its own version and that of the report it follows: $ ./raz --version - raz 0.5.0, report 2026-10.9 + raz 0.6.0, report 2026-10.12 The compiler's version is git's name for the commit it was built from: -`0.5.0` at the tag `v0.5.0`, `0.5.0-5-g38d29a8` five commits past it. +`0.6.0` at the tag `v0.6.0`, `0.6.0-5-g38d29a8` five commits past it. To release, check `main` and tag it; the tag's message is what `raz --version` will print: $ make check - $ git tag -a v0.5.1 -m 'raz 0.5.1, report 2026-10.9' - $ git push origin v0.5.1 + $ git tag -a v0.6.1 -m 'raz 0.6.1, report 2026-10.12' + $ git push origin v0.6.1 GitHub then builds and checks the tag, and makes a release of it with a tarball of `raz` and its `lib/`. A tag pushed before the workflow @@ -195,7 +195,8 @@ Since v0.5.0 the language is frozen, softly: it changes only to mend a defect, and the library grows only by what breaks no program. Wishes -wait on a list in `PLAN.md`, for a later thaw. +wait on a list in `PLAN.md`, for a later thaw; v0.6.0 was one, for a +language anyone can build again from its report. ## Not here diff --git a/doc/compiler.md b/doc/compiler.md index 6c01756..e508ddd 100644 --- a/doc/compiler.md +++ b/doc/compiler.md @@ -1,6 +1,6 @@ # Reading the raz compiler -The compiler is eleven files of Free Pascal, some 7,000 lines of code. +The compiler is eleven files of Free Pascal, under 7,700 lines of code. This guide walks through them in the order they are best read: from the characters of a source file to the bytes of an executable. It assumes you know the language from `doc/raz.md`, and enough x86-64 to read a @@ -92,7 +92,8 @@ end; ``` -comes out as this (from `objdump -d -M intel`): +comes out as this (from `objdump -d -M intel`; `raz -S` shows the same +under each line of source, named by the compiler as it made them): ``` push rbp ; EnterBody: the frame @@ -499,21 +500,23 @@ line, column and file; and for the trap report, each live procedure's address range and name, and its variables, which `Body` (`parse.pas`) notes with `NoteVar`: each one's name, its place in the frame and how -`Rt` shows it (`VarKind`). `Rt` reads them, through `Rt.places`, which the -entry point sets, to say where a failed check or a signal was: the -place with the highest address up to the one it has. Then it follows -the chain of frames, each `rbp` pointing at its caller's, and says -each call under way and its variables (`calls`); `Rt.trace` does the -same on demand. A thread's first frame has `rbp` zero, which ends it. -With `RAZ_PROFILE` set, `Rt`'s body has the kernel send SIGPROF every -millisecond of the program's time (`setitimer`); `onProf` notes the -address it interrupted, and `exit` has `profile` say which procedures -and places those fell in, by the same tables. Its signal +`Rt` shows it (`VarKind`). `Rt` reads them, through `Rt.places`, which +the entry point sets, to say where a failed check or a signal was: the +place with the highest address up to the one it has. Its signal handlers, set in its body, run on a stack of their own, so that they can tell a stack overflow, and leave by returning to the faulting instruction with the handler reset, so that the signal ends the program. +Then `Rt` follows the chain of frames, each `rbp` pointing at its +caller's, and says each call under way and its variables (`calls`); +`Rt.trace` does the same on demand. A thread's first frame has `rbp` +zero, which ends the chain. With `RAZ_PROFILE` set, `Rt`'s body has the +kernel send SIGPROF every millisecond of the program's time +(`setitimer`); `onProf` notes the address it interrupted, and `exit` +has `profile` say which procedures and places those fell in, by the +same tables. + The layout is chosen so the file can be mapped as it lies: text just after the headers, rodata on the next page, then a writable page that begins with the dynamic loader's table (in a program that uses C) and @@ -571,7 +574,7 @@ - **An instruction:** a routine in `x64.pas` built on `OpM` or `OpR`, and a line in `test/enctest.pas` to check its encoding. - **A machine:** a new `gen.pas`, answering the same calls, and an - encoder for it in place of `x64.pas`. + encoder and assembler for it in place of `x64.pas`. - **A statement:** a reserved word in `scan.pas` (in `TSym` and `Words`, in the same order), a case in `Statement`, and a routine beside the others. diff --git a/doc/raz.md b/doc/raz.md index cb639d5..36def9a 100644 --- a/doc/raz.md +++ b/doc/raz.md @@ -12,8 +12,6 @@ This is version 2026-10.12 of the report; section 12 says what each version changed. It is a thaw the owner chose, for a language anyone can build again, and it breaks programs written for 2026-10.10. -The compiler follows version 2026-10.10 until it is brought to this -one. The language is frozen, softly, from this version on: it changes only to mend a defect, and its library grows only by what breaks no program diff --git a/src/raz.pas b/src/raz.pas index 6ad444e..bf308d0 100644 --- a/src/raz.pas +++ b/src/raz.pas @@ -32,7 +32,7 @@ { what git describe says, made by make: 0.3.0 at the tag v0.3.0, 0.3.0-5-g38d29a8 five commits past it } Version = {$I version.inc}; - Report = '2026-10.10'; { the version of doc/raz.md it follows } + Report = '2026-10.12'; { the version of doc/raz.md it follows } MemfdCreate = 319; { the system call; FPC 3.2.2 has no name for it } MfdCloexec = 1; { an ELF still executes: the kernel opens it first }