![]() |
| Home > Programming > |
| comp.programming.literate FAQ |
Section 1 of 3 - Prev - Next
All sections - 1 - 2 - 3
Archive-name: literate-programming-faq Last-modified: 2000/03/15 Version: 1.3.1 The Literate Programming FAQ David B. ThompsonVersion: 1.3.1, Mar 15, 2000 The purpose of this document is two-fold: First, there is a need to present a basic description of literate programming and how applica- tion of literate programming principles can improve the resulting code. Second, there is a need to present a list of tools available to iterate programmers. Hopefully, this document will meet both needs. ____________________________________________________________________ __ Table of Contents 1. Welcome 1.1 Disclaimer 1.2 Copyright 1.3 What's New? 1.4 What's Needed? 2. Introduction 3. How do I get the FAQ? 3.1 Literate Programming FAQ 4. Is there a newsgroup? 5. What internet nodes are of interest to literate programmers? 5.1 Web Ring 5.2 The Literate Programming Archive (LPA) 5.3 Comprehensive TeX Archive Network (CTAN) 6. What is Literate Programming? 7. How do I begin literate programming? 8. Important and Actively-Supported Tools 8.1 CWEB 8.2 CWEBx3.0 8.3 FWEB 8.4 noweb 8.5 nuweb 8.6 ProTeX 9. Unsupported Tools 9.1 AFTWEB (Almost Free Text WEB) 9.2 APLWEB 9.3 CLiP 9.4 mCWEB 9.5 FunnelWeb 9.6 FunnelWeb 3.0AC 9.7 LEO 9.8 Literate Programmer's Workshop (LPW) 9.9 MapleWEB 9.10 Matlabweb 9.11 RWEB 9.12 SchemeWEB 9.13 SpideryWEB 9.14 WEB 9.15 WinWordWEB 10. Are there other tools I should know about? 10.1 C2LaTeX 10.2 c2cweb 10.3 c2man 10.4 cnoweb 10.5 dpp 10.6 Fold2Web 10.7 Funnelweb Mode 10.8 noweb.el 10.9 noweb-outline.el 10.10 nuweb.el 10.11 Web mode 11. What other resources are available? 11.1 TeX Resources 12. Are there any code examples? 13. Bibliographies 14. Other Opinions about Literate Programming 14.1 van Ammers 14.2 Ramsey 14.3 My (Dave Thompson's) Experience 14.4 Others 15. How to anonymously ftp 16. Acknowledgements 17. End notes ____________________________________________________________________ __ 1. Welcome Information contained in this document is the best available at preparation. The original file was dated October 15, 1993 (just for historical purposes). 1.1. Disclaimer This FAQ is presented with no warranties or guarantees of ANY KIND including correctness or fitness for any particular purpose. The author of this document has attempted to verify correctness of the data contained herein; however, slip-ups can and do happen. If you use this data, you do so at your own risk. 1.2. Copyright Copyright 1993-2000 by David B. Thompson. All rights reserved worldwide. Permission is granted to copy this document for free distribution so long as it remains intact and unmodified. For other arrangements, contact the author/maintainer via email: 1.3. What's New? o Updated dpp entry. See Section ``dpp'' o Added noweb-outline.el entry. See section ``noweb-outline.el'' 1.4. What's Needed? o I've checked some of the links to software. If anyone finds the FAQ useful, please let me know if the links are active or dead when you're surfing. o Some authors have disappeared. If you know one of them, or are an author (and wish to remain in contact ;), then please provide current contact information. o I could use some feedback on the state of the FAQ. It's about as complete as I know how to make it. 2. Introduction Literate programming is a phrase coined by Donald Knuth to describe the approach of developing computer programs from the perspective of a report or prose. The focus, then, is on description (and documentation) of the approach in human-readable form. This is in contrast to the normal approach of focusing on the code. This document is for new and experienced users of literate programming tools. The purpose is to explain the concept of literate programming and to provide a resource for locating resources of interest to literate programmers and those interested in literate programming. The Literate Programming (LitProg) Frequently Asked Questions (FAQ) list is maintained by Dave Thompson . Comments and constructive criticisms are welcome. Direct flames to /dev/null (or nul if you're a msdos user! ;-) If you find an error, please report it. I'm particularly interested in establishing the locations of generally available literate programming tools. If you are the author of such a tool and wish to have it included in this list, please send email. Please note this is a work-in-progress. It is not complete, and probably will never be complete. Nevertheless, the information contained herein may be useful to some. Use it as it is intended. 3. How do I get the FAQ? 3.1. Literate Programming FAQ You have many ways to get a current copy of this FAQ. One is to use anonymous ftp (if you don't know how, see a later section in this FAQ) to connect to one of the ``Comprehensive TeX Arvchive Network'' sites or the Literate Programming Archive and retrieve a copy of the file. Open an ftp connection to one of the CTAN sites and retrieve the file help/comp.programming.literate_FAQ. Cesar Bellardini cballard@santafe.com.ar prepared a translation of the FAQ into Spanish. It's available at (For more information on CTAN and the literate programming archive, see the section below entitled ``Internet Nodes of Interest to Literate Programmers''.) 4. Is there a newsgroup? One of the most important resources is the literate programming newsgroup, comp.programming.literate. Because of the amount of spamming and unrelated posts, the newsgroup is now moderated. You can read this newsgroup using your standard reader. 5. What internet nodes are of interest to literate programmers? The principal nodes of interest to literate programmers are the Literate Programming Archive (LPA hereafter) and the CTAN (Comprehensive TeX Archive Network). 5.1. Web Ring There is a web ring for literate programming. It is at the URL www.webring.org/cgi-bin/webring?ring=litprog;list 5.2. The Literate Programming Archive (LPA) The Literate Programming Archive (LPA) is: o Node: ftp.th-darmstadt.de [130.83.55.75] o Directory: /pub/programming/literate-programming o Notes: Fastest response during off-U.S. [yep] business hours. However, the LPA seems to be defunct in that no files are available in the /pub directory. If anyone knows anything about the status of the LPA, please send email. 5.3. Comprehensive TeX Archive Network (CTAN) Participating hosts in the Comprehensive TeX Archive Network are (from the file CTAN.sites): o ftp.dante.de (Mainz, Germany) o anonymous ftp /tex-archive (/pub/tex /pub/archive) o Gopher: gopher.dante.de o e-mail ftpmail@dante.de o WWW www.tex.ac.uk o Administrator: o ftp.tex.ac.uk (Cambridge, UK) o anonymous ftp /tex-archive (/pub/tex /pub/archive) o Gopher: gopher.tex.ac.uk o NFS mountable from nfs.tex.ac.uk:/public/ctan/tex-archive o WWW www.tex.ac.uk o Administrator: o ctan.tug.org (Boston, Massachusetts, USA) o anonymous ftp /tex-archive (/pub/archive) o WWW ctan.tug.org o Administrator: The pointer, ftp://ftp.cdrom.com/pub/tex/ctan/CTAN.sites, is directed to the official list of CTAN archive sites and their mirrors. 6. What is Literate Programming? Literate programming is the combination of documentation and source together in a fashion suited for reading by human beings. In fact, literate programs should be enjoyable reading, even inviting! (Sorry Bob, I couldn't resist!) 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 WEB style of literate programming was created by D.E. Knuth during the development of his TeX typsetting software. All the original work revolves around a particular literate programming tool called WEB. Knuth says: The philosophy behind WEB is that an experienced system pro- grammer, who wants to provide the best possible documenta- tion of his or her software products, needs two things simultaneously: a language like TeX for formatting, and a language like C for programming. Neither type of language can provide the best documentation by itself; but when both are appropriately combined, we obtain a system that is much more useful than either language separately. The structure of a software program may be thought of as a web that is made up of many interconnected pieces. To docu- ment such a program we want to explain each individual part of the web and how it relates to its neighbours. The typo- graphic tools provided by TeX give us an opportunity to explain the local structure of each part by making that structure visible, and the programming tools provided by languages such as C or Fortran make it possible for us to specify the algorithms formally and unambigously. By combin- ing the two, we can develop a style of programming that max- imizes our ability to perceive the structure of a complex piece of software, and at the same time the documented pro- grams can be mechanically translated into a working software system that matches the documentation. See Section ``Other Opinions'' for some additional thoughts on literate programming. 7. How do I begin literate programming? I've given considerable thought as to what should be in this section of the FAQ. This is probably the most important section of this document. My suggestion is that you review Section ``Supported Tools'' and Section ``Unsupported Tools'' to choose a system appropriate for the kind of development you do. Then, use the manual that accompanies the system to determine how it complements your development style. Both Eric van Ammers, Section ``van Ammers'', and Norman Ramsey, Section ``Ramsey'', wrote some thoughts on literate programming. I've included these thoughts in Section ``Other Opinions'' below. I started with a pretty-printing tool, Section ``cnoweb'', as a test of the utility of interweaving significant documentation with code. My experience is detailed in Section ``Thompson''. Wayne Sewell's (1989) Weaving a Program: Literate Programming in WEB. Van Nostrand Reinhold, ISBN 0-442-31946-0 (pbk). This book focuses on using Knuth's web system. I've read D. E. Knuth's collection of articles (1992) entitled Literate Programming. Center for the Study of Language and Information, Stanford University, ISBN 0-937073-80-6 (pbk). This book gives insight into Knuth's thoughts as he developed the web system of literate programming (and TeX for typesetting). However, it does not document methods for literate programming. Some talk exists in the newsgroup/mailing list for a Usenet University course in literate programming. I'm sure discussion of this topic will be welcomed. (1Feb2000: Note this thread has been dead for a long, long time. I wish someone would pick it up.) 8. Important and Actively-Supported Tools I have selected a few of the tools from my list that appear to be most actively supported. Inclusion here does not imply endorsement; exclusion does not imply lack of quality. 8.1. CWEB Developer: Silvio Levy and D.E. Knuth Version: 3.5 Hardware: Unix systems (dos and amiga ports available) Languages: C and C++ Formatter: Plain TeX and LaTeX. Availability: Anonymous ftp from: o ftp://labrea.stanford.edu:/pub/cweb o LPA:/c.c++ o CTAN:/web/c_cpp/cweb o DOS version is no longer available. o Win32 version www.literateprogramming.com o Amiga version from Aminet:dev/c. o Mac port of CTANGLE in LPA:/machines/mac o LaTeX support in LPA:/c.c++ Readme: Bundled with above Description: No description provided. Support: Bugs to 8.2. CWEBx3.0 Developer: Marc van Leeuwen Version: 3.04 Hardware: Any system using ASCII code Languages: ANSI C Formatter: Plain TeX Availability: Anonymous ftp from: o wwwmathlabo.univ-poitiers.fr/~maavl/CWEBx/ Readme: Bundled with above Brief description: A modified implementation of CWEB, with some extensions. Provides a mode for full compatibility with Levy/Knuth CWEB. The most significant extras are: o Typedef declarations affect formatting througout source file o Include files are scanned for typedef definitions o Flexible selection of layout style o Possibility to refer to sections using symbolic labels o CTANGLE detects unbalanced braces and parentheses o CWEAVE can be made to report syntax errors more easily o Some additional mechanisms to avoid formatting problems o New and modular set of grammar rules, based on ANSI C syntax o Possibility to suppress #line directives o A new manual Support: bugs and remarks to maavl@mathlabo.univ-poitiers.fr 8.3. FWEB Developer: John A. Krommes Version: 1.62 Hardware: Unix, VMS, and DOS platforms (anything with ANSI C) Languages: C, C++, Fortran-77, Fortran-90, Ratfor, TeX; also, a anguage- independent mode. Formatter: LaTeX. Plain TeX may work, but is no longer supported. Availability: Anonymous ftp from: o ftp.pppl.gov/pub/fweb o CTAN:/web/fweb o msdos version on ftp.ppl.gov site Readme: In bundle with above. Description: It also has a well-developed user's manual and its own FAQ (see above). Beginning with 1.40, documentation is maintained in gnu texinfo format. It runs on most platforms: VMS, PC, UNIX, and pretty much anything that the GNU C compiler (GCC) is supported for. Features: o Processes multiple languages during a single run (so one can mix C and Fortran, for example). o Language-independent mode (v1.40). o Ability to turn off pretty-printing (v1.40). o Built-in Ratfor translator. o Built-in macro preprocessor (closely follows ANSI C, with extensions). o A style file that allows the user to adjust many parameters and behavior patterns of FWEB. o Various operator-overloading features that provide additional pretty-printing capabilities to languages such as C++ and Fortran-90. o Numerous miscellaneous features and command-line options. Support: Bug reports and suggestions to krommes@princeton.edu Online documentation is available at w3.pppl.gov/%7ekrommes/fweb_toc.html 8.4. noweb Developer: Norman Ramsey Version: 2.9a Hardware: Unix and DOS platforms (DOS binaries available for v2.7). Languages: All programming languages, singly or in combination. Automatic indexing for C, Icon, Pascal, Standard ML, TeX, Yacc Formatter: Plain TeX, LaTeX, and HTML formatters. Will convert LaTeX to HTML automatically. Availability: Anonymous ftp from: o CTAN:/web/noweb o LPA:/independent o Last recourse, use ftp.cs.virginia.edu:pub/nr Readme: With bundle above, or see the noweb home page: www.eecs.harvard.edu/~nr/noweb Those without http access can consult ``Literate Programming Simplified,'' IEEE Software, September 1994, pp97-105, or ``Literate Programming Using Noweb,'' Linux Journal, October 1997, pp64-69. Description: Noweb is designed to meet the needs of literate programmers while retaining the simplest possible input format. Its primary advantages are simplicity, extensibility, and language- independence. Noweb uses 5 control sequences to WEB's 27. The noweb manual is only 3 pages; an additional page explains how to customize its LaTeX output. Noweb works ``out of the box'' with any programming language, and supports TeX, latex, and HTML back ends. A back end to support full hypertext or indexing takes about 250 lines; a simpler one can be written in 40 lines of awk. Unlike WEB, Noweb does not have prettyprinting built in, but there are several third-party extensions that provide prettyprinting, includeing dpp, pretzel, and nwpp. Noweb supports indexing and identifier cross-reference, including hypertext ``hot links.'' noweb includes a simple, efficient LaTeX-to-HTML converter, so you can use hypertext browsers on your legacy documents. Noweb can also process nuweb programs, so you can use noweb to convert a standard nuweb program to HTML with one command. Support: email to the author 8.5. nuweb Developer: Preston Briggs: Version: 0.87 Hardware: Unix systems: Sparcs, RS/6000s, HPs; (!) MSDOS and Amiga. Languages: Any programming language or combination of programming languages. Formatter: Latex Availability: Anonymous ftp from: o Unix: CTAN:/web/nuweb o DOS: CTAN:/web/nuweb-pc o LPA:/independent o Amiga: CTAN:/web/nuweb/nuweb_ami o Amiga: wuarchive.wustl.edu/pub/aminet Readme: Send mail to Description: A single program that takes a web file written in a combination of latex and any programming language(s) and produces a latex file that can be pretty printed and a set of files containing code for compilation/interpretation by the appropriate language processors. Strengths include speed, simplicity, multiple languages, nice indices and cross-references, latex. Doesn't require any special macros or macro files. Drawbacks: latex-dependent, no code pretty printing, harder to make indices than cweb. More good stuff: nice support for make, doesn't reformat source files, so they're easy to debug. Lots of control without too much effort. That is, it doesn't do too much! Future directions... Very little change planned, except perhaps refinements in the indexing software. Support: Hack it yourself or send e-mail to 8.6. ProTeX Developer: Eitan Gurari Version: ProTeX 1.5, AlProTeX 2.3 Hardware: Any platform with (La)TeX Languages: Any language Formatter: TeX or LaTeX Availability: Anonymous ftp from: o www.cis.ohio-state.edu/~gurari/systems.html o LPA:/independent Readme: With bundle above Description: o Easy to use o Extensible o Language independent o Multiple output files o Fast (single compilation provides output and dvi files) o Option for XHTML and pdf files o No installation is needed besides copying the files (written in TeX) Introduction of main features and examples on web site above. Complete manual in Eitan M. Gurari, "TeX and LaTeX: Drawing and Literate Programming", McGraw-Hill, 1994 Support: 9. Unsupported Tools 9.1. AFTWEB (Almost Free Text WEB) Developer: Todd A. Coram Version: 4.6 Hardware: Linux, Unix, MSDOS Any system with Perl, and a C++ compiler with STL (such as gcc 2.7.2). Languages: Any (C/C++ support supplied) Formatter: LaTeX or HTML by way of AFT. Availability: www.mindspring.com/~coram/aft.html Readme: Bundled with above. Brief description: AFTWEB uses a CWEB-like syntax. It uses AFT for documentation markup (AFT is a minimalistic, yet powerful, markup language with very few commands). AFTWEB was written in AFTWEB (using C++) and the weaved document is available online (as HTML) at the URL listed above. Support for C and C++ is supplied. You can easily support other languages (such as Java and Perl) by writing a new language description file. The markup language AFT is very easy to learn and is available at the same URL as AFTWEB. Support: Bugs to tcoram@pobox.com 9.2. APLWEB Developer: Christoph von Basum Version: Unknown Hardware: MSDOS Languages: IBM APL2 and STSC APL Formatter: Plain TeX Availability: Anonymous ftp from: watserv1.uwaterloo.ca:/languages/apl/aplwe b Readme: At above ftp location. Description: None available. Support: Unknown Note: The status of this particular package is unknown. It's at the ftp site, but other than that I can't say. Last known email address of developer is CvB@erasmus.hrz.uni-bielefeld.de. 9.3. CLiP Developer: E.W. van Ammers and M.R. Kramer Versions: 2.0 and 2.4b (DOS only) Platform: Vax/VMS, Unix, DOS Languages: Any programming language Formatter: Any formatter (TeX, LaTeX, Troff, Runoff, HTML, etc) or any wordprocessor including WYSIWYG systems (Word Perfect, WinWord, Ami Pro, Word Pro, etc.) Availability: Anonymous ftp from: o ftp://sun01.info.wau.nl:/CLIP/ms_dos o ftp://sun01.info.wau.nl:/CLIP/ms_dos_24b o ftp://sun01.info.wau.nl:/CLIP/vax_vms o ftp://sun01.info.wau.nl:/CLIP/unix o CTAN:/web/clip o LPA:/machines/ms-dos o LPA:/machines/vax Readme: With bundle above Description: CLiP does not use explicit commands to perform the extraction process. Rather it recognizes pseudostatements written as comments in the programming language in question. CLiP distinguishes pseudostatements from ordinary comments because the former comply with a particular style. This style can be adjusted to suit virtually any programming language. The CLiP approach to LP makes the system extremely versatile. It is independent of programming language and text processing environment. We designed CLiP to be compatible with hypertext systems as well. Some hypertext examples are at: o ftp://sun01.info.wau.nl/clip/html/queens.htm o ftp://sun01.info.wau.nl/clip/html/pal1.htm Features: o CLiP imposes virtually no limitations on the text-processing system used to produce the documentation. If the text-processor supports these items you can o structure the documentation according to your own taste. o include drawings, pictures, tables etc. o disclose your documentation my means of X-ref tables, Indexes, Table of contents, Table of tables, Table of figures, etc. o typeset the documented code. o Extracts any number of modules from a maximum of 64 source files. o No pretty-printing. Code from the source files is copied "as is" to the module. o Appearance of code segments in the documentation matches those of the modules to ease the identification of code segments. o Supports partially specified data types. o Comprehensive user manual (preliminary version) and technical description. o No automatic generation of a X-ref table for program identifiers. Support: Bugs, problems and assistance by e-mail to 9.4. mCWEB Developer: Markus Oellinger Version: 1.0 Hardware: Unix Languages: C/C++ Formatter: plain TeX Availability: anonymous ftp from ist.tu- graz.ac.at:/pub/utils/litprog/mcweb/mcweb.tgz Readme: at same location Description: This is mCWEB 1.0, a descendant of the CWEB system of structured documentation by Donald E. Knuth and Silvio Levy. It adds some features that are indispensable when working in a team. mCWEB regards a project of a book consisting of several chapter files. By means of import and export commands, it automatically manages all relationships between the chapters of a book and to other books. Interface documentation is now also part of mCWEB. It is extracted into a second TeX file. This makes it possible to define well known interfaces between the individual parts of a project that will be implemented by different persons. In addition, mCWEB parses C header files to find out about all the datatypes defined there. mCWEB comes with a full completely rewritten user manual and is compatible with CWEB. Support: Institute of Software Technology, moell@ist.tu-graz.ac.at 9.5. FunnelWeb Developer: Ross N. Williams ross@ross.net Version: V3.2 (May 1999). Hardware: MS-DOS, MacOS, Win32, OpenVMS, Solaris, Red Hat Linux, BSD/OS, FreeBSD, Digital Unix, IRIX. Status: Open Source GNU. Languages: No restrictions. Formatter: Generates TeX and/or HTML Web: www.ross.net/funnelweb/ Availability: ftp.ross.net/clients/ross/funnelweb/ Readme: With bundle above. Description: FunnelWeb is a production-quality literate-programming tool that emphasises simplicity and reliability. Everything about FunnelWeb, from the simplicity of its language to the comprehensive tutorial in the user's manual, has been designed to make this as simple, as practical, and as usable a tool as possible. Features: o Provides a simple macro preprocessor facility. o Generates typeset documentation in TeX and/or HTML formats. o Runs on a wide range of platforms. o Portable C source code distributed under GNU licence. o Comprehensively documented online: o www.ross.net/funnelweb/tutorial/ o www.ross.net/funnelweb/reference/ o www.ross.net/funnelweb/developer/ o Programming-language independent. o Mature and essentially bug-free (released 1992). o Can generate multiple output files. o Allows complete control over the output text. o Also useful for generating web sites! Support: No formal support available. Mailing list maintained with about 50 subscribers. Informal assistance available from mailing list. 9.6. FunnelWeb 3.0AC Developer: Enhanced by A.B.Coates coates@physics.uq.edu.au from FunnelWeb v3.0 by Ross N. Williams ross@guest.adelaide.edu.au Version: 3.0AC Hardware: MSDOS, Mac, VMS, Sun, OSF/1, Linux, Sys.V, OS/2. Languages: No restrictions. Formatter: Tex, LaTeX, or HTML. Availability: Anonymous ftp from ftp.physics.uq.oz.au:/pub/funnelwebAC30.tar.gz Readme: With bundle above; for FunnelWeb manual see WWW page www.physics.uq.oz.au:8001/people/coates/funnelweb.html Description: FunnelWeb 3.0AC is an enhanced version of FunnelWeb (see the entry for FunnelWeb). FunnelWeb is designed to be typesetter independent, though FunnelWeb v3.0 only supports (La)TeX as the typesetter. FunnelWeb 3.0AC also supports HTML, and creates appropriate hypertext links within the document among the code sections. FunnelWeb 3.0AC also supports automatic and manual insertion of line directives, so that compiler errors can be flagged back to the original FunnelWeb source file. FunnelWeb 3.0AC is completely compatible with FunnelWeb v3.0 sources (with one minor exception; see the file README.ABC which comes with the FunnelWeb 3.0AC distribution). Support: Supported by A.B.Coates coates@physics.uq.edu.au, subject to the time constraints imposed by his thesis. 9.7. LEO Developer: Edward K. Ream edream@mailbag.com Version: 1.0 Hardware: Windows Languages: Unknown Formatter: Unknown Availability: Contact the author or see www.mailbag.com/users/edream/front.html Readme: Unknown Description: See web site. Support: Unknown. 9.8. Literate Programmer's Workshop (LPW) Developer: Norbert Lindenberg Version: 1.1 Hardware: Apple Macintosh Languages: C++, Object Pascal & others Formatter: self-contained WYSIWYG system Availability: Anonymous ftp from: o CTAN:/web/lpw o ftp.apple.com:/pub/literate.prog Readme: With bundle above. Also comes with 38-page manual. Description: The Literate Programming Workshop is an environment for the integrated development of program source text and documentation in combined documents. It consists of a WYSIWYG word processor based on a style sheet approach, a mechanism to extract parts of the text in a document, and a project management system that handles multi-document projects. The system is designed to be used in conjunction with the Macintosh Programmer's Workshop: it prepares raw source text for the MPW compilers, accepts MPW error messages, and shows them in the context of the original
Section 1 of 3 - Prev - Next
All sections - 1 - 2 - 3
| Back to category Programming - Discuss "comp.programming.literate FAQ" |
| Home - Search - About the project - Forum - Feedback |
© 2005 allanswers.org | Terms of use