A program is usually arranged for the tools that build it. A book is arranged for
the people who want to understand it. Literate programming connects those two
orders: explanation leads, named fragments carry the implementation, and ordinary
source files are generated from the same authoritative work.
This book explains that method through Literate itself. The program is at once a
deterministic generator, a Visual Studio Code environment, a publication system,
and a substantial example of its own approach.
Preface — Why this program is a book
The .literate chapters are the source of the program. Generated TypeScript,
JavaScript, and HTML remain in the repository so a checkout can build and verify
itself, but design work begins in the book. Prose, diagrams, formulas, examples,
and code fragments should evolve together.
The main chapters concentrate on method, architecture, algorithms, and the reasons
behind important boundaries. Code may be read closely, but the central argument
should remain understandable when a reader skips a code block. The appendices keep
mechanical assembly and detailed references available without making them the
spine of the explanation.
flowchart TD
Source[Literate project snapshot] --> Model[Fragment graph and parsed project]
Model --> Generation[Source and HTML generation]
Model --> Preview[Screen presentation]
Model --> Publication[Print publication]
Model --> Projection[Generated-language projections]
Generation --> CLI[Command-line adapter]
Generation --> Editor[VS Code adapter]
Projection --> Servers[Language servers]
Servers --> Editor
Publication --> Book[LaTeX and PDF]
Literate was inspired by Donald Knuth's account of literate programming and by the
way Physically Based Rendering: From Theory to Implementation presents a large
program as a sustained explanation. The aim here is not merely to place all source
inside a book, but to make the book the clearest route to understanding it.
Reading paths
The book is meant to support more than one journey:
A first-time reader can begin with Part I and then follow the architectural
overviews of generation, the editor, language intelligence, and publication.
A literate-program author can continue through the semantic model,
self-hosting, correctness, and the syntax reference.
An extension contributor will need the engine, host, editor, and maintenance
chapters together with the assembly and testing appendices.
A language-service contributor can move from the fragment graph to projection,
protocol ownership, mapping, diagnostics, and safe mutation.
A publication contributor can follow the parsed project into screen and print
rendering, portable resources, process isolation, and PDF compilation.
An auditor can combine the main architectural chapters with the complete
assembly maps, protocols, bounds, and verification references.
These paths overlap because every subsystem starts from the same captured project
and fragment model.
Chapter 36 closes the main narrative. The sections below are reference routes into
implementation chapters and assembly maps; they are not additional chapters in the
main reading sequence.