summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/faq-litprog.tex
blob: 277796e59695b16452153652fa88c37a41617089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
% $Id: faq-litprog.tex,v 1.1 2009/06/13 20:56:39 rf10 Exp rf10 $

\section{Literate programming}

\Question[Q-lit]{What is Literate Programming?}

Literate programming is the combination of documentation and source
together in a fashion suited for reading by human beings. 
In general, literate programs combine source
and documentation in a single file.  Literate programming tools then
parse the file to produce either readable documentation or compilable
source.  The \acro{WEB} style of literate programming was created by
D.~E.~Knuth during the development of \TeX{}.

\htmlignore
The ``documented \LaTeX{}'' style of programming (\Qref{}{Q-dtx})
\endhtmlignore
\begin{htmlversion}
  The ``\Qref{documented \LaTeX{}}{Q-dtx}'' style of programming
\end{htmlversion}
is regarded by some as a form of literate programming, though it only
contains a subset of the constructs Knuth used.

Discussion of literate programming is conducted in the newsgroup
\Newsgroup{comp.programming.literate}, whose \acro{FAQ} is stored on
\acro{CTAN}.  Another good source of information is
\URL{http://www.literateprogramming.com/}
\begin{ctanrefs}
\item[\nothtml{\rmfamily}Literate Programming \acro{FAQ}]%
  \CTANref{LitProg-FAQ}
\end{ctanrefs}

\Question[Q-webpkgs]{\acro{WEB} systems for various languages}

\TeX{} is written in the programming language \acro{WEB}; \acro{WEB}
is a tool to implement the concept of ``literate programming''.
Knuth's original implementation will be in any respectable
distribution of \TeX{}, but the sources of the two tools
(\ProgName{tangle} and \ProgName{weave}), together with a manual
outlining the programming techniques, may be had from \acro{CTAN}.

\acro{\ProgName{CWEB}}, by Silvio Levy, is a \acro{WEB} for \acro{C} programs.

Spidery \acro{WEB}, by Norman Ramsey, supports many 
languages including Ada, \texttt{awk}, and \acro{C}
and, while not in the public domain, is usable without charge.  It is
now superseded by \ProgName{noweb} (also by Norman Ramsay) which
incorporates the lessons learned in implementing spidery \acro{WEB},
and which is a simpler, equally powerful, tool.

\acro{\ProgName{FWEB}}, by John Krommes, is a version for Fortran,
Ratfor, and \acro{C}. 

\ProgName{Scheme}\acro{\ProgName{WEB}}, by John Ramsdell, is a Unix filter that
translates Scheme\acro{WEB} into \LaTeX{} source or Scheme source.

\acro{\ProgName{APLWEB}} is a version of \acro{WEB} for \acro{APL}.

\ProgName{FunnelWeb} is a version of \acro{WEB} that is language independent.

Other language independent versions of \acro{WEB} are \ProgName{nuweb} (which
is written in \acro{ANSI} \acro{C}).

\ProgName{Tweb} is a \acro{WEB} for \plaintex{} macro files, using
\ProgName{noweb}.
\begin{ctanrefs}
\item[aplweb]\CTANref{aplweb}
\item[cweb]\CTANref{cweb}
\item[funnelweb]\CTANref{funnelweb}
\item[fweb]\CTANref{fweb}
\item[noweb]\CTANref{noweb}
\item[nuweb]\CTANref{nuweb}
\item[schemeweb]\CTANref{schemeweb}
\item[spiderweb]\CTANref{spiderweb}
\item[tangle]\CTANref{web}
\item[tweb]\CTANref{tweb}
\item[weave]\CTANref{web}
\end{ctanrefs}