A 5th-century-BCE grammarian formalised Sanskrit with ~4,000 rules — a system so precise it shaped modern computer science.
Pāṇini's Aṣṭādhyāyī derives every valid Sanskrit word from roots via ~4,000 ordered, recursive rules with meta-rules governing how they apply.
— Pāṇini, Aṣṭādhyāyī (c. 5th century BCE)
Formal grammars, generative linguistics, and notations like Backus–Naur Form (BNF).
A genuine, defensible parallel.
The Aṣṭādhyāyī is astonishing: a complete, generative description of a language as a system of ordered rules, with conventions for rule precedence, abbreviation symbols, and even something like 'if-then' conditioning — essentially an algorithm for producing correct Sanskrit. Linguists from Bloomfield to Chomsky have praised it, and it's frequently cited in computer science: the idea of generating an infinite language from finite rules, and notations resembling BNF used to define programming languages, have clear kinship with Pāṇini's method.
This is solid and widely acknowledged. The fair note: Pāṇini didn't 'invent computing,' and direct historical influence on BNF is debated; the relationship is conceptual. But as the world's first formal generative grammar, 2,500 years early, it fully earns the awe.