Śāstra is Sanskrit for rules in a general sense. The word is generally used as a suffix in the context of technical or specialized knowledge in a defined area of practice; e.g. Bhautika Shastra (physics), Rasayana Shastra (chemistry), Jeeva Shastra (biology), Vastu Shastra (architectural science), Shilpa Shastra (science of sculpture), Artha Shastra (economics), and Neeti Shastra (political science). In essence, the shaastra is the knowledge which is based on principles that are held to be timeless.
Shastra is also a by-word used when referring to a scripture. Extending this meaning, the shastra is commonly used to mean a treatise or text written in explanation of some idea, especially in matters involving religion. In Buddhism, a shastra is often a commentary written at a later date to explain an earlier scripture or sutra. For example, Dr. Yutang Lin says that a text written by him and not given by Buddha, cannot be called a "Sutra"; it is called a "Sastra". In Buddhism, Buddhists are allowed to offer their theses as long as they are consistent with the Sutras, and those are called "Sastras."
In Hinduism sutra denotes a distinct type of literary composition, based on short aphoristic statements, generally using various technical terms. Sutra (literally "binding thread") is a Sanskrit term referring to an aphorism or group of aphorisms. It was originally applied to Hindu philosophy, and later to Buddhist canon scripture. Some scholars consider that the Buddhist use of sūtra is a mis-Sanskritization of Prakrit or Pali sutta, and that the latter represented Sanskrit sūkta, "well spoken", "good news" (as the Buddha himself refers to his speech in his first sermon; compare the original meaning of Gospel), which would also resolve as sutta in Pali.
References in the early texts
The term śāstra is found for the first time in Yaska's Nirukta (1.2, 14), where the reference is probably to the science or a text of Nirukta (etymology) (though this term is found in the passage VIII.33.16 of the Ṛgveda also but the meaning of it is far from clear there). Similarly, the Ṛgvedaprātiśākhya (11.36; 14.30) uses the term to refer to the prātiśākhya tradition. Kātyāyana and Patañjali use it with reference to Pāṇini's Aṣṭādhyāyī. Similarly, the Vedāṅgajyotiṣa uses the term to refer to astronomical treatises. Significantly, however, this text uses the term vedāṅgaśāstrāṇām, indicating that the śāstra may have been also used as a generic term to cover treatises, which deal with the Vedāṅgas. In the Kātyāyana Śrautasūtra (1.6.21) the term is used to refer to the Veda. The earliest use of the term śāstra with reference to the literature on dharma is found in the vārttika of Kātyāyana, who uses the expression dharmaśāstra
Main period of composition
The main period for the composition of the shastras was between c.100 CE, the approximate date of the Manu Dharma Shastra, and c. 300 CE, when it is likely that Vatsyayana Mallanaga composed the Kama Sutra. The literature of this period is considered of greater interest than much of what was composed during the times of the empires that framed it, the Mauryas and the Guptas. At the time when the shastras were composed, Sanskrit remained the 'language of the gods', although it had also become a vehicle for literary and political expression.
The shastras are both descriptive and prescriptive. They represent an attempt by their Brahmin composers to strengthen discipline in social, political, personal and other spheres. Some elements, such as the origins of castes as related in Manu, were largely innovations designed to meet new social conditions. Manu shares with much of the shastra literature an emphasis on the need for controlling human behaviour, especially in relation to gambling, drinking, fornicating and hunting. Manu's text, for example, amounts to a programme for controlling the senses, considered essential for those seeking moksa, and advisable for others.
The shastras contain opposing views and contradictory prescriptions. This is in part because they represent an ideal of human behaviour, while at the same time recognising the need to account for likely failings. The shastras do not present life as it was lived. Rather they reveal an idea of what life should be, seen from a Brahmin perspective. The shastra texts constitute one of the great bodies of literature of the ancient world.