Literate programming

[1] The approach is used in scientific computing and in data science routinely for reproducible research and open access purposes.[4] Literate programs are written as an exposition of logic in more natural language in which macros are used to hide abstractions and traditional source code, more like the text of an essay.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.A preprocessor is used to substitute arbitrary hierarchies, or rather "interconnected 'webs' of macros",[7] to produce the compilable source code with one command ("tangle"), and documentation with another ("weave").The meta-language capabilities of literate programming are also claimed to facilitate thinking, giving a higher "bird's eye view" of the code and increasing the number of concepts the mind can successfully retain and process.[8] Knuth also claims that literate programming can lead to easy porting of software to multiple environments, and even cites the implementation of TeX as an example.However, because these tools do not implement the "web of abstract concepts" hiding behind the system of natural-language macros, or provide an ability to change the order of the source code from a machine-imposed sequence to one convenient to the human mind, they cannot properly be called literate programming tools in the sense intended by Knuth.The <<*>> symbol stands for the "root", topmost node the literate programming tool will start expanding the web of macros from.[16] The free CWEB, written by Knuth and Silvio Levy, is WEB adapted for C and C++, runs on most operating systems, and can produce TeX and PDF documentation.The LaTeX listings package provides a lstlisting environment which can be used to embellish the source code.Again, I did this in the interests of simplicity, because I noticed that most applications of multiple parameters could in fact be reduced to the one-parameter case.
Literate Programming by Donald Knuth is the seminal book on literate programming.
Donald Knuthprogramming paradigmcomputer programnatural languagesnippetsmacrossource codecompilablescientific computingdata sciencereproducible researchopen accessprogrammersdocumentationcomputer languagelanguage-agnosticStanford Universityalgorithmstypographycomputational notebookspseudocodecomputer sciencepreprocessordocumentation generationPlain Old DocumentationJavadocinteractive fictionColossal Cave AdventurePascalComputers and TypesettingPierre-Arnoul de Marneffeexploratory programmingorg-modeEmacs LispPlain textCoffeeScriptJavaScriptMarkdownMaple worksheetsMaple (software)Wolfram NotebooksWolfram LanguageIPython NotebookPythonJupyter NotebookJulia (programming language)reactiveAgda (programming language)SweaveAsciiDocreStructuredTextLeo text editorHaskellAlgol 68Text Encoding InitiativeDocumentation generatorNotebook interfaceSelf-documenting codeKnuth, Donald E.The Computer JournalBritish Computer SocietyAssociation for Computing MachineryDonald E. KnuthSir Walter ScottMarmionBattle of FloddenDominus, Mark-JasonWayback Machinede Marneffe, Pierre ArnoulUniversité de LiègeGitHubUniversity of AalborgCiteSeerXWikiWikiWebProgramming paradigmsComparison by languageImperativeStructuredJackson structuresBlock-structuredModularNon-structuredProceduralProgramming in the large and in the smallDesign by contractInvariant-basedNested functionObject-orientedcomparisonClass-basedPrototype-basedObject-basedImmutable objectPersistentUniform Function Call SyntaxDeclarativeFunctionalRecursiveAnonymous functionPartial applicationHigher-orderPurely functionalStrictDependent typesFunctional logicPoint-free styleExpression-orientedApplicativeConcatenativeFunction-levelValue-levelDataflowFlow-basedFunctional reactiveSignalsStreamsSynchronousAbductive logicAnswer setConstraintConstraint logicInductive logicNondeterministicOntologyProbabilistic logicAlgebraic modelingAutomata-basedActionCommandSpacecraftDifferentiableEnd-userGrammar-orientedInterface descriptionLanguage-orientedList comprehensionLow-codeModelingNon-English-basedPage descriptionfiltersProbabilisticQuantumScientificScriptingSet-theoreticSimulationStack-basedSystemTactileTemplatingTransformationGraph rewritingProductionPatternVisualConcurrentdistributedparallelActor-basedAutomatic mutual exclusionChoreographic programmingConcurrent logicConcurrent constraint logicConcurrent OOMacroprogrammingMultitier programmingOrganic computingParallel programming modelsPartitioned global address spaceProcess-orientedRelativistic programmingService-orientedStructured concurrencyMetaprogrammingAttribute-orientedAutomaticInductiveDynamicExtensibleGenericHomoiconicityInteractiveHygienicMetalinguistic abstractionMulti-stageProgram synthesisBayesianInferentialby demonstrationby exampleReflectiveSelf-modifying codeSymbolicTemplateSeparationof concernsAspectsComponentsData-drivenData-orientedEvent-drivenFeaturesIntentionalSubjectsThe Art of Computer ProgrammingThe Complexity of SongsConcrete MathematicsSurreal NumbersThings a Computer Scientist Rarely Talks AboutSelected papers seriesSoftwareMetafontAMS EulerComputer ModernConcrete RomanKnuth's Algorithm XKnuth–Bendix completion algorithmKnuth–Morris–Pratt algorithmKnuth shuffleRobinson–Schensted–Knuth correspondenceTrabb Pardo–Knuth algorithmDijkstra's algorithmKnuth's Simpath algorithmDancing LinksKnuth reward checkKnuth PrizeKnuth's up-arrow notationMan or boy testQuater-imaginary base-yllion