Next: , Previous: , Up: Top   [Contents][Index]


1 INTRODUCTION to FWEB

FWEB is a system for literate programming. It enables one to maintain both documentation and source code in a single place (the web file), and to explain the code in terms of a web of very small fragments. Because FWEB is intimately integrated with TeX, one gains many advantages such as book-quality typesetting and extensive cross-referencing facilities. A simple example program is described in Structure.

FWEB was originally intended for scientific programming (the ’F’ stands for FORTRAN), and is in wide use in that arena; however, it has much broader applicability. It is an extension of Knuth’s WEB system that handles the specific languages C, C++, Fortran (both F77 and F90), RATFOR, and (in a limited fashion) TeX itself. It also attempts to implement a WYSIWYG language-independent mode as well as a (closely-related but not identical) verbatim ‘language’. The language-independent features are highly experimental and are not recommended.

The origins and philosophy of literate programming are described in the very enjoyable book by D. E. Knuth, Literate Programming (Center for the Study of Language and Information, Leland Stanford Junior University, 1992).

Knuth’s original WEB was written in Pascal, and it formatted Pascal code. Silvio Levy introduced CWEB, a WEB system written in C for C. FWEB is a (by now, substantial) modification of version 0.5 of CWEB that was graciously supplied by Levy. It also borrows various ideas from the works of Ramsey and Briggs on language-independent webs.

The original WEB’s worked with Plain TeX. More recently, many users have turned to Lamport’s LaTeX because of its ease of use and higher-level features. Excellent and extensive development of LaTeX has been accomplished, as described by Goossens, Mittelbach, and Samarin, The LaTeX Companion (Addison–Wesley, Reading, MA, 1994). The present version of FWEB is intended to be used with LaTeX (LaTeX2e, in particular); Plain TeX is no longer supported.


Next: , Previous: , Up: Top   [Contents][Index]