Before grammar, there is the alphabet. The Lipiviveka — the 'discrimination of letters' — is a work on the analysis of scripts attributed to Kṣemendra, the great Kashmiri polymath, and its stated purpose is wonderfully plain: it was composed for children, to teach them to distinguish letters.
An alphabet for children
The opening invokes Gaṇeśa, the guru, and Māṭṛkādevī — the goddess of letters — and then declares the work's humble goal.
Victory to the lotus-feet of the Guru. Salutations to Śrī Māṭṛkādevī. Having bowed to the lotus-feet of the Lord, the sole abode of all human goals, I compose the discrimination of letters for the knowledge of letters for children.
It is a primer — but a primer by one of the most learned writers in Sanskrit, who also gave the tradition the Bṛhatkathāmañjarī and the Rājataraṅgiṇī's example of a sharp, observant prose.
Scripts as a subject of study
The very existence of a text called Lipiviveka — the analysis of scripts (lipi) — is a reminder that writing itself was a scholarly subject in India. The shapes of letters, their classification, their correct discrimination — these were taught deliberately, as the foundation on which grammar and literature rest.
The gateway to everything
The Lipiviveka sits at the bottom of the educational ladder, and that is precisely its importance. Before Pāṇini, before poetry, before the śāstras, there is the letter — and a tradition that wrote textbooks to teach it to children is a tradition that took literacy as the door to all learning. This manuscript, from the Bhandarkar collection, is that textbook, preserved.

