I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.9 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #+TITLE: Literate Programming
  2. #+AUTHOR: Christopher James Hayward
  3. #+ROAM_KEY: https://chrishayward.xyz/notes/literate-programming/
  4. #+HUGO_BASE_DIR: ~/.local/source/website
  5. #+HUGO_AUTO_SET_LASTMOD: t
  6. #+HUGO_SECTION: notes
  7. + Programming paradigm
  8. + Programs expressed in natural language with code snippets
  9. + Produces machine readable code and human readable documentation
  10. * Introduction
  11. Described in its introduction[fn:knuth-1984] as a
  12. #+begin_quote
  13. 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.
  14. #+end_quote
  15. Knuth describes a *practitioner* in the introduction of his 1984 paper[fn:knuth-1984] as
  16. #+begin_quote
  17. 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.
  18. #+end_quote
  19. * Concept
  20. #+begin_example
  21. _____
  22. | | -> Send to Boss
  23. _____ | doc | -> Copy to Team
  24. | | -> Weave -> |_____| -> Copy to Support
  25. | org | _____
  26. |_____| -> Tangle -> | | -> Test on CI
  27. | src | -> Copy to CDN
  28. |_____| -> Send to Customer
  29. #+end_example
  30. Illustrated above we see the process of *weaving* and *tangling* the literate source file, and how each of the produced components is handled respectively.
  31. | File | Description |
  32. |------+------------------------------|
  33. | org | Literate document / file |
  34. | src | Machine readable source code |
  35. | doc | Human readable documentation |
  36. * Resources
  37. [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