age. During the Gupta reign the first Puranas were written, which were used to disseminate "mainstream religious ideology amongst pre-literate and tribal groups undergoing acculturation". The Guptas patronised the newly emerging Puranic religion, seeking legitimacy for their dynasty. The resulting Puranic Hinduism, differed markedly from the earlier Brahmanism of the Dharmasastras and the smritis. According to P. S. Sharma, "the Gupta and Harsha periods form really, from the strictly intellectual standpoint, the most brilliant epocha in the development of Indian philosophy", as Hindu and Buddhist philosophies flourished side by side. Charvaka, the atheistic materialist school, came to the fore in North India before the 8th century CE. Gupta and Pallava Empires The Gupta period (4th to 6th centuries) saw a flowering of scholarship, the emergence of the classical schools of Hindu philosophy, and of classical Sanskrit literature in general on topics ranging from medicine, veterinary science, mathematics, to astrology and astronomy and astrophysics. The famous Aryabhata and Varāhamihira belong to this age. The Gupta established a strong central government which also allowed a degree of local control. Gupta society was ordered in accordance with Hindu beliefs. This included a strict caste system, or class system. The peace and prosperity created under Gupta leadership enabled the pursuit of scientific and artistic endeavors. The Pallavas (4th to 9th centuries) were, alongside the Guptas of the North, patronisers of Sanskrit in the South of the Indian subcontinent. The Pallava reign saw the first Sanskrit inscriptions in a script called Grantha. The Pallavas used Dravidian architecture to build some very important Hindu temples and academies in Mahabalipuram, Kanchipuram and other places; their rule saw the rise of great poets, who are as famous as Kalidasa. During early Pallavas period, there are different connexions to Southeast Asian and other countries. Due to it, in the Middle Ages, Hinduism became the state religion in many kingdoms of Asia, the so-called Greater India—from Afghanistan (Kabul) in the West and including almost all of Southeast Asia in the East (Cambodia, Vietnam, Indonesia, Philippines)—and only by the 15th century was near everywhere supplanted by Buddhism and Islam. The practice of dedicating temples to different deities came into vogue followed by fine artistic temple architecture and sculpture (see Vastu shastra). Bhakti This period saw the emergence of the Bhakti movement. The Bhakti movement was a rapid growth of bhakti beginning in Tamil Nadu in Southern India with the Saiva Nayanars