Browse Source

Update NOTE

main
parent
commit
8dde73bbb0
  1. 44
      notes/literate-programming.org

44
notes/literate-programming.org

@ -4,13 +4,45 @@
#+HUGO_BASE_DIR: ~/.local/source/website #+HUGO_BASE_DIR: ~/.local/source/website
#+HUGO_SECTION: notes #+HUGO_SECTION: notes
Knuth describes a *practitioner* in the introduction of his 1984 paper[fn:knuth-1984], as an essayist concerned with exposition and excellence of style. Someone who carefully selects the name for each variable and describes their meaning. They will strive for a program that is comprehensible because concepts are introduced in a manner best for human understanding.
+ Programming paradigm
+ Programs expressed in natural language with code snippets
+ Produces machine readable code and human readable documentation
Summarized:
* Introduction
+ Exposition
+ Excellence
+ Comprehension
+ Documentation
Described in its introduction[fn:knuth-1984] as a
#+begin_quote
Programming paradigm in which a computer program is given an explanation of its logic in a natural language, such as English, interspersed with snippets of macros and traditional source code, from which compilable source code can be generated.
#+end_quote
Knuth describes a *practitioner* in the introduction of his 1984 paper[fn:knuth-1984] as
#+begin_quote
An essayist concerned with exposition and excellence of style. Someone who carefully selects the name for each variable and describes their meaning. They will strive for a program that is comprehensible because concepts are introduced in a manner best for human understanding.
#+end_quote
* Concept
#+begin_example
_____
| | -> Send to Boss
_____ | doc | -> Copy to Team
| | -> Weave -> |_____| -> Copy to Support
| org | _____
|_____| -> Tangle -> | | -> Test on CI
| src | -> Copy to CDN
|_____| -> Send to Customer
#+end_example
Illustrated above we see the process of *weaving* and *tangling* the literate source file ~org~, and how each of the produced components is handled respectively. It's not difficult to imagine a situation where an update to a program would update the all of the interested parties. Source code is typically built and tested without requiring the documentation, and in the same sense someone providing support for an application should not be required to dig through the source code to locate documentation.
| File | Description |
|------+------------------------------|
| org | Literate document / file |
| src | Machine readable source code |
| doc | Human readable documentation |
* Resources
[fn:knuth-1984] Knuth, D. E. (1984). Literate Programming. The Computer Journal, 27(2), 97–111. https://doi.org/10.1093/comjnl/27.2.97 [fn:knuth-1984] Knuth, D. E. (1984). Literate Programming. The Computer Journal, 27(2), 97–111. https://doi.org/10.1093/comjnl/27.2.97
Loading…
Cancel
Save