The journal Portraits

Four thousand rules and no paper

Around two and a half thousand years ago, a grammarian named Pāṇini described his language so exactly that modern computer scientists argued over whether to name a piece of their own notation after him. He left almost four thousand rules — and, as far as anyone can tell, not a single page.

Somewhere in the northwest of the Indian subcontinent — in a town called Śalātura, near the Indus, in what is now Pakistan — a man set out to write down how his language worked. We cannot be sure when. Scholars place him somewhere around the fifth or fourth century bce, and admit the guess is loose by a century or two in either direction. We are surer of the town than the date: a seventh-century Chinese pilgrim, Xuanzang, reported a statue of him still standing there, and a much later inscription calls him simply Śalāturiya — “the man from Śalātura.”

His name was Pāṇini, and the thing he made is one of the strangest objects in the history of human thought. It is a grammar of Sanskrit called the Aṣṭādhyāyī — the word means “Eight Chapters” — and it consists of just under four thousand short rules. Not four thousand pages of explanation. Four thousand rules, most of them only a few syllables long, locking together into a machine that, fed the raw pieces of the language, produces correct Sanskrit words and sentences and refuses to produce wrong ones.

Twenty-four centuries later, people who build programming languages for a living would look at it and feel a shock of recognition.

A grammar you could almost run

Most grammars describe a language the way a nature guide describes birds: here is the past tense, here is how plurals usually form, here are some exceptions, good luck. Pāṇini did something closer to engineering. His grammar is generative — you start with basic ingredients (verbal roots, suffixes, a store of meanings) and the rules derive the finished word step by step, each rule firing when its conditions are met. The linguist Paul Kiparsky has called it “the most complete generative grammar of any language yet written.” It was finished before the Parthenon was built.

To pack a whole language into so little space, Pāṇini invented tools that any programmer would find familiar. He built a technical shorthand — a metalanguage sitting on top of ordinary Sanskrit — so that his rules could talk about the language with ruthless brevity. The grammar opens with fourteen tiny lines, the Śiva Sūtras, that list the sounds of Sanskrit in a cunning order. Because of that order, a single two-letter code can stand for a whole class of sounds: one abbreviation means “every vowel,” another “every consonant that behaves this way.” It is, in effect, a lookup table, written in the fifth century bce.

On top of that he laid rules that behave like code: rules that only fire in a certain context, meta-rules that govern how the other rules are applied, and a system for deciding what happens when two rules both want to act at once — which should win, and which should step aside. Handle conflicts, define scope, factor out the shared parts: a software engineer reading a summary of the Aṣṭādhyāyī is reading a description of their own trade.

Written on nothing

And here is the detail that should stop you. Pāṇini almost certainly never wrote any of it down — not because he couldn’t have, but because that was not how this knowledge lived. The learned tradition of ancient India was oral. The Vedas had been carried in memory, word for exact word, for many generations, with elaborate recitation techniques to guard against a single syllable drifting. Pāṇini’s grammar was built the same way: to be recited and memorised, passed from teacher to student by voice.

That single fact explains the grammar’s obsessive compression. When your text must live inside human memory, every syllable is a cost paid by every student forever, and brevity becomes almost a moral value. The later tradition preserved a famous boast about the mindset: that a grammarian rejoices at saving half a short vowel the way a parent rejoices at the birth of a child. Pāṇini wrote for the ear and the memory, and the result is a work of engineering with no blueprint — a four-thousand-part mechanism that existed, for centuries, only as a thing people knew by heart.

He described one of the most intricate languages on earth in less space than this article, and the first readers held the whole of it in their heads.

The machine that looked like a machine

When Western scholars finally studied the Aṣṭādhyāyī closely, their admiration was close to disbelief. The American linguist Leonard Bloomfield, one of the founders of modern linguistics, called it “one of the greatest monuments of human intelligence.” What struck him and others was not that it was old, but that it was right — formal, explicit and exact in a way that European grammar would not attempt until the twentieth century.

Then came the computers, and the sense of recognition sharpened into something concrete. In the late 1950s, two engineers, John Backus and Peter Naur, devised a precise notation for defining the syntax of programming languages — the rules that say what counts as a valid line of code. It is called Backus–Naur Form, and every modern language is specified with something like it. In 1967 a computer scientist, Peter Zilahy Ingerman, wrote a short note to his colleagues suggesting that the notation ought to be renamed “Pāṇini–Backus Form,” because the Indian grammarian had used essentially the same idea — rules that rewrite symbols into other symbols — more than two thousand years earlier.

It is a lovely story, and it should be told with one honest caveat. Specialists such as the Sanskritist Dominik Wujastyk have pointed out that the comparison flatters by simplifying: Pāṇini’s system, with its rule-ordering, its blocking and its layered scope, is in several ways richer and messier than the tidy formalism of Backus–Naur Form, not a neat ancestor of it. The truth is more interesting than the slogan. Pāṇini did not invent the programming language. He arrived, by thinking hard about ordinary speech, at the same deep intuition a programmer has: that something as alive and slippery as a language can be captured by a finite set of explicit rules, if only the rules are exact enough.

The puzzle that waited two thousand years

The grammar is so tightly built that it can still surprise the people who study it. In December 2022, the University of Cambridge announced that one of its PhD students, Rishi Rajpopat, had resolved a problem that had tangled readers of Pāṇini for a very long time. It concerns a meta-rule — the instruction that decides which of two competing rules wins when both apply to the same word. For centuries the standard reading had led to wrong forms unless commentators patched it with extra exceptions. Rajpopat argued that a single word in Pāṇini’s meta-language had been misunderstood, and that read correctly, the grammar resolves the conflict cleanly, with no patch at all.

The announcement travelled the world, under headlines about a 2,500-year-old puzzle finally solved. Within the field the reception was more measured — some scholars argued the traditional commentators had understood the rule perfectly well, and the debate over Rajpopat’s reading is not fully settled. But the episode makes a quieter point beautifully: this is a text so machine-like that a disagreement about it can turn on the exact meaning of a single operator, the way a bug can hide in one character of code. People are still, in effect, debugging a program written before the Buddha’s teachings were first written down.

The paradox in one line: the most exact grammar ever written was a description of something no one in Śalātura had ever studied — the speech of people who spoke perfectly well without knowing a single one of Pāṇini’s rules.

Where vocabla fits

Which is the thing to hold on to. Pāṇini did not invent Sanskrit, and he did not teach anyone to speak it. He described what fluent speakers already did — drew the map of a territory that was already crowded with people who travelled it without a map. Every astonishing rule in the Aṣṭādhyāyī is a rule those speakers were already following, flawlessly, with no idea it existed.

That gap — between knowing the rule and knowing the language — is the oldest truth in language learning, and the easiest to forget. You can memorise a grammar table and still freeze in a conversation; a child who has never heard the word “grammar” will outspeak you in a year. The rules are real, but they are not how the language gets into a head. They get in the way Pāṇini’s own rules got into the first speakers he studied: through use, met again and again, in context, until the right form simply arrives without a rule being consulted at all.

This is the whole reason vocabla shows you words inside real sentences rather than as bare pairs on a card. A sentence carries the quiet machinery — which words keep company with which, which ending the situation wants, the collocations no translation ever lists. You absorb the rule by meeting its results, over and over, exactly as every fluent speaker in history has done, including the ones whose effortless speech a man in Śalātura once sat and listened to until he could write down, in four thousand rules and no paper, the machine running quietly behind it.


Sources & further reading: encyclopedic accounts of Pāṇini and the Aṣṭādhyāyī (Encyclopedia.com; the MacTutor History of Mathematics archive, University of St Andrews); Paul Kiparsky and Leonard Bloomfield on the grammar’s significance; P. Z. Ingerman, “Pāṇini–Backus Form Suggested,” Communications of the ACM (1967), with Dominik Wujastyk’s caution against over-reading the analogy; and the University of Cambridge’s December 2022 announcement of Rishi Rajpopat’s thesis, alongside the ongoing scholarly discussion of it. Dates for Pāṇini are traditional and disputed.

Portraits