Sanskrit, as the learned language of Ancient India, thus existed alongside the vernacular Prakrits, which were Middle Indo-Aryan languages.
Where was Sanskrit a learned language of the high classes?
Ancient India