Dijkstra on Natural Language Programming (EWD 667)

Dijkstra argued that plain-English instruction would not make computers easier to program. Here is his case, step by step, with notes on which parts still hold for engineers and which are period opinion.

Binary Buddies · 5 min read · 6 views

Every few years someone proposes that the hard part of programming is the notation, and that if we could instruct machines in plain English the difficulty would go away. Edsger Dijkstra addressed that proposal directly in EWD 667, 'On the foolishness of natural language programming'. His answer was blunt. The care and accuracy that programming demands do not come from formal symbolism. Formal symbolism is the tool that makes that care achievable at all.

The note is short, about a thousand words. It is worth reading closely because its argument is structural, not nostalgic. Dijkstra does not say natural language interfaces are hard to build, although he grants they would make machines 'much more complicated'. He says they would probably make the human's job harder. That claim rests on a point about interfaces that most engineers have learned the expensive way.

What follows walks through the argument step by step. It looks at what holds up, what is a period opinion, and where the reasoning stops applying.

The complaint Dijkstra was answering

Dijkstra opens by naming a long-running grievance. Since the early days of automatic computing, some people have felt it was a shortcoming that programming required 'the care and accuracy that is characteristic for the use of any formal symbolism'. They blamed the machine for its strict obedience: it carried out instructions even when 'a moment's thought would have revealed that those instructions contained an obvious mistake'.

He answers with a line from A.E. Housman: 'But a moment is a long time, and thought is a painful process.' The people he describes wanted 'more sensible machinery' that would refuse to act on a trivial clerical error. That is the real demand behind natural language programming. The point was never really English. The point was a machine that works out what you meant instead of doing what you said.

Framing it this way matters. Once you see the request as 'resolve my ambiguity for me', the question changes. You stop asking which notation is friendlier and start asking who is accountable when the machine guesses wrong.

The faithful slave survives every language upgrade

Dijkstra traces a short history. Machine code, 'with its absence of almost any form of redundancy', was soon recognised as a needlessly risky interface between person and machine. High-level languages followed, partly in response. Over time the field learned 'to a certain extent' how to protect programmers from silly mistakes.

His key observation is what did not change. The abstract machine behind a programming language 'remained, however, a faithful slave, i.e. the nonsensible automaton perfectly capable of carrying out nonsensical instructions.' Raising the level of abstraction moved the boundary, but it did not make the machine understand intent. Programming stayed the use of a formal symbolism and still needed the same care.

This is a useful lens for any new abstraction layer. ORMs, configuration DSLs, low-code builders and declarative infrastructure tools all raise the level of the notation. The question to ask of each is whether it removes a class of mistakes, or only removes the visible syntax while the same mistakes pass through in a new form.

Error messages versus wrong answers

The most practically useful paragraph in the note concerns error detection. Dijkstra calls it 'a significant improvement that now many a silly mistake did result in an error message instead of in an erroneous answer.' Redundancy in the notation, such as declarations, type rules and syntax that must balance, turns some mistakes into refusals instead of silent output.

He then adds an aside that still reads as current: 'some people found error messages they couldn't ignore more annoying than wrong results'. When judging programming languages, he says, 'some still seem to equate the ease of programming with the ease of making undetected mistakes.'

Any team that has argued about strict compiler flags, linters that fail the build, or schema validation on input data has had this argument. A refusal costs you something you can see right away. A wrong answer costs you later, often in production, and often charged to someone else. An interface that never complains has not removed the errors. It has hidden them.

An interface is not a fixed division of labour

The core of the argument is a claim about interfaces. Supporters of natural language input argued that if the machine carried more of the burden, life would get easier for people. Dijkstra calls this sensible only 'provided you blame the obligation to use a formal symbolism as the source of your difficulties.'

His objection is that choosing an interface 'is not just a division of (a fixed amount of) labour, because the work involved in co-operating and communicating across the interface has to be added.' He adds, 'from sobering experience', that changing an interface can easily increase the work on both sides of the fence, 'even drastically so'. That is why he points to the growing preference for what he calls 'narrow interfaces'.

Read as engineering, this means a wide, ambiguous interface creates extra work. You have to clarify what was meant, confirm it, and then verify the result. A narrow, well-defined interface puts more work up front, because you must state exactly what you want. In return it removes most of that later back-and-forth. Natural language is about as wide as an interface can get.

The history-of-mathematics argument

Dijkstra supports the point with history. 'Greek mathematics got stuck because it remained a verbal, pictorial activity.' Moslem algebra, 'after a timid attempt at symbolism, died when it returned to the rhetoric style'. In his telling, the modern world emerged only once Western Europe freed itself from medieval scholasticism, which he calls 'a vain attempt at verbal precision!'. That release came through formal symbolisms designed by people such as Vieta, Descartes, Leibniz and, later, Boole.

Historians can argue with how compressed this is. The structure of the claim is still clear. Fields that tried to reason precisely in prose stalled, and fields that invented notation moved ahead. Dijkstra is effectively saying that natural language programming would be a deliberate step back to the rhetorical style.

Formal symbols as a privilege

The positive half of the argument is short. 'The virtue of formal texts is that their manipulations, in order to be legitimate, need to satisfy only a few simple rules.' Those few rules are 'an amazingly effective tool for ruling out all sorts of nonsense' that is almost impossible to avoid in a native tongue.

From this he draws his reversal. Instead of treating formal symbols as a burden, 'we should regard the convenience of using them as a privilege: thanks to them, school children can learn to do what in earlier days only genius could achieve.' He gives a concrete target: a 1977 technical report whose preface said 'even the standard symbols used for logical connectives have been avoided for the sake of clarity'. For Dijkstra that sentence shows exactly the misunderstanding he is attacking.

His sharpest line comes next. The 'naturalness' of native tongues 'boils down to the ease with which we can use them for making statements the nonsense of which is not obvious.' The fluency of natural language is the very property that lets mistakes go unnoticed.

The thought experiment: starting from prose

Dijkstra asks the reader to imagine that natural language had been the only way to get information into and out of computers from the start. His 'considered guess' is that history would have repeated itself. Computer science would consist mainly of 'the indeed black art how to bootstrap from there to a sufficiently well-defined formal system.'

He goes further. We would need 'all the intellect in the world to get the interface narrow enough to be usable'. Given human history, he guesses it might take 'a few thousand years' to do the job well enough. The number is rhetorical, not an estimate. The structural claim is the useful part: any serious natural-language system ends up rebuilding a formal layer underneath, because something has to decide exactly what an instruction means.

For engineers working with natural-language front ends today, this is the practical question. Where is the narrow interface in your system? Who specifies it, and how is the system's output checked against it? If nobody can answer, the system is resolving ambiguity on your behalf with no check, which is precisely what Dijkstra warned about.

Where the argument does not fit, and what to watch for

The note has limits, and reading it fairly means naming them.

  • It argues about specification, not every interaction. Searching, exploring and drafting do not need a formal contract. Dijkstra's target is instructing a machine to carry out a precise computation. Prose is fine where an approximate result is acceptable and a person reviews it.
  • The closing remark is a period opinion. The note ends with a 'Remark' on 'The New Illiteracy': a claimed decline in people's mastery of their own language, with scientific and government writing full of 'meaningless verbiage'. It reads as cultural complaint more than argument.
  • The history is compressed. The mathematics examples illustrate the point but do not prove it. Treat them as an analogy.

What does survive is a checklist for any natural-language layer placed in front of a system that has to be exact. Does the system turn ambiguity into an error, or into a guess? Is there a narrow, formal representation that a person can inspect before anything runs? Is the total work, including clarifying and verifying, actually smaller, or has it only moved? If the honest answers are 'a guess', 'no' and 'it moved', the note's title applies.

  • #Dijkstra
  • #EWD 667
  • #Programming
  • #formal notation
  • #narrow interfaces
  • #natural language programming

Comments

Add a comment
Sign in with Google to join the conversation