The earliest surviving grammar of Sanskrit, composed by the grammarian Panini around the 5th to 4th century BCE, a systematic treatise of nearly 4,000 rules (sutras) in eight chapters (adhyayas).
- The name means "eight chapters"; it codified the rules of classical Sanskrit, fixing the language so precisely that it changed little afterward.
- Panini is traditionally placed in the north-west (Shalatura, in the Gandhara region) and is dated before the Mauryas.
- The work uses an extremely compact, almost algebraic system of rules and meta-rules, and is admired in modern times as a model of formal description, even compared to computer-language grammars.
- It is a key source for the geography, society and material culture of its age, mentioning peoples, places and institutions of the pre-Mauryan north-west.
- Later grammarians built on it: Katyayana wrote the Varttika (supplementary notes) and Patanjali the Mahabhashya (the great commentary).
Panini-Ashtadhyayi as the first Sanskrit grammar, its "eight chapters" meaning, and the Panini-Katyayana-Patanjali sequence are clean static facts on ancient Indian intellectual achievement.
Patanjali the grammarian (author of the Mahabhashya, a commentary on Panini) is conventionally distinguished from Patanjali of the Yoga Sutras; the Ashtadhyayi is a grammar, not a religious or philosophical text.
Panini's Ashtadhyayi, the first Sanskrit grammar in eight chapters, later expanded by Katyayana and Patanjali.