Friday, 8 March 2013

Scripting language

A scripting language or script language is a programming language that supports the writing of scripts, programs written for a software environment that automate the execution of tasks which could alternatively be executed one-by-one by a human operator. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems, and several general purpose and domain-specific languages such as those for embedded systems. Scripting is usually a property of the primary implementations of a language, although many languages are not very suited to this kind of implementation.

Typically, a scripting language is characterized by the following properties: Ease of use. Scripting languages are intended to be very fast to pick up and author programs in. This generally implies relatively simple syntax and semantics. OS facilities - especially file system and related, built in with easy interfaces. Scripting is usually aimed at desktops, limiting the portability needs of the pre-built libraries. Interpreted from source code - to give the fastest turnaround from script to execution. On a desktop, the performance of even a slow interpreter is often non-problematic. In comparison, non-scripting languages intended for large programs are often precompiled in at least some sense for superior performance.

Relatively loose structure. It would be difficult to use Java as a scripting language due to the rules about which classes exist in which files - contrast to Python, where it's possible to simply define some functions in a file. Scripts can be written and executed "on-the-fly", without explicit compile and link steps; they are typically created or modified by the person executing them. A scripting language is usually interpreted from source code or bytecode. By contrast, the software environment the scripts are written for is typically written in a compiled language and distributed in machine code form; the user may not have access to its source code, let alone be able to modify it.

The spectrum of scripting languages ranges from very small and highly domain-specific languages to general-purpose programming languages. The term script is typically reserved for small programs.