arXiv:2608.24644cs.SEAug 2026

Manuscript Offprint

arXiv:2608.24644

A Literate Programming Environment for Human and Machine Agents

Adam T. Burke

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ADAM T. BURKE, Queensland University of Technology, Australia

This paper introduces an environment for constructing literate programs in concert with language-aware machine agents. This environment includes a grammar for executable program essays, a parser that treats names as first-class objects, an internal name-graph which relates prose, names and executable artifacts, and a binding mechanism for existing languages and testing toolsets. This supports co-location of code with its most relevant natural language and structured data context, making better use of Large Language Model (LLM) context windows. It also provides LLM coding agents with a toolset more analogous to the symbol-aware search and usage information available in human programmer-facing Integrated Development Environments (IDEs). We describe a working implementation with bindings to three established programming languages, and several example programs.

Additional Key Words and Phrases: programming language, literate programming, Large Language Models, agent programming

1 Introduction

We are in a technological moment when the use of Large Language Models (LLMs) [30] has triggered major changes in programming practice. This ranges from the authoring of small scripts by programming novices, to analysis of codebases for security flaws, to the construction and extension of large software systems by experienced teams of software engineers.

As language-aware AI coding tools are changing programming, our programming languages and environments should change as well. This paper introduces a new programming language and environment informed by three observations. Firstly, and unsurprisingly, natural language text dominates the specification and design organization of programs developed with language-aware AI tooling. Secondly, machine checkable computational artifacts, which constrain the operation and execution of programs, retain or increase their value by acting as an automated feedback surface for coding agents. Thirdly, the influence of the context window is dominant in the current generation of language-aware AI.

In the transformer architecture, a very large language corpus is used to train a model, then interrogated at inference time by next token prediction. No change is made to the model during basic inference, for example, a session where a programmer works with a coding agent. The model itself does not learn. Any memory or continuity in such a session comes from the re-injection of symbols into the context window from chat history or other text artifacts.

Peter Naur has an influential argument that programming is theory building [6, 22]. Crucially, Naur argues that the theory being built lives primarily in the programmer's head, not in program artifacts such as source code. From this point of view, when using coding agents, there is no way for the model itself to learn this theory, so the responsibility for building and carrying the theory remains entirely with the programmer.

As Dominic Fox points out [11], Donald Knuth's literate programming [18] is a competing school of thought. It holds that a theory of a program can not only be conveyed in written artifacts, but that well-composed natural language is a highly effective vehicle for doing so. Knuth accordingly created tools and a style of writing code and essay-style prose together, an idea that has influenced much scholarship and language tooling since, without really centring software development on prose as Knuth envisioned. Recent research explores the sympathies between language-competent agents and literate programming [28, 31], even declaring it a literate programming renaissance [31].

“The hottest new programming language is English”, according to Andrej Karpathy in 2023 [15], though this observation was as much fashion journalism as design intent. With this “literate turn” in programming history, we

Author's Contact Information: Adam T. Burke, at.burke@qut.edu.au, Queensland University of Technology, Brisbane, Queensland, Australia.

Adam T. Burke

#Fibonacci

The Fibonacci sequence: each number is the sum of the two before it, starting from 0 and 1.

fib :: Int -> Int fib 0 = 0 fib 1 = 1 fib n = fib (n - 1) + fib (n - 2)

The defining recurrence, checked here as a property rather than assumed for a handful of examples.

~property prop_recurrence :: Int -> Bool prop_recurrence n = let k = abs n mod 20 + 2 in fib k == fib (k - 1) + fib (k - 2)

#Tests

##base cases fib 0 == 0 fib 1 == 1

##known values fib 10 == 55

Fig. 1. A notlob program which calculates the Fibonacci sequence, using the Haskell binding.

should reach for that genre of writing which is used to explore and advance an idea: the essay. Like Knuth, we should do so without abandoning the productive mechanics of programming language design. Unlike Knuth, both humans and computers will be readers of the essays and the executable code.

This paper presents a literate programming environment for human and machine agents. This includes:

• a machine interpretable language, comprising both prose and executable elements;

• embedded code fragments, using existing programming languages, and their rich libraries;

• an internal data structure relating both concept names and executable symbols, called the name-graph;

• tools which expose name-graph relationships, providing IDE-like support for agents and other tools; and

• example programs.

The three observations motivate this design. The dominance of natural language text leads to a language with both prose and executable elements. The usefulness of machine checkable artifacts leads to keywords for property and unit tests. The importance of the context window re-motivates literate programming's co-location of prose, code, and validation in files, and navigation using the name-graph. The programming language and environment is named notlob, after a section in Monty Python's parrot sketch where a dissimulating shopkeeper makes a false but easily checkable claim about palindromes and the town of Bolton.

This paper focuses on design and example programs of the language and tooling environment; experimental evaluation is left to future work. The remainder of this paper is organised as follows. Section 2 introduces the notlob grammar, semantics and name-graph. Section 3 introduces a reference implementation of the language and environment. Section 4 shares example programs and projects. Section 5 reviews related work, and Section 6 concludes.