Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Web (programming system)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Macro-based programming language}} {{distinguish|World Wide Web}} {{Redirect-several|Tangle|Weave|Web}} {{primary sources|date=October 2017}} '''Web''', traditionally styled WEB, is a [[computer programming]] system created by [[Donald E. Knuth]] as the first implementation of what he called "[[literate programming]]": 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 [[compiler]]s.<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> 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.<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> ==Implementations== The original WEB system [[dependency|depends]] on [[Pascal programming language|Pascal]] and comprises two programs: * TANGLE, which produces compilable Pascal code from the source texts, and * WEAVE, which through the use of [[TeX]] produces nicely-formatted, printable documentation from the same source texts. '''Others:''' *[[#CWEB|CWEB]] (below) 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 however use another program called [[Web2C]] to convert Web source to C. ==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 * CWEAVE, which produces nicely-formatted printable documentation using [[TeX]]. ===Features=== * Can enter manual TeX code as well as automatic. * Makes formatting of C code suitable for [[pretty printing]]. * Can define sections, and can contain documentation and codes, which can then be included into other sections. * Writes 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. * Uses <code>#line</code> directive 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. == See also == * [[Comparison of documentation generators|Documentation generators]] β While comparable with Web's WEAVE, these however generally follow the standard practice of source code first, the opposite of the Web approach. == References == {{Reflist}} ==External links== *[https://www.ctan.org/pkg/web The TeX Catalogue entry for Web] *[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}} {{Donald Knuth navbox}} {{Authority control}} [[Category:Free documentation generators]] [[Category:Literate programming]] [[Category:TeX]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Distinguish
(
edit
)
Template:Donald Knuth navbox
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Primary sources
(
edit
)
Template:Redirect-several
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:TeX navbox
(
edit
)