Pali was a prakrit language which was any of the several middle Indo - Aryan languages. Pali language was used in scriptures in Theravada Buddhist tradition as Lord Buddha opposed the use of Sanskrit and encouraged use of vernacular dialects. It was written on palm leafs during the fourth Buddhist council in Sri Lanka in 29 BCE, approximately 450 years after mahasamadhi of Gautam Buddha. Most of the scholars believe that Pali was derived from Sanskrit except A.C. Woolner believes that Pali was derived from vedic Sanskrit but not necessarily from classical Sanskrit. Paisachi was a language which was mentioned in prakrit and Sanskrit grammers. Paisachi language means booth basha or language of dead.
According to some legends, Pali was mentioned as the language in which Maharshi Patanjali had written yoga shastras. By the advice of Lord Vishnu, Adi sesha (1000 headed serpent who is the bed of Lord Vishnu) travelled to earth as Maharshi Patanjali to transmit the knowledge of yoga sutras. Adi sesha fell (pata) as a snakelet into half folded hands (anjali mudra) of a Brahmin. Hence the name Patanjali. His lower part was as snake and upper part was as a man.
Patanjali wanted to teach yoga to the thousand sishyas with his thousand heads at a time by putting screen between himself and sishyas. He had laid condition that nobody should leave the place and nobody should open the curtains until complete knowledge is transmitted. Whoever would not follow these rules will be transformed into paisachi or brahma rakshasi (demon).
As he was transmitting the yoga sutras, one boy left for nature’s call without taking the permission of the master. Meanwhile another boy got curious to know about the guru behind the curtains, opened them and all the 999 pupil were burnt to ashes. Maharshi felt very sad as he could not transmit the knowledge to world. Meanwhile the boy returned. The boy asked the guru forgiveness for leaving. Maharshi felt very happy and imparted all the knowledge to the boy.
As the boy violated rules set by maharshi, the boy was cursed to become a demon and would be relieved of the curse when he would transmitt the knowledge to some other person. The demon was hanging on the tree upside down for thousands of years for a suitable person to transmitt the knowledge. Maharshi felt very sad and once again he was born as a human being by the name of “ Chandra Varma “ joined as the disciple of demon and had written the yoga sutras on the tree leaves with his blood continuosly for 7 days and 7 nights. As he slept when he was very tired , some of the leafs fell down and eaten by the goats and remaining leaves have given world ‘ Yoga Sutras ‘ which presently we are learning and practicing.
Here the language of demon [bhooth bhasha] mixed with the language of the scholar [Sanskrit ] gave the origin of “ PALI “ language. Pali was written in variety of scripts.
According to another legend Chandra Varma was too sick to move and was taken to hospital by daughter of the Ujjain kingdom’s physician and was nursed by her [as he was unable to eat or drink, he had to be applied the food paste to the body ]. As per customs of the kingdom at that time he had to marry physicisn’s daughter. As he was very handsome, intelligent and wise , king’s daughter and minister’s daughter were also wanted to marry him. According to the prevailing customs at that time he married all the three girls. Famous king Vikramaditya was the son of king’s daughter and his aide Bhatti was the son of minister’s daughter. After the children were born. Chadra Varma left the kingdom and went to the forest to penance. King vikramaditya was very intelligent and wise, With the help of his minister Bhatti he ruled very efficiently and he had started “ Vikrama Sawant “.
Author’s note : As the time of Patanjali and Vikramaditya are not exactly known , I am convinced by reading number of articles about both of them that Vikramaditya was son of Chandra Varma who was the Patanjali’s second life.