As I mentioned, I really like your idea of embedding code in various
support tools such as make, grep, etc. It would prevent code-rot as
it would be possible (assuming C++ would hold still for a week) to
be able to recreate the support tool. Axiom uses git. That makes it
possible to check out a particular instance at any given time in the past.
On a practical level generating the PDFs from inside the Axiom
executable is questionable. Axiom has about 1.2 million lines of
code. The PDFs that contain the code, the images, etc. would
be MUCH larger. It would be much easier to create an Axiom
command for a given function to link a URL to the PDF and pop
the PDF up in a browser. Axiom's PDFs can contain 6000 pages.
On a philosophical level, the question is one of emphasis.
Axiom is a large computer algebra system. Understanding it in
detail requires a PhD level of mathematical education. Indeed some
of the algorithms were implemented as part of a PhD thesis. It is
not reasonable to expect anyone to understand some of the
algorithms without access to explanation. The code is opaque.
As mentioned before, my approach to literate programming leans
toward 'textbooks'. The textbook has an expected structure which
includes an introduction, a table of contents, chapters, sections,
cross-references, an index, and a bibliography. People know what
to expect and how to navigate a book. This gives structure to the
explanation and makes it easier to find things.
Also of philosophical note, the fundamental point of a literate program,
in my approach, is explanation (not documentation). So the PDF book
is the primary element (as it would be in physics textbook). The code
is secondary (as equations would be in physics textbooks). The
explanation communicates to the human in hopefully precise terms
whereas the code communicates to the machine and could have many
different implementations.
To your point, the project goal of Axiom emphasizes literate programming
because, unlike other kinds of software, the mathematical algorithms will
not soon go out of date. However, open source software tends to die when
the lead developers stop working on a project. The literate programming
approach is an effort to let Axiom live beyond the current authors (some
of whom are already dead).
The above considerations leads me to the conclusion that the PDF
is the thing that generates code rather than the code generating the PDF.
Tim Daly