Main navigation
- Programs
- Subjects
- Universities
- Destinations
- Advice
Literate programming (LP) involves combining code and documentation into a unified document, treating software development as both an implementation and communication process. Developers typically merge program logic and explanations within one file, intelligently blending them, before employing LP utilities like noweb to generate either the documented version (with code snippets) or pure executable code. The source file follows specific formatting rules that guide the LP tool in formatting the documentation, commonly outputting in markup languages like LaTeX.
Scripting languages
While traditional literate programming works well for compiled languages like C, it doesn't align with the workflow of interpreted language users, such as those working with Lisp or Python. These languages support quick prototyping and iterative development by enabling isolated testing and modification of code segments. Developers typically edit and execute specific portions directly from their working files, sometimes just a few lines at a time. Interactive debuggers and IDE components collaborate with the interpreter, programmer, and source files to swiftly detect and fix issues. In this context, adding an extra step to process LP source files into executable Lisp or Python code becomes disruptive rather than helpful.
LP/Lisp system
The LP/Lisp initiative provides a literate programming solution specifically designed for Lisp, written in Lisp itself. Here, the Lisp source file serves dual purpose as the LP source file, with documentation embedded in comments. But LP/Lisp goes beyond basic comment extraction and formatting. It incorporates nearly all standard LP tool capabilities for documentation enhancement, code reorganization, and similar functions. This creates an LP framework that naturally complements how developers work with interpreted languages.