raz / commit 9907e9ec

commit
9907e9ec1409bc5629ddbb11146702f25c89fc38
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
c16e8a93
PLAN: proposed, the manual

raz-tutorial(7), raz-lib(3) made by tools/Doc, raz(7) at a glance, and
raz(1) tying them together; every example run by make check.

patch · log

1 file changed, +44 -0

PLAN.md (history) modified +44 -0

@@ -79,6 +79,50 @@
7979 (code 5 to 8% smaller in ulam's estimate) are left for after, measured
8080 on their own.
8181
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+
82126 ## Next, when the owner says
83127
84128 - The book, "Compiling Raz": its brief is `doc/book/PLAN.md`.