Part one of a three-part blog on Panini's Ashtadhyayi and computational linguistics by CIKS fellow, and academic Shagun Sinha, for the modern reader.
If your school curriculum ever had Sanskrit as a subject, chances are you still remember the three magical words - paThati paThataH paThanti. Whether you were in awe of it or found it awful, is a different point of discussion. But you did come across Sanskrit for a year or so and probably never heard of the language again. Until…years later, when a possible uncle sent a long Whatsapp forward to you telling how Sanskrit is the most relevant language for computers and that NASA is already working on developing software using Sanskrit. I am sure your uncle never put on a researcher’s cap to dig deeper into the topic. He is all ready to discuss that forward at the next family gathering with no relevant research at hand. But hey, here you are already a step ahead of him - much better prepared to do something we rarely do with Whatsapp forwards - verify or refute them substantively! If you have ever wanted to know the what and why of the varied views about Sanskrit and its connection with computers, I would like to assure you, you have arrived at the right place.
This post is the first of a series of three blogs that will summarize the history of academic discussion around Sanskrit and computational thinking. Sanskrit texts belong to various fields like Mathematics (Shulva sutras), Sociology (Smriti texts), etc. However, the connection of Sanskrit with computational thinking that you mostly hear of, is linked with Sanskrit grammar. The goal of this blog is to summarize the history of Panini’s grammatical tradition so that you may understand how it links to claims of computational thinking and development.
First things first. Panini, who?

Panini, an ancient seer who lived in North-western India, composed a Sanskrit grammar text called the Ashtadhyayi (now on, AS). The two words in Ashta-adhyayi - namely, Ashta and Adhyaya translate to eight and chapter, respectively. Thus, this text of eight chapters contains rules about Sanskrit syntax, semantics, and other related topics. Utter the word ‘grammar’ to a Sanskrit student and she is most likely to think of only the AS. Therefore, it is a coveted text in academic circles.

But how did it gain such popularity? The answer lies in the compositional finesse of AS. AS has a scientific structure of composition. In simpler words, AS does not look like a regular textbook with serial chapters. Each of its chapters and its contents has a scientific basis. Additionally, Panini deployed the choicest linguistic tools to analyze Sanskrit for its grammatical rules.
The brevity of sutras and structure of Ashtadhyayi have placed Ashtadhyayi as a computational artefact (Kiparsky 1, Fillioazat 131, Jha para 1). Undoubtedly, Panini’s AS is a linguistic masterpiece. However, his is not the only contribution that makes one wonder about the magic of Sanskrit. Sanskrit grammar has had a long tradition of thinkers. This blogpost summarizes the tradition of grammar that led to Panini’s grammar.
Before I present the summary of Sanskrit grammar, here is a short background of how Sanskrit grammar came to us.
Emergence of Sanskrit Grammar
All discourses in Sanskrit have emerged from one or more discussion(s) around the Vedas. Vedas are the key source of ancient discourses in the Indian subcontinent. Rigveda, Yajurveda, Samaveda, and Atharvaveda together represent the reflections and observations of Vedic Seers. They contain Vedic mantras which are collections of the Seers’ meditative observations about the world and Universe, many of them in the form of salutations to the divine forces of Nature. With time, corruption of these verses was feared as a result of which six auxiliary sciences or Vedangas - namely, Shiksha, Kalpa, Vyakarana, Chhanda, Jyotisha, Nirukta - were developed. Each of these six Vedangas dealt with a particular aspect of Vedic mantras which it aimed to preserve. The process of preservation called for a detailed study and analysis of the mantras and eventually each Vedanaga became a separate branch of scientific analysis.
Additionally, the knowledge of the Vedangas was preserved in one or more text(s) composed orally. So, Shiksha analyzed the phonetics aspects and preserved them in Pratishakhyas Pratishakhyas. Kalpa analzyed the processes and rituals associated with Vedic sacrifices and preserved them in four types of texts - Grihya Sutra, Dharma Sutra, Shulva Sutras, and Shrauta Sutras. Jyotisha analyzed the time and place suitability of Vedic sacrifices and preserved the ideas in Lagadha’s Jyotish-Shastra. Likewise, two Vedangas studied the words of Vedas, namely, Nirukta or Etymology, and Vyakarana or Grammar. In the present-day world, we study these texts for their analysis, with the goal of adapting the sciences to modern-day research, to the best possible extent.
Vyakarana or Grammar, the most important Vedanga as per the Paniniya Shiksha (verse 42), is the object of this blog. I understand that each Vedanga deserves a special study. But as a linguist and a language researcher, I am fascinated the most by grammar. Once Grammar became a practice, various thinkers evolved. The next section will give you an idea of the chronology of texts in this tradition.
Sanskrit Grammatical Tradition
Vyakarana or Grammar is Shabdashastra, the science of words. Grammar aims to prevent the corruption of Vedas. As per the Mahabhashya, the five prayojana of grammar are - raksha (to protect the Vedic thought and knowledge), uha, agama, laghu (to attain brevity), asandeha (to eradicate any ounce of doubt). Hence, Sanskrit grammatical tradition has five core objectives with which different acharyas or scholars have composed texts. Among the many grammarians of this tradition, three have gained special recognition, namely, Panini, Katyayana and Patanjali who are also called the trimuni of Sanskrit grammar. Katyayana and Patanjali are post-Paninian commentators who clarified the ambiguous areas of the text.
Panini is said to have existed around 400 BCE. However, some scholars argue that he was a contemporary of Yaska and this opinion places him in the 800 BCE. Likewise, Katyayana’s time-period is popularly accepted to be around the 3rd century BCE, that is, 200 BCE (Sharma 11). However, the window of his time period may have been extended until 5th century BCE (Kapoor 26).
System of Padapatha, Niruktas, and Pratishakhyas
Vedic mantras were continuous sounds with no pause or split between any two elements. Mantras in this stage were/are called Samhita. Grammarians believe these mantras were received by Brihaspati from Brahma but could not be analyzed for comprehension in that continuous form. As a result, the continuous sound of Vedas was split into individual padas (words), a practice which is known as padapāṭha.
To understand better, picture this: You are taking notes in a class but much of what the teacher is speaking way too fast and you are merely noting down the sounds as you perceive them. These noted-as-they-were sounds may be called Vedic mantras in the Samhita stage. But this knowledge cannot be comprehended yet. You must make sense of the individual units to remember things better, be able to explain them to others, and to think on them further. Deriving comprehensible words from those notes is your version of the padapatha.
Padapatha is the first attempt at deciphering the knowledge contained in mantras. However, it is not the only step there. Vedic seers and scholars further introduced processes to study padas. The three other stage of comprehension included study of accentuation, study of etymology, and study of roots and prefixes - a task done by Shiksha, Nirukta, and Vyakarana, respectively.
Nairuktas, the creators of Nirukta, are often considered Pre-paninian thinkers who impacted grammar greatly. Yaska, the first etymologist, composed Nirukta which arrived at the etymologies of Vedic words. Nirukta etymologies provide a contexts for Vedic words and help in understanding them better (Deshpande, 104-105). Likewise, the Shiksha texts, Pratishakhyas, analyze Vedic sounds and svara-samskara (Deshpande 46-50). The places of articulation, accentuation rules of Vedic mantras are the core points of analysis of Pratishakhyas. A lot of it was inherited by Grammar later.
Vyakarana gets its name from ‘vyakriti’ - a stepwise detailed analysis of words mostly in the form of stems, roots, and prefixes and suffixes. After receiving them from Brahma as noted earlier, Brihaspati is said to have given his knowledge of mantras to Indra who introduced pada-vyakriti, i.e., pada analysis. Thus, Indra is the first Sanskrit grammarian (Deshpande 21-35). However, such an analysis also requires principles of accent and meaning which it acquires from Shiksha/Pratishakhya and Nirukta.
To understand better, go back to your notes again. You want to understand every word of your teacher. Hence, you do three quick things while reviewing the notes. First, you not only pick out comprehensible words but also dig deeper into the accentuation/tone your teacher used in the lecture - you are mindful that a slight change in tone changes the meaning of what she says. This is the Shiksha part. Second, for better memorisation of concepts, you develop an etymology. For example, ‘driver’ - somebody who ‘drives’, biannual - occurring twice (bi) in a year, etc. These etymologies have given you a better semantic understanding of the words you dug out. Third, you split many words into roots and stems to better comprehend the words which come from the same root, this is where you are doing the grammatical analysis. Such as Drive+R = driver, teach+R = teacher, etc. But be mindful, you have to keep the accentuation and etymologies in mind even while developing grammatical splits.
Likewise, Sanskrit grammar existed in a symbiotic relationship with other Vedangas, chiefly, with Nirukta and Shiksha. While AS discusses morphological rules, it does rely on rules of etymology and accent as derived from the respective Vedangas. So far so good. “Do we know all of this from the AS?”, some may ask. The answer is partly. But we mostly know of this relation through Acharyas and their commentaries on the AS and a few other sources like koshas or dictionaries, wordlists, and similar linguistic resources.
The subject matter of the Ashtadhyayi
The AS contains morphological formulas, called sutras. Sutras, in other words, are rules for forming different types of words in Sanskrit. The rules for forming paThati, paThataH, paThanti, are also one of the 4000 sutras of the text. AS lists word roots, stems, suffixes, prefixes, and the appropriate rules for connecting them. Additionally, AS also includes sections on accents of words since Vedic language was accented and the meanings of words changed with different accents. Each of the eight chapters deals with a certain class of word formation - for example, the third chapter consists of rules on conjugation while the fourth chapter deals with non-verbal declensions, etc. The present-day grammar of Sanskrit is chiefly based on the rules given by Panini.
Sanskrit, however, is not a term Panini seems familiar with. Panini has analyzed and described the language of his times which he calls, Bhasha, along with the language of Vedas termed, Chhandas. Panini never uses the word ‘Sanskrit’. He takes the opportunity of compiling a grammar of Vedic language to also describe the language of his time, Bhasha. As the Mahabhashya conveys, the idea of grammar is to analyze classical and Vedic words of Bhasha. He, like Panini, terms language as Bhasha and not ‘Sanskrit’. It is, then, deducible that Panini was speaking to his audience in some universally understood terms - the grammatical tradition speaks of Bhasha analysis.
Panini cites 10 predecessors in AS which is believed to be the compilation of the grammatical ideas of his time. These scholars include, Apishali, Shakatayana, Sphotayana, etc. We also have the names of 11 other grammarians who were not cited by Panini but have been traced from other texts.
While it is not possible to trace the exact ideas or points that Panini inherits from these scholars, we know that he knew of them or that they preceded him because we find their names in other lists that Panini constructs (more on this in the next blog) (Mimansaka).
Note, there are pre-Paninian Grammarians not found in AS such as Bhaguri, Paushakarsadi, Charanya, Santanu, Vaiyaghrapadya, Madhyandini, Raudhi, Saunaki, Gautama, Vyadi, and Kashakritsana.
So what?
“All well and good. And lovely grammatical tradition there! But what does my Uncle’s Whatsapp forward have to do anything with this?” you may ask. I get you; I get you.
There is one more thing we have not talked about yet. Remember the five prayojanas of grammar spoken of earlier? Apart from raksha, the laghu or laghava objective is a highly useful quality of grammar. Laghava or brevity is every grammarian’s love and Panini is a pro at achieving it. In the AS, Panini is analyzing language by using the least number of letters - but never over- or underdoing it. Panini deserves the credit for systematizing long morphological processes in the shortest manner possible without hurting clarity. Brevity, I am convinced, is the edifice on which all other purposes of grammar stand. Brevity protects Vedas. As I will explain in the next blog, the structure of AS is likened to an algorithmic process. Brevity is what makes that comparison, and in turn your Uncle’s whatsapp message forward, possible and true to a great extent. That Panini built this system alone might or might not be true. But his tradition surely helped him develop the system that the world today remembers him for. You might want to read Stanford Professor Paul Kiparsky’s Economy and Construction of Shiv Sutras to get a better idea.
Conclusion
We now know that Panini is not the first Sanskrit grammarian nor is he the last. The AS forms a part of a larger grammatical tradition in Sanskrit which focused on detailed scientific study of words of the language. The idea here is that AS is a popular as well as practical text due to its tools of brevity and analysis. Additionally, Panini does take some ideas from his predecessors. This post is the first blog that can help you remember the chronology of Acharyas and texts right.
‘What is the algorithmic system of AS’ will be a point of discussion in the next blog. Until then, punar milamaH (we will meet again). In the next blog of this series, watch out for essay on scholarly debates about Panini’s tools of brevity, elements of computational thinking found in AS and where and how to start learning Sanskrit grammar.
References:
Briggs, Rick. "Knowledge representation in Sanskrit and artificial intelligence." AI magazine 6.1 (1985): 32-32.
Despande, G T. Pre-Paninian Grammar. Popular Prakashan. New Delhi: 2011.
Filliozat, Pierre-Sylvain. "(01) Formalisation and Orality in Panini's Astadhyayi." (1993).
Jha, Girish N. "The system of Panini." Language in India 4.2 (2004).
Kapoor, Kapil. Dimensions of Panini Grammar. D K Printworld: New Delhi, 2005.
Text and Interpretation. D K Printworld: New Delhi, 2006.
Kiparsky, Paul. "Economy and the Construction of the Sivasutras." Paninian Studies. Prof. SD Joshi Felicitation Volume. Ann Arbor, Michigan (1991).
Sharma, Rama Nath. Paninian Tradition of Grammar and Linguistics. D K Printworld.
Paniniya Shikha. https://sanskritdocuments.org/doc_z_misc_major_works/pANinIyashikShA.html
The Shulva Sutras: https://archive.org/details/sulba-sutras-critical-study-k.-jayashankara/mode/2up
The Digital Version of the Sutras of the Ashtadhyayi: https://ashtadhyayi.com/sutraani
This blog has been created as part of the CIKS Summer Fellowship 2024. Each fellow will share a series of blog posts summarizing their projects from the fellowship. Keep an eye out for the exciting work the fellows are doing.
Meet the Author: Shagun Sinha

Dr. Shagun Sinha works as an Assistant Professor of Sanskrit at Amity University, Noida. Her research interests span across Paninian grammar, computational linguistics (CL), and language pedagogy. She completed her PhD in Sanskrit with a focus on CL from Jawaharlal Nehru University last year and worked briefly at an AI startup in Bangalore before commencing her journey as an Assistant Professor.
At CIKS, Shagun is working on a comprehensive literature survey in Paninian grammar and CL. The resultant survey will list the major research works, problem areas in the interdisciplinary field of Paninian grammar and CL to serve as a comprehensive guide for future researchers.