notes

Why adding a program works this way

Name: provisional. After the parent's "Why it works this way". calef names files.

An appendix to notes/adding-a-program.md: the reasoning behind its steps.

Milestone 150 (adding a program should not need eight hand-maintained lists) built this. The block is design/roadmap/0150-program-declaration-data.md; this page is the reasoning, and DECISIONS §158 (a program is declared once) is the record minted from it.

The archive list is the [[bin]] blocks

A program has to be declared there for cargo to build it, so that was always one of the places; the choice was whether the others could be derived from it. Considered and refused:

The shell's program table is one macro_rules! declaration

The seven-edit Program bookkeeping had exactly one edit nothing caught (PROGRAM_COUNT), and forgetting it also disarmed the test that would have caught two more. Considered and refused:

The count gate became a set of checks rather than a number

The block asked for "a gate on program count". A pinned total was considered and refused: it would be a hand-maintained number that fails on every legitimate addition, which is the shape this milestone removes. What a count was for is covered by construction (the archives and PROGRAM_COUNT are derived, so neither can be short of the declaration). It is also covered by three host tests on the relationships that can still go wrong: a spawnable program with no binary, a program the tree loads by name with no binary, and a spawnable program no swish-check line runs.

swish's exhaustive write_outcome match became a wildcard

Eleven of its thirteen arms were => {}, so the compile error it raised for every new program asked a byte-stream author for a keystroke, not a decision. every_program_that_answers_in_words_renders_its_answer now asks the question it was standing in for, of exactly the programs it applies to. That is rung two in place of rung one, deliberately, and it is the one place this milestone went down the ladder.