Jump to content

Web (programming system): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
shorter hatnote
Amend hatnote
 
(22 intermediate revisions by 18 users not shown)
Line 1: Line 1:
{{Short description|Macro-based programming language}}
{{About|the computer programming system|the World Wide Web|World Wide Web|the [[Bible translation]]|World English Bible|other uses|web (disambiguation){{!}}web}}
{{distinguish|World Wide Web}}

{{Redirect-several|Tangle|Weave|Web}}
{{no footnotes|date=October 2017}}
{{primary sources|date=October 2017}}
{{primary sources|date=October 2017}}
'''WEB''' is a [[computer programming]] system created by [[Donald E. Knuth]] as the first implementation of what he called "[[literate programming]]": the idea that one could create [[software]] as works of [[literature]], by embedding source code inside descriptive text, rather than the reverse (as is common practice in most [[programming languages]]), in an order that is convenient for exposition to human readers, rather than in the order demanded by the compiler.


'''Web''' is a [[computer programming]] system created by [[Donald E. Knuth]] as the first implementation of what he called "[[literate programming]]": the idea that one could create [[software]] as works of [[literature]], by embedding source code inside descriptive text, rather than the reverse (as is common practice in most [[programming languages]]), in an order that is convenient for exposition to human readers, rather than in the order demanded by the [[compiler]].<ref>{{cite book |first = Donald E. |last=Knuth |author-link = Donald Knuth |title=Literate Programming |location=Stanford, California |publisher=Center for the Study of Language and Information |year=1992 |series=CSLI Lecture Notes |volume=27 }}</ref>
WEB consists of two secondary programs: TANGLE, which produces compilable [[Pascal programming language|Pascal]] code from the source texts, and WEAVE, which produces nicely-formatted, printable documentation using [[TeX]].

Web consists of two secondary programs: TANGLE, which produces compilable [[Pascal programming language|Pascal]] code from the source texts, and WEAVE, which produces nicely-formatted, printable documentation using [[TeX]].

