| | @@ -79,6 +79,50 @@ |
| 79 | 79 | (code 5 to 8% smaller in ulam's estimate) are left for after, measured |
| 80 | 80 | on their own. |
| 81 | 81 | |
| 82 | +## Proposed: the manual |
| 83 | + |
| 84 | +For: someone who has never seen raz can learn it from `man`, and come |
| 85 | +back to it as a reference, without the report open; the report stays |
| 86 | +the definition, and the manual never disagrees with it. No change to |
| 87 | +the language or the compiler. Modelled on concha's three pages, which |
| 88 | +the owner knows: a reference, a tour, and the rest. |
| 89 | + |
| 90 | +The rules for every page: mdoc, so man, mandoc and groff all set it |
| 91 | +well; short sections, each with one idea; every example a whole |
| 92 | +program or a piece of one that `make check` compiles and runs, as it |
| 93 | +does the report's, so none can go stale; plain, short prose, as the |
| 94 | +report's; `groff -mdoc -ww` and `mandoc -Tlint`, if there, say |
| 95 | +nothing; and each page read whole at 80 columns, as a user would, |
| 96 | +before it is done. |
| 97 | + |
| 98 | +1. **`raz-tutorial(7)`, a tour of the language.** Numbered sections, |
| 99 | + each one idea with a program to run: hello, world and modules; |
| 100 | + values, types and conversions; procedures and several results; |
| 101 | + arrays, slices and strings; records and pointers; memory and |
| 102 | + allocators; errors, `ERROR` and `MSG`; `defer`; checks and what a |
| 103 | + failure says; generic modules; talking to C; threads. Then "From |
| 104 | + Pascal and C to raz", a table of what each spells differently, as |
| 105 | + concha's tour has from sh. About 500 lines. The examples go in |
| 106 | + `test/man`, run by `make check`. |
| 107 | +2. **`raz-lib(3)`, the library, made from its sources.** `tools/Doc` |
| 108 | + learns to write mdoc: each module's own comment, then its exported |
| 109 | + declarations with theirs, under a heading of its name. `make` builds |
| 110 | + the page from `lib/`, so it says what the library says, always. |
| 111 | + About 60 lines of `Doc`. |
| 112 | +3. **`raz(7)`, the language at a glance.** What a programmer looks up: |
| 113 | + the grammar in brief, the types and their sizes, the operators and |
| 114 | + their order, the built-in procedures, the statements, what is |
| 115 | + checked, and the limits; each pointing to the report's section for |
| 116 | + the whole of it. About 400 lines. |
| 117 | +4. **`raz(1)` again, and the pages together.** The command's page |
| 118 | + points into the others; `make install` installs all four, and |
| 119 | + `make uninstall` removes them; README and `doc/compiler.md` name |
| 120 | + them; the desktop guide gets an entry for raz as one of our own |
| 121 | + tools. The pages are read whole once more, together. |
| 122 | + |
| 123 | +Each step is a commit and stops for review. Step 1 stands on its own |
| 124 | +and is most of the worth; 2 to 4 can wait. |
| 125 | + |
| 82 | 126 | ## Next, when the owner says |
| 83 | 127 | |
| 84 | 128 | - The book, "Compiling Raz": its brief is `doc/book/PLAN.md`. |