The Middle Indo-Aryan languages first came into use as vehicles for the teachings of Buddha and Mahavlra, but the first examples recorded in writing are the inscriptions of Asoka. Particular interest attaches to these, since they are recorded in various local dialects, of which there are three main varieties, the eastern or Magadhi, the western, and the north-western.
The Buddhist and Jaina scriptures were at first circulated in Magadha, and, of course, orally, but this dialect seems to have been of somewhat limited extension, and, in comparison with the more average type of Prakrit current in the central and western regions, rather aberrant. Consequently when these religions spread over all norths India a change in linguistic practice became necessary.
The Theravada School adopted a straightforward western type of dialect, which came to be known as Pali, into which the scriptures were transcribed, not without considerable traces remaining of the original Magadhi. Other local languages were also used, but the only example still remaining is a version of the Dhammapada in the Gandhara dialect of the north-west.
This is largely due to the substitution, mentioned above, of Sanskrit for Middle Indo-Aryan among the northern Buddhists, and, in the case of some schools, of a peculiar mixed language known as Buddhist Hybrid Sanskrit. The Jainas also modified late, beginning with Kalidasa, who is probably to be placed in the fifth century a.d., but its earlier cultivation is attested in inscriptions, in Buddhist literature (Asvaghosha), and by occasional references in Patanjali.
The drama also was probably established in the period immediately preceding the Christian era, and it continued to flourish in the early centuries a.d., but here again the examples that are preserved are much later.
Even allowing for the loss of a considerable amount of early literature, it still remains a fact that Sanskrit was enjoying its maximum use during the period a.d. 500-1200. It was current almost as widely in the Dravidian south as in the Aryan north and it was also extensively used in the areas of Indian cultural expansion in South-East Asia, Indonesia, etc. At the end of the period, in spite of the fact that the difference between it and the spoken vernaculars had now become very great, it was flourishing as strongly as ever.
Its preeminence was first seriously threatened by the Muslim invasions, which began seriously shortly before a.d. 1200 and quickly overran the greater part of the country. The new rulers preferred to use Persian as their official language, and they were unfavorably disposed to all branches of Hindu culture. Nevertheless the tradition of Sanskrit literature continued strongly and the number of Sanskrit works preserved, which were composed during the Muslim period, is very considerable indeed.
The period of British rule exercised a further unfavourable influence on Sanskrit, since a new language of civilization appeared in the field, while the increasing use of the modern Indo-Aryan languages was a further limitation to its use.
In spite of this, literary composition in Sanskrit has continued on a modest scale down to the present time, and an interesting development has been the successful adaptation of the language to the expression of modern ideas. From the practical point of view the main use to which the Sanskrit language is put at present is as a source of vocabulary for the modern languages. Sanskrit is able to provide on a large scale the new technical terms which are continually needed, and which the modern languages cannot supply from their own resources.