[[#CWEB|CWEB]] is a version of Web for the [[C (programming language)|C programming language]], while [[noweb]] is a separate literate programming tool, which is inspired by Web (as reflected in the name) and which is [[language-independent specification|language agnostic]].

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

==Philosophy==
Unlike most other [[Comparison of documentation generators|documentation generators]], which relegate documentation to comments, the WEB approach is to write an article to document the making of the source code. Much like TeX articles, the source is divided into sections according to documentation flow. For example, in CWEB, code sections are seamlessly intermixed in the line of argumentation.<ref>{{cite web |author=Silvio Levy |url=http://tex.loria.fr/litte/wc.pdf |date=12 June 2004 |title=An example of CWEB |archive-url=https://web.archive.org/web/20211020184416/http://tex.loria.fr/litte/wc.pdf |archive-date=20 October 2021 |url-status=dead}}</ref>

==CWEB==
{{Infobox programming language
| name = CWEB
| paradigm = [[Literate programming|Literate]], [[Imperative programming|imperative]] ([[Procedural programming|procedural]]), [[structured programming|structured]]
| released = {{Start date and age|1987}}
| designer = [[Donald Knuth]]
| developer = [[Donald Knuth]] & [[Silvio Levy]]
| latest release version = 3.67
| latest release date = {{Start date and age|2006|10|24}}
| typing = [[Type system|Static]], [[Weak typing|weak]], [[manifest typing|manifest]], [[Nominative type system|nominal]]
| influenced by = [[WEB]], [[TeX]]
| influenced = [[noweb]]
| operating system = [[Cross-platform|Cross-platform (multi-platform)]]
| license = custom [[free-software license]]
| file ext = .w
| website = {{URL|www-cs-faculty.stanford.edu/~uno/cweb.html}}
}}
'''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)|C programming language]] (and to a lesser extent the [[C++]] and [[Java (programming language)|Java]] programming languages) instead of [[Pascal (programming language)|Pascal]].

Like WEB, it consists of two primary programs:


* CTANGLE, which produces compilable C code from the source texts, and
[[CWEB]] is a version of WEB for the [[C (programming language)|C programming language]], while [[noweb]] is a separate literate programming tool, which is inspired by WEB (as reflected in the name) and which is [[language-independent specification|language agnostic]].
* CWEAVE, which produces nicely-formatted printable documentation using [[TeX]].


===Features===
The most significant programs written in WEB are [[TeX]] and [[Metafont]]. Modern TeX distributions use another program [[Web2C]] to convert WEB source to C.
* Can enter manual TeX code as well as automatic.
* Make formatting of C code for [[pretty printing]].
* Can define sections, and can contain documentation and codes, which can then be included into other sections.
* Write the header code and main C code in one file, and can reuse the same sections, and then it can be tangled into multiple files for compiling.
* Use <code>#line</code> pragmas so that any warnings or errors refer to the .w source.
* Include files.
* Change files, which can be automatically merged into the code when compiling/printing.
* Produces index of identifiers and section names in the printout.


==References==
== References ==
{{Reflist}}
*{{Cite book |first=Donald E. |last=Knuth |authorlink= Donald Knuth |title=Literate Programming |location=Stanford, California |publisher=Center for the Study of Language and Information |year=1992 |series=CSLI Lecture Notes |volume=27 }}


==External links==
==External links==
*[https://www.ctan.org/pkg/web The TeX Catalogue entry for WEB]
*[https://www.ctan.org/pkg/web The TeX Catalogue entry for Web]
*[http://www-cs-faculty.stanford.edu/~uno/cweb.html CWEB homepage]
*[https://www-cs-faculty.stanford.edu/~knuth/cweb.html CWEB homepage]
*[https://www-cs-faculty.stanford.edu/~knuth/programs.html Examples of programs written in Web], By Donald Knuth (1981 and onward)


{{TeX navbox}}
{{TeX navbox}}
{{Donald Knuth navbox}}
{{Donald Knuth navbox}}
{{Authority control}}


[[Category:Free documentation generators]]
[[Category:Free documentation generators]]

Latest revision as of 09:32, 12 October 2024

Web is a computer programming system created by Donald E. Knuth as the first implementation of what he called "literate programming": the idea that one could create software as works of literature, by embedding source code inside descriptive text, rather than the reverse (as is common practice in most programming languages), in an order that is convenient for exposition to human readers, rather than in the order demanded by the compiler.[1]

Web consists of two secondary programs: TANGLE, which produces compilable Pascal code from the source texts, and WEAVE, which produces nicely-formatted, printable documentation using TeX.

CWEB is a version of Web for the C programming language, while noweb is a separate literate programming tool, which is inspired by Web (as reflected in the name) and which is language agnostic.

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

Philosophy

[edit]

Unlike most other documentation generators, which relegate documentation to comments, the WEB approach is to write an article to document the making of the source code. Much like TeX articles, the source is divided into sections according to documentation flow. For example, in CWEB, code sections are seamlessly intermixed in the line of argumentation.[2]

CWEB

[edit]
CWEB
ParadigmLiterate, imperative (procedural), structured
Designed byDonald Knuth
DeveloperDonald Knuth & Silvio Levy
First appeared1987; 37 years ago (1987)
Stable release
3.67 / October 24, 2006; 18 years ago (2006-10-24)
Typing disciplineStatic, weak, manifest, nominal
OSCross-platform (multi-platform)
Licensecustom free-software license
Filename extensions.w
Websitewww-cs-faculty.stanford.edu/~uno/cweb.html
Influenced by
WEB, TeX
Influenced
noweb

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:

  • CTANGLE, which produces compilable C code from the source texts, and
  • CWEAVE, which produces nicely-formatted printable documentation using TeX.

Features

[edit]
  • Can enter manual TeX code as well as automatic.
  • Make formatting of C code for pretty printing.
  • Can define sections, and can contain documentation and codes, which can then be included into other sections.
  • Write the header code and main C code in one file, and can reuse the same sections, and then it can be tangled into multiple files for compiling.
  • Use #line pragmas so that any warnings or errors refer to the .w source.
  • Include files.
  • Change files, which can be automatically merged into the code when compiling/printing.
  • Produces index of identifiers and section names in the printout.

References

[edit]
  1. ^ Knuth, Donald E. (1992). Literate Programming. CSLI Lecture Notes. Vol. 27. Stanford, California: Center for the Study of Language and Information.
  2. ^ Silvio Levy (12 June 2004). "An example of CWEB" (PDF). Archived from the original (PDF) on 20 October 2021.
[edit]