← BACK TO CONTENTS THE LITERARY MACHINE CHAPTERSEPUBPDF

PART I · THE IMAGINED MACHINE / CHAPTER 01 OF 16

How literature invented computers before computers existed · ~12 min read

Download chapter Markdown ↓

The Machine That Dreamed of Words

How literature invented computers before computers existed

1. A professor with an extraordinary invention

In 1726, the Irish writer Jonathan Swift published Gulliver's Travels.

Most readers remember its tiny people, enormous giants and fantastical voyages. But deep inside the book, in the account of the imaginary island of Laputa and its associated territories, Swift described something astonishing.

At the Academy of Lagado, Gulliver encounters a professor who has invented a machine for producing books.

The professor's ambition is magnificent. He intends to make it possible for people to create works of philosophy, poetry, politics, mathematics and theology without requiring exceptional knowledge or genius.

His invention consists of a large frame containing numerous small wooden blocks. Each block has words written on its surfaces. The blocks are connected by wires, and handles around the frame allow operators to rearrange them.

When the handles are turned, the words change position.

Assistants examine the results. Whenever a group of words appears to form a useful fragment of a sentence, they record it.

With enough turning, examining and copying, the professor believes the machine will eventually produce entire books.

There is something irresistibly ridiculous about the scene. The machine does not understand language, and the assistants spend their time searching for occasional fragments of sense in an ocean of nonsense.

Swift intended the invention as satire. He was mocking intellectual institutions, empty academic ambition and the assumption that producing knowledge could be reduced to mechanical procedures.

Yet the machine has an unexpected importance.

It is an early fictional example of mechanised text generation.

It does not contain electronics. It has no processor, memory chips or software in the modern sense. Nevertheless, it separates the production of written material into three operations: generating combinations, identifying acceptable results and recording those results.

Those operations will become central to computational literature.

2. The extraordinary power of a simple rule

To understand why Swift's invention matters, imagine creating a much smaller version.

Suppose we prepare four collections of words.

CollectionPossible words
AThe, A, Every
Bmachine, poet, ghost
Cdreams, calculates, remembers
Dendlessly, silently, tonight

We construct a sentence by choosing one word from each collection.

For example:

Every machine remembers silently.

Or:

The ghost calculates tonight.

Neither sentence has been written individually by an author. Instead, we have defined a mechanism capable of producing sentences.

Since each collection contains three possibilities, the number of combinations is:

3 × 3 × 3 × 3 = 81

There are 81 possible results.

The important point is not that 81 is a large number. It is that we have moved from writing individual sentences to describing a system that can produce sentences.

If we expand each collection to ten possible words, the number of combinations becomes:

10⁴ = 10,000

If we introduce ten positions, each containing ten possibilities, we obtain:

10¹⁰ = 10,000,000,000

Ten billion combinations.

The amount of writing required to create the system has grown modestly, but the amount of writing the system could generate has grown enormously.

This is one of the defining characteristics of computation: a relatively compact set of rules can describe an immense range of possible outcomes.

Four word positions each offer three alternatives, producing 81 sentences for a reader to interpret.

Enable JavaScript to use this experiment. The chapter text remains readable.

The little experiment also demonstrates something Swift understood.

The machine can generate grammatically plausible sentences without knowing what any of them mean.

Some combinations are poetic. Others are ordinary. A few suggest ideas we might wish to develop into stories.

But the machine has no opinion about which are best.

That problem is much deeper than it first appears.

3. What does it mean to understand?

Consider two sentences:

The machine remembers silently.

The silence remembers mechanically.

Both are grammatically acceptable. Both could appear in a poem.

But what do they mean?

A human reader might interpret the first as describing a computer preserving records without revealing them. The second might suggest trauma, memory or the repetition of history.

The meaning emerges partly from the words and partly from the experiences and expectations of the reader.

A simple word-combination machine has none of that interpretive understanding.

It manipulates symbols according to arrangements defined by its designer.

This introduces a distinction that will occupy computer scientists and philosophers for centuries: the difference between syntax and semantics.

Syntax concerns the structure and arrangement of symbols. Semantics concerns meaning.

A system may obey syntactic rules correctly without necessarily understanding what its symbols represent.

For example, a calculator can manipulate the symbols in:

7 × 8 = 56

without needing a human concept of seven apples, eight days or 56 people.

Similarly, a text generator might create a sentence about a lonely ghost without experiencing loneliness or believing in ghosts.

Modern artificial intelligence makes this question more complicated, because sophisticated systems can use contextual relationships, perform reasoning tasks and produce strikingly coherent language. Whether that amounts to understanding, and what kind of understanding might be involved, remains debated.

But the basic question is already present in Swift's imaginary machine.

Can meaningful language arise from operations that do not themselves require an understanding of meaning?

4. The dream of a universal language

Swift was not alone in imagining that ideas might be manipulated mechanically.

In the seventeenth century, the German philosopher and mathematician Gottfried Wilhelm Leibniz imagined a universal symbolic language for reasoning.

His ambition was that disagreements could eventually be resolved through formal calculation.

Instead of arguing endlessly, two scholars might translate their claims into precise symbols and calculate whether the reasoning was valid.

The dream was not simply to build a better adding machine.

It was to make reasoning itself systematic.

Leibniz also developed a mechanical calculator and worked extensively with binary arithmetic, the numerical system built from just two symbols: zero and one.

Binary notation would later become fundamental to digital computing.

But the more radical idea was philosophical.

If reasoning could be expressed through symbols, and symbols could be manipulated by rules, then some parts of thinking might be automated.

There is an important qualification here. Formal calculation can establish conclusions only from the premises and rules supplied to it. Translating messy human ideas into a complete, reliable logical system is itself a formidable problem.

Still, the dream endured.

It would eventually influence mathematical logic, the foundations of computer science and the development of artificial intelligence.

A trial model of Babbage’s Analytical Engine at the Science Museum, London.

A trial model of Babbage’s Analytical Engine at the Science Museum, London. Credit: Daderot. Source. [CC0](http://creativecommons.org/publicdomain/zero/1.0/deed.en). Resized; no crop.

5. The machine becomes real

In the nineteenth century, Charles Babbage designed the Difference Engine and subsequently the much more ambitious Analytical Engine.

The Analytical Engine was intended to perform general-purpose calculations under the control of instructions. Its design incorporated ideas recognisable to modern computer scientists: a processing mechanism, storage for values and a means of controlling sequences of operations.

Babbage had not constructed a fully working Analytical Engine. Nevertheless, its design contained the essential conceptual leap from a machine built for one particular calculation to a machine that could perform different calculations according to its instructions.

One of the people who recognised its deeper significance was Ada Lovelace.

In 1843, Lovelace published her translation of an Italian account of Babbage's machine, accompanied by extensive notes.

In those notes she described a method for calculating Bernoulli numbers, commonly recognised as an important early published computer program.

But her most remarkable insight was broader than mathematics.

Lovelace understood that the operations of a calculating machine need not be limited conceptually to quantities. If the relationships between other kinds of objects could be expressed formally, the machine might manipulate those relationships too.

She even considered the possibility of a machine composing elaborate pieces of music, provided the underlying relationships could be represented in a suitable form.

That was an extraordinary prediction.

A machine designed around mathematical operations might, in principle, produce art.

Swift's fictional professor had imagined manipulating words mechanically.

Lovelace recognised that programmable machinery might manipulate symbolic structures of many kinds.

The two ideas were not identical, and there is no need to claim a direct line of influence between them. But viewed from the twenty-first century, they illuminate two sides of the same possibility.

Information can be represented as symbols.

Symbols can be manipulated by rules.

And some of the results can be interpreted as art.

Instructions guide rule-based operations on encoded information, yielding a result people can interpret as numbers, music or words. Conceptual diagram, not a historical reconstruction.

6. Is a program a kind of story?

There is another curious similarity between writing fiction and writing computer programs.

Both activities begin by inventing a possible world.

A novelist decides which characters exist, what they know, what they want and what can happen to them.

A programmer decides which objects exist within a system, what information they contain, what operations are possible and what happens when particular conditions arise.

Both must pay attention to consistency.

Suppose a detective has been locked in a room.

A story must establish how she escapes, whether someone opens the door, whether she discovers a hidden passage or whether she remains trapped.

A computer program must likewise define how its system changes from one condition to another.

In programming, we call a description of a system at a particular moment its state.

A story also has a state, even if we seldom use that word when discussing literature.

A character is alive or dead. A secret is known or unknown. A door is locked or open. A treasure is hidden or discovered.

The plot changes these conditions.

Consider this tiny example in Python:

door_locked = True
detective_has_key = False

if detective_has_key:
    door_locked = False
    print("The detective opens the door.")
else:
    print("The detective remains trapped.")

This is executable code, but it also describes a miniature dramatic situation.

The detective has a problem. There is a condition governing its solution. The outcome depends upon the state of the fictional world.

Of course, a genuine story needs much more than a few Boolean variables. It requires character, atmosphere, causation, uncertainty and emotional significance.

The code does not explain why the detective is trapped, whether she is frightened, or what opening the door will cost her.

Nevertheless, the resemblance is worth exploring.

A program specifies possible events through rules. A conventional story presents a selected sequence of events.

One describes a space of possibilities. The other normally chooses a path through it.

Interactive fiction will eventually bring those two approaches together.

A locked door branches to two outcomes: no key leaves the detective trapped; possessing the key opens the door.
A story can be represented as states and transitions.

Enable JavaScript to use this experiment. The chapter text remains readable.

7. The problem of the infinite library

We can now return to Swift's machine and ask a more difficult question.

What would happen if we enlarged it sufficiently?

Imagine a machine capable of generating every possible book of a particular length, using a fixed alphabet.

Some of the results would contain nonsense.

Others would contain familiar sentences, complete stories and accurate scientific explanations.

There would be books describing events that never happened, books describing events that will happen and books containing convincing but entirely false explanations of the universe.

If the system generated every possible arrangement, somewhere in its output would be a perfect copy of a book that has already been written.

There would also be copies differing by a single letter.

And copies differing by two letters.

And countless variations.

This thought experiment takes us towards The Library of Babel, the celebrated 1941 story by the Argentine writer Jorge Luis Borges.

Borges describes a universe consisting of a seemingly endless library. Its books contain combinations of symbols, and its inhabitants search desperately for meaning among the overwhelming number of possible texts.

The story is not about an electronic computer. But it offers one of literature's most powerful explorations of information, combinatorics and the difficulty of distinguishing knowledge from noise.

The library contains answers, or at least texts that appear to be answers.

Yet their existence does not make them useful.

A correct explanation buried among innumerable incorrect explanations presents an extraordinary problem.

How can anybody discover which text deserves to be believed?

This is an early literary anticipation of a central challenge of the information age.

Producing information is not the same as discovering truth.

And possessing enormous quantities of text is not the same as possessing knowledge.

8. The mathematics of impossibility

Let us make the library's problem more concrete.

Suppose every book contains exactly 1,000 characters and each character can be one of 30 symbols.

The number of possible books is:

N = 30¹⁰⁰⁰

That is approximately:

N ≈ 10¹⁴⁷⁷

For comparison, the observable universe contains roughly 10⁸⁰ atoms, according to a commonly used order-of-magnitude estimate.

The number of possible books in our tiny library exceeds that estimate by an almost incomprehensible margin.

Even if we could generate billions of books every second, we would not make a meaningful dent in the total.

The problem is not merely insufficient computing power.

It is that the space of possibilities grows exponentially.

This is called combinatorial explosion.

The same phenomenon appears in chess, cryptography, mathematics, evolutionary biology and artificial intelligence.

Whenever a system has many independent choices, the number of possible combinations can grow far faster than our ability to examine them.

Literature anticipated this difficulty before computer science existed as a modern academic discipline.

Borges transformed it into a nightmare: a universe in which the abundance of information makes the discovery of meaning almost impossible.

With thirty symbols, one position yields 30 strings, two yield 900, three yield 27,000 and a thousand yield approximately ten to the power 1477.

Enable JavaScript to use this experiment. The chapter text remains readable.

9. The machine that needs a reader

Swift's mechanical author, Babbage's programmable engine and Borges's infinite library share a subtle property.

They all separate the generation or manipulation of symbols from their human interpretation.

Swift's machine needs assistants to recognise useful phrases.

Babbage's engine needs people to specify operations and understand their results.

Borges's library needs readers to search, compare, interpret and decide what to believe.

We can therefore identify three distinct activities:

Generation

Produce symbols, combinations or outputs.

Selection

Determine which outputs are relevant, valid or interesting.

Interpretation

Assign meaning, context, significance and value.

Modern computational systems can participate in all three activities, and their boundaries are increasingly difficult to draw. But the distinction remains useful.

It explains why a generator producing a billion random sentences is not automatically a great novelist.

The ability to produce possibilities is valuable.

The ability to recognise meaningful possibilities is also valuable.

And the ability to make those possibilities matter to someone is a further challenge.

Literature has been investigating that relationship for centuries.

10. The first great question

We began with a professor turning handles on a machine.

He hoped to manufacture knowledge without the effort of thinking.

By the end of our journey, we have encountered mechanical computation, formal reasoning, symbolic representation and a library containing more possible books than anyone could ever read.

What links them is a deceptively simple proposition:

Language can be treated both as something that means and as something that can be manipulated.

That dual nature makes computational literature possible.

Words are not numbers, yet they can be encoded numerically.

Stories are not equations, yet aspects of their structure can be described mathematically.

Creativity is not simply random combination, yet new combinations are often part of creative discovery.

The computer enters literature not merely as a machine for calculating. It enters as a challenge to our assumptions about what language is and what authors actually do.

And that leads to the next stage of our investigation.

What happens when the imagined machine stops rearranging words and begins to think?

Questions to take away

  1. If a machine produces a beautiful poem by randomly combining words, does the poem become less beautiful when we discover how it was made?
  2. Is there a meaningful difference between a writer selecting words and a programmer selecting rules that generate words?
  3. Could a library containing every possible book be less useful than a library containing only a thousand carefully chosen books?
  4. Does understanding a sentence require consciousness, or is sufficiently sophisticated symbolic processing enough?

A small experiment: Invent a five-word sentence generator. Give each position four possible words. Calculate how many sentences it can produce, then inspect twenty of the results. How many make grammatical sense? How many are interesting? How many would you want to turn into stories?

That distinction between possible, meaningful and valuable is at the heart of this study.

Up next — The Thinking Engine

From mathematical logic and Alan Turing to Asimov's Multivac, Clarke's HAL 9000 and the question of whether a computer can genuinely think.