← Latest papers
🤖 AI

A Literate Programming Environment for Human and Machine Agents

This paper presents a literate programming environment that integrates executable code, natural language, and structured data through a name-graph architecture, thereby optimizing context for Large Language Models and providing machine agents with symbol-aware tools comparable to human IDEs.

Original authors: Adam T. Burke

Published 2026-08-26
📖 8 min read🧠 Deep dive

Original authors: Adam T. Burke

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the modern era of computing, a new kind of partner has entered the workshop: the language model. These are vast, flexible systems trained on enormous libraries of human text, capable of reading instructions and writing code with startling fluency. For many, this shift feels like a sudden expansion of capability, allowing novices to build scripts and experts to tackle massive systems. Yet, a fundamental tension remains. While these machines can process language, they do not truly "learn" or remember what happens in a conversation once the session ends. They rely entirely on the text currently visible to them, a limited window of context that must be constantly refilled with relevant details. If a programmer wants the machine to understand the logic behind a piece of code, that logic must be present in the text right alongside the code itself. This creates a challenge for how we write software. Traditionally, code and the human explanations of that code have been kept in separate places, or buried in comments that machines often ignore. But if the machine is to be a true collaborator, the story of the program and the program itself must live together, side by side, in a format that both humans and machines can read with equal ease.

This is the central problem addressed by a new environment called notlob, created by researcher Adam T. Burke. The work proposes a return to an old idea known as literate programming, but updated for an age where both humans and artificial agents are reading the same documents. In this system, a software project is not a collection of separate files for code, documentation, and tests. Instead, it is a single, flowing document that looks like an essay. The text explains the ideas, the motivation, and the design, while the executable instructions are embedded directly within the prose. The researchers built a working system that treats this combined document as the primary source of truth. When the system reads the file, it does not just see words; it builds a detailed map of how every name, concept, and piece of code relates to the others. This map, which the author calls a name-graph, allows a machine agent to navigate the project not by searching for keywords, but by following the logical connections between ideas, much like a human reader would follow a thread of thought through a book.

The design of notlob is driven by three simple observations about how programming is changing. First, natural language has become the dominant way to specify and organize software when working with artificial intelligence. Second, the computer-generated checks that verify code still works are more valuable than ever, serving as a reliable feedback loop for the agents. Third, the current generation of these language models is heavily dependent on the amount of text they can see at once. To address this, the researchers created a language where the explanation, the execution, and the verification all sit in the same file. A typical document begins with a title and an introduction, followed by the core logic of the program. This is followed by a section for tests and references, separated by a simple line. The system uses specific markers to distinguish between a piece of prose, a block of code, a property that must always be true, and a specific test case. For example, a section might describe a mathematical sequence, followed immediately by the code that generates it, and then a block of text stating that the code must satisfy certain rules. The system then runs these rules to ensure the code behaves as the text claims it should.

To make this work, the researchers developed a parser that treats names as the most important objects in the system. In traditional programming, a name is just a label for a variable or function. In notlob, a name is a first-class citizen that links the written explanation to the executable code. When the system processes a file, it constructs a graph that connects the text describing a concept to the code that implements it, and to the tests that verify it. This structure allows a machine agent to jump from a high-level idea to the specific lines of code that realize it, or to find every place a specific concept is used, without getting lost in a sea of files. The system includes tools that can export this map in standard formats, allowing other software to query the relationships between different parts of the project. This mimics the way a human programmer uses an integrated development environment to find where a function is defined or who calls it, but it does so by understanding the semantic meaning of the text, not just the file structure.

The researchers tested this environment by building several working programs, including a tool for converting numbers into Roman numerals and a web-based game based on Petri nets, which are diagrams used to model systems with interacting parts. In one experiment, they used an artificial agent to help write a project from scratch. The agent was given a high-level description of the goal and a few empty function signatures. The agent then filled in the code, wrote the tests, and organized the prose, all while adhering to the structure of the notlob document. The agent was able to detect inconsistencies between the text and the code, such as a mismatch in a function's definition, and asked for clarification. In another case, the system helped an agent find a subtle bug in a digital signal processing project that had been missed by other testing methods. The bug was related to a calculation that became unstable under certain conditions, and the agent's property tests, which were written as part of the essay, successfully exposed the error.

However, the researchers also observed that the agents were not perfect. In several instances, the agents tended to neglect the declarative parts of the document, such as the formal properties and the structural rules, focusing instead on the immediate task of writing code. They sometimes treated the text as a suggestion rather than a constraint, leading to inconsistencies that required human intervention to fix. The researchers noted that this dynamic is familiar to human software teams, where senior developers must often step in to ensure that the documentation and the code remain aligned. The study suggests that while these language models are powerful, they still benefit from a structure that forces the code and the explanation to stay in close contact. The notlob environment provides that structure, offering a way to keep the theory of the program and the practice of the code in the same place.

The work also distinguishes itself from other approaches to using language models in programming. Some methods treat the natural language description as a separate specification that comes before the code is written, a process that can lead to a disconnect between the plan and the result. Others rely on the model to summarize or regenerate code after it has been written. Notlob takes a different path by co-locating the specification, the code, and the tests in a single, iterative workspace. This allows humans and machines to work on all three elements together, refining the logic and the explanation in tandem. The researchers argue that this approach is more effective than treating the natural language as a mere prompt or a separate document. By making the prose and the code inseparable parts of the same artifact, the system ensures that the context window of the language model is filled with the most relevant information possible.

The implementation of notlob is an open-source project that currently supports three established programming languages: Haskell, Python, and TypeScript. The system includes a set of command-line tools that allow users to build, test, and visualize the project. One tool can render the document as a standard web page, while another can generate a visual map of the name-graph, showing how the different parts of the project are connected. The researchers also experimented with using the system to create a "critic" agent, an artificial intelligence tasked with reviewing the projects for logical consistency and style. This agent was able to identify errors and suggest improvements, sometimes adopting different personas to provide diverse perspectives on the work. These experiments suggest that the environment can support not just the creation of code, but also the critical review and refinement of the entire project.

Ultimately, the paper presents a vision for a future where software development is a collaborative act between humans and machines, grounded in a shared language of text and code. The notlob environment does not claim to solve all the problems of artificial intelligence in programming, nor does it promise that machines will soon write perfect software on their own. Instead, it offers a practical tool that makes the relationship between the idea and the implementation more transparent and robust. By treating the essay and the executable code as a single, interconnected entity, the system helps to bridge the gap between human intent and machine execution. The work suggests that the future of programming may not be about writing more code, but about writing better stories that the code can follow, ensuring that the logic of the system is as clear to the machine as it is to the human.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →