|
A scripting language or script language is a programming language that supports scripts, programs written for a special run-time environment that can interpret (rather than compile) and automate the execution of tasks that 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 (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language. Scripting languages are also sometimes referred to as very high-level programming languages, as they operate at a high level of abstraction, or as control languages, particularly for job control languages on mainframes. The term "scripting language" is also used loosely to refer to dynamic high-level general-purpose language, such as Perl, Tcl, and Python,〔(Programming is Hard, Let's Go Scripting... ), Larry Wall, December 6, 2007〕 with the term "script" often used for small programs (up to a few thousand lines of code) in such languages, or in domain-specific languages such as the text-processing languages sed and AWK. Some of these languages were originally developed for use within a particular environment, and later developed into portable domain-specific or general-purpose languages. Conversely, many general-purpose languages have dialects that are used as scripting languages. This article discusses scripting languages in the narrow sense of languages for a specific environment; The spectrum of scripting languages ranges from very small and highly domain-specific languages to general-purpose programming languages used for scripting. Standard examples of scripting languages for specific environments include: Bash, for the Unix or Unix-like operating systems; ECMAScript (JavaScript), for web browsers; and Visual Basic for Applications, for Microsoft Office applications. Lua is a language designed and widely used as an extension language. Python is a general-purpose language that is also commonly used as an extension language, while ECMAScript is still primarily a scripting language for web browsers, but is also used as a general-purpose language. The Emacs Lisp dialect of Lisp (for the Emacs editor) and the Visual Basic for Applications dialect of Visual Basic are examples of scripting language dialects of general-purpose languages. Some game systems, notably the Second Life virtual world and the Trainz franchise of Railroad simulators have been extensively extended in functionality by scripting extensions. In other games like Wesnoth, the variety of actual games played by players are scripts written by other users. == Characteristics == In principle any language can be used as a scripting language, given libraries or bindings for a specific environment. Formally speaking, "scripting" is a property of the primary implementations and uses of a language, hence the ambiguity about whether a language "is" a scripting language for languages with multiple implementations. However, many languages are not very suited for use as scripting languages and are rarely if ever used as such. Typically scripting languages are intended to be very fast to learn and write in, either as short source code files or interactively in a read–eval–print loop (REPL, language shell). This generally implies relatively simple syntax and semantics; typically a "script" (code written in the scripting language) is executed from start to finish, as a "script", with no explicit entry point. For example, it is uncommon to use Java as a scripting language because of its lengthy syntax and rules about which classes exist in which files, and it is not directly possible to execute Java interactively, because source files can only contain definitions that must be invoked externally by a host application or application launcher. In contrast, in Python it is possible to define some functions in a single file, or to avoid functions altogether and write in an imperative programming style, or even to use it interactively. 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. Scripting languages may be designed for use by end users of a program – end-user development – or may be only for internal use by developers, so they can write portions of the program in the scripting language. Scripting languages typically use abstraction, a form of information hiding, to spare users the details of internal variable types, data storage, and memory management. Scripts are often created or modified by the person executing them, but they are also often distributed, such as when large portions of games are written in a scripting language. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Scripting language」の詳細全文を読む スポンサード リンク
|