Skip to main content

Decisions

These are the choices that give the engine its shape. Each is stated as a decision, the reason it was made, and whether it is built.

1. Two dialects, static defined by absence​

Decision. Dynamic source is the authoring form. compile lowers it to static source. render accepts static source only.

Why. Without a resolved intermediate, every promise about what render did — no invented pages, no late layout — would be a convention rather than a property. Static source makes the promise structural.

Status. Built.

2. Four commands, one concern each​

Decision. collect owns numbers, compile owns layout and lowering, render owns drawing, check owns reading.

Why. Numbers must be computed before layout, but they are also useful on their own for an editor. Separating them keeps compile from counting twice and keeps the stores inspectable.

Status. Built.

3. Source is XML-like and explicit​

Decision. The source is a tree of named elements with attributes. There is no implicit structure inferred from appearance.

Why. A document's structure should be something its author can reason about, not something a layout algorithm reconstructs from indentation or styling.

Status. Built.

4. Imports are path-first​

Decision. from "./x.mtx" import component { X };. One kind per statement.

Why. Completion can start at the path, which is the thing the author knows. A single kind per statement means one keyword of lookahead tells an editor what to suggest next.

Status. Built.

5. Components are declarations, not file roots​

Decision. A file may hold several components. A body is prop declarations, then const/if, then exactly one return on every path. children is a prop.

Why. “Which block is the value” should never be guessed. Declaring children is what makes “this component takes no content” checkable.

Status. Built.

6. A small, structural type system​

Decision. Primitives, literal unions, objects, arrays and optional fields. No generics.

Why. The type system exists to check props and store keys, not to become a language. Structural checks catch the errors that matter — a missing prop, a citation to an id that does not exist — without generics.

Status. Built.

7. Expressions are declarative​

Decision. Literals, identifiers, object and array literals, field access, indexing and core-function calls. No arithmetic, no author-defined functions.

Why. A declarative source keeps the pipeline analysable and keeps “comptime” from quietly becoming a scripting language.

Status. Built.

8. Numbers are computed once, demand-driven​

Decision. collect assigns numbers after expansion and before pagination. A thing is numbered exactly when something asks for its number: {label()} in a heading, a caption reading a figure's label, \label on an equation row.

Why. Positional numbering is stable across rebuilds and independent of line layout. Demand means an unnumbered References heading needs no attribute to stay unnumbered.

Status. Built.

9. The number is a value the author places​

Decision. label() inside the heading; headings[id].label elsewhere; figures[id].label in a caption component. There is no format template.

Why. Formatting is presentation, and presentation belongs to the author's components. A single format function would be a second vocabulary.

Status. Built. Display math is the exception: compile draws the number at the right edge, because raw math has nowhere to write a print statement.

10. Style is written on the element​

Decision. Three sources — tag, element.<tag> default, engine value. No stylesheet, selector, class or cascade.

Why. Exactly one origin per property is what makes “no unexplained layout” checkable. Shared appearance is a value you pass, not a rule that reaches into other elements.

Status. Built.

11. Tables are grids; rules are elements​

Decision. Flat cells with span and rows, align per column, <rule> elements for lines. No tr, thead, tbody or column definitions.

Why. A grid can be simulated and checked. Rules as elements survive into static source and can carry their own thickness, colour and row range.

Status. Built. Splitting between rows and repeating header rows are built.

12. Floats have an anchor rule and no fallback​

Decision. A float lands at the top or bottom of the first page at or after its anchor where it fits. It never lands before its anchor and never returns to it.

Why. A float that silently falls back is a layout decision the author did not make. A page that ends early is visible and is the author's arrangement.

Status. Built, including column-scoped and page-scoped spans.

13. Columns flow, and breaks count per column​

Decision. A <columns count> region fills column by column, then the next page's first column. Fragment minimums and table splits are measured in the column, not across the page.

Why. Measuring across the page would produce breaks that look wrong in a column. The last page is filled rather than balanced, so the reading order is predictable.

Status. Built. Nested columns are balanced into a sub-row and do not split.

14. A note never separates from its marker​

Decision. A <footnote> becomes a raised mark and an entry in the page's note area. If the note does not fit, the line carrying the marker moves.

Why. A marker whose note is on another page is a defect, not a compromise.

Status. Built. Notes are numbered per page or fixed with label.

15. Math labels name rows​

Decision. <math> is always display math. \\ ends a row, & separates cells, \label{id} names a row. Each labelled row is its own equation.

Why. A row is the unit that gets one number. Aligning on & gives the column alignment papers expect without an environment system.

Status. Built. The notation is deliberately small and not TeX.

Decision. <a to="id"> is an internal link; <a href> is external. Internal destinations are attached after the pages are drawn.

Why. Forward references need no second pass, and a pointer that reaches nothing can be reported at compile time instead of producing a dead PDF annotation.

Status. Built.

17. References are components over stores​

Decision. The bibliography is authored as <bib> with record components. collect writes one union and const per citable kind. Citation formatting is a component.

Why. A <ref> primitive makes rendering the author's problem in the wrong place. A component can hardcode its own prefix, type-check against the union, and change style for a whole project in one place.

Status. Built.

18. Faces, not synthesis​

Decision. font-family names a declared family. weight and italic select a face within it. <b> asks for 700; <i> asks for italic. No synthetic bold or slant. Small caps are a face.

Why. A synthesised style is a different shape from the real one, and documents are measured with the face they draw with. A face cannot be made to contain small caps, so a document must name one whose lowercase letters are.

Status. Built. Small caps currently require a face; there is no switch.

19. Hyphenation from authored words and patterns​

Decision. Break points come from a word list in config and from any literal hyphen in the word. hyphenation.auto adds the embedded English (US) Knuth–Liang patterns.

Why. A word list is predictable and editable; patterns cover the unlisted tail. An unlisted word stays whole and is clipped with a warning rather than broken arbitrarily.

Status. Built.

20. Pagination uses a fragment minimum​

Decision. pagination.fragment-min requires N lines on both sides of a break. heading-min additionally requires that many lines of the block after a heading to fit beside it.

Why. It is one rule that covers widows, orphans and headings, rather than three special cases. A heading is one or more lines, so keeping it with what follows follows from the same rule.

Status. Built.

21. Generated files are committed​

Decision. Stores are ordinary source, written by collect and checked into the project.

Why. The union is only useful to an editor if it exists before a build.

Status. Built.


Still open​

These are recorded as open in the design, not as decisions:

  • a per-column fact beyond align — width, a rule, a column that never breaks;
  • whether a vertical rule may span arbitrary rows (partly answered by from/to);
  • contents pages and any pointer that prints another page's number;
  • slides beyond “a page with no flow”;
  • whether <columns> may nest arbitrarily;
  • an unnumbered target — abstract, acknowledgements — and what a pointer to it displays;
  • what a footnote may hold and whether a note may split;
  • a block of aligned rows numbered once;
  • a real table design for class 3 and long-form work;
  • a glyph set that draws integrals, radical hooks and stretchable delimiters well.

The full record lives in the repository's design/ directory: goal.md, questions.md, architecture.md and decisions.md.