Web (programming system) explained

Web (programming system) should not be confused with World Wide Web.

Web, traditionally styled WEB, is a computer programming system created by Donald Knuth as the first implementation of what he called "literate programming":[1] his idea that one could create software as works of literature, by embedding source code in descriptive text, rather than the reverse. Unlike standard programming practice which relegates documentation to comments, the WEB approach is to write an article to document the making of the source code, and to include all the source code in that article, so as to be compilable therefrom.

Philosophy

The common practice in most programming languages is that the primary text is source code, optionally supplemented by descriptive text in the form of comments. Knuth proposed that making the descriptive text primary was putting things in an order more convenient for human readers, rather than the order demanded by compilers.[2]

Much like TeX articles, the Web source text is divided into sections according to documentation flow. For example, in CWEB, code sections are seamlessly intermixed in the line of argumentation.[3]

Implementations

The original WEB system depends on Pascal and comprises two programs:

Others:

The most significant programs written in Web are TeX and Metafont. Modern TeX distributions however use another program called Web2C to convert Web source to C.

CWEB

CWEB
Paradigm:Literate, imperative (procedural), structured
Designer:Donald Knuth
Developer:Donald Knuth & Silvio Levy
Latest Release Version:3.67
Typing:Static, weak, manifest, nominal
Influenced By:WEB, TeX
Influenced:noweb
Operating System:Cross-platform (multi-platform)
License:custom free-software license
File Ext:.w

CWEB is a computer programming system created by Donald Knuth and Silvio Levy as a follow-up to Knuth's WEB literate programming system, using the C programming language (and to a lesser extent the C++ and Java programming languages) instead of Pascal.

Like WEB, it consists of two primary programs:

Features

See also

External links

Notes and References

  1. Web site: Knuth and Levy: CWEB . 2025-10-27 . cs.stanford.edu.
  2. Book: Knuth, Donald E. . Donald Knuth . Literate Programming . Stanford, California . Center for the Study of Language and Information . 1992 . CSLI Lecture Notes . 27 .
  3. Web site: Silvio Levy . An example of CWEB . 12 June 2004 . https://web.archive.org/web/20211020184416/http://tex.loria.fr/litte/wc.pdf . 20 October 2021 . dead.