

These arbitrary explanatory phrases become precise new operators, created on the fly by the programmer, forming a meta-language on top of the underlying programming language.Ī preprocessor is used to substitute arbitrary hierarchies, or rather "interconnected 'webs' of macros", to produce the compilable source code with one command ("tangle"), and documentation with another ("weave"). These macros are similar to the algorithms in pseudocode typically used in teaching computer science.

Macros in a literate source file are simply title-like or explanatory phrases in a human language that describe human abstractions created while solving the programming problem, and hiding chunks of code or lower-level macros. Literate programming is writing out the program logic in a human language with included (separated by a primitive markup) code snippets and macros. The practice of literate programming has seen an important resurgence in the 2010s with the use of computational notebooks, especially in data science.
Rmarkdown print variable software#
However, it resembles the complicated nature of software delicately pieced together from simple materials.

The implementation was called " WEB" since he believed that it was one of the few three-letter words of English that had not yet been applied to computing. He implemented it at Stanford University as a part of his research on algorithms and digital typography. Literate programming was first introduced in 1984 by Donald Knuth, who intended it to create programs that were suitable literature for human beings.

Literate Programming by Donald Knuth is the seminal book on literate programming Programming paradigms
