Scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system.[1] Scripting languages are usually interpreted at runtime rather than compiled.
A scripting language's
The term scripting language is also used in a wider sense, namely, to refer to
The spectrum of scripting languages ranges from small to large, and from highly domain-specific language to general-purpose programming languages. A language may start as small and highly domain-specific and later develop into a portable and general-purpose language; conversely, a general-purpose language may later develop special domain-specific dialects.
Examples
- AWK, a text-processing language available in most Unix-like operating systems, which has been ported to other operating systems.
- Bash, an interpreted scripting language for use on Unix, GNU and other Unix-like operating systems and environments.
- Smalltalk.
- JavaScript (later: ECMAScript), originally a very small, highly domain-specific language, limited to running within a web browser to dynamically modify the web page being shown, that later developed into a widely portable general-purpose programming language.
- Lisp, a family of general-purpose languages and extension languages for specific applications, e.g. Emacs Lisp, for the Emacs editor.
- Lua, a language designed for use as an extension language for applications in general, used by many different applications.
- Perl,[2] a text-processing language that later developed into a general-purpose language, also used as an extension language for various applications.
- PowerShell, a scripting language originally for use with Microsoft Windows but later also available for macOS and Linux.
- Python, a general-purpose scripting language with simple syntax, also used as an extension language.
- Object Rexxare based on REXX. Used on several platforms. Also used as extension languages for applications.
- Ruby, a general purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on productivity and simplicity.
- sed, a text-processing language available in most Unix-like operating systems, which has been ported to other operating systems.
- Tcl,[3] a scripting language for Unix-like environments, popular in the 1990s. Can be used in conjunction with Tk to develop GUI applications.
- Visual Basic for Applications (VBA), an extension language developed specifically for Microsoft Office applications, and implemented at least partially in many non-Microsoft applications.
Some game systems have been extensively extended in functionality by scripting extensions using custom languages, notably the
Characteristics
Typical 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).[4] 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 characterise
public class HelloWorld {
public void printHelloWorld() {
System.out.println("Hello World");
}
}
This piece of code intended to print "Hello World" does nothing as main() is not declared in HelloWorld class, although the one below would be useful.
public class HelloWorld {
public void printHelloWorld() {
System.out.println("Hello World");
}
public static void main(String[] args) {
printHelloWorld();
}
}
In the example above, main is defined and so this can be invoked by the launcher, although this still cannot be executed interactively. In contrast,
print("Hello World")
This one line of Python code prints "Hello World"; no declarative statement like main() is required here.
A scripting language is usually
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,[6] but they are also often distributed, such as when large portions of games are written in a scripting language, notably the Google Chrome T-rex game.
History
Early mainframe computers (in the 1950s) were non-interactive, instead using batch processing. IBM's Job Control Language (JCL) is the archetype of languages used to control batch processing.[7]
The first interactive
Languages such as Tcl and Lua were specifically designed as general-purpose scripting languages that could be embedded in any application. Other languages such as Visual Basic for Applications (VBA) provided strong integration with the automation facilities of an underlying system. Embedding of such general-purpose scripting languages instead of developing a new language for each application also had obvious benefits, relieving the application developer of the need to code a language translator from scratch and allowing the user to apply skills learned elsewhere.
Some software incorporates several different scripting languages. Modern web browsers typically provide a language for writing extensions to the browser itself, and several standard embedded languages for controlling the browser, including JavaScript (a dialect of ECMAScript) or XUL.
Types
Scripting languages can be categorized into several different types, with a considerable degree of overlap among the types.
Glue languages
![]() | ) |
Scripting is often contrasted with
Glue languages are especially useful for writing and maintaining:
- custom commands for a command shell;[12]
- smaller programs than those that are better implemented in a compiled language;[13]
- "wrapper" programs for executables, like a batch file that moves or manipulates files and does other things with the operating system before or after running an application like a word processor, spreadsheet, data base, assembler, compiler, etc.;[14]
- scripts that may change;[15]
- Rapid application development of a solution eventually implemented in another, usually compiled, language.[citation needed]
Glue language examples:
Other devices like programmable calculators may also have glue languages; the operating systems of PDAs such as Windows CE may have available native or third-party macro tools that glue applications together, in addition to implementations of common glue languages—including Windows NT, DOS, and some Unix shells, Rexx, Modern Pascal, PHP, and Perl. Depending upon the OS version, WSH and the default script engines (VBScript and JScript) are available.
Programmable calculators can be programmed in glue languages in three ways. For example, the
Editor languages
A number of text editors support macros written either using a macro language built into the editor, e.g.,
Job control languages and shells
A major class of scripting languages has grown out of the automation of
COMMAND.COM
. Others, such as AppleScriptGUI scripting
With the advent of graphical user interfaces, a specialized kind of scripting language emerged for controlling a computer. These languages interact with the same graphic windows, menus, buttons, and so on, that a human user would. They do this by simulating the actions of a user. These languages are typically used to automate user actions. Such languages are also called "macros" when control is through simulated key presses or mouse clicks, as well as tapping or pressing on a touch-activated screen.
These languages could in principle be used to control any GUI application; but, in practice their use is limited because their use needs support from the application and from the operating system. There are a few exceptions to this limitation. Some GUI scripting languages are based on recognizing graphical objects from their display screen pixels. These GUI scripting languages do not depend on support from the operating system or application.
When the GUI provides the appropriate interfaces, as in the IBM
Application-specific languages
Application specific languages can be split in many different categories, i.e. standalone based app languages (executable) or internal application specific languages (postscript, xml, gscript as some of the widely distributed scripts, respectively implemented by Adobe, MS and Google) among others include an idiomatic scripting language tailored to the needs of the application user. Likewise, many
Extension/embeddable languages
A number of languages have been designed for the purpose of replacing application-specific scripting languages by being embeddable in application programs. The application programmer (working in C or another systems language) includes "hooks" where the scripting language can control the application. These languages may be technically equivalent to an application-specific extension language but when an application embeds a "common" language, the user gets the advantage of being able to transfer skills from application to application. A more generic alternative is simply to provide a library (often a C library) that a general-purpose language can use to control the application, without modifying the language for the specific domain.
JavaScript began as and primarily still is a language for scripting inside
files).Tcl was created as an extension language but has come to be used more frequently as a general-purpose language in roles similar to Python, Perl, and Ruby. On the other hand, Rexx was originally created as a job control language, but is widely used as an extension language as well as a general-purpose language. Perl is a general-purpose language, but had the Oraperl (1990) dialect, consisting of a Perl 4 binary with Oracle Call Interface compiled in. This has however since been replaced by a library (Perl Module), DBD::Oracle.[17][18]
Other complex and task-oriented applications may incorporate and expose an embedded programming language to allow their users more control and give them more functionality than can be available through a user interface, no matter how sophisticated. For example, Autodesk Maya 3D authoring tools embed the Maya Embedded Language, or Blender which uses Python to fill this role.
Some other types of applications that need faster feature addition or tweak-and-run cycles (e.g.
Ch is another C compatible scripting option for the industry to embed into C/C++ application programs.
See also
- Architecture description language
- Authoring language
- Build automation[19]
- Configuration file
- Interpreter directive / Shebang (Unix)
- Templating language
References
- ^ "ECMAScript 2019 Language Specification". www.ecma-international.org. Retrieved 2018-04-02.
- ^ Sheppard, Doug (2000-10-16). "Beginner's Introduction to Perl". dev.perl.org. Retrieved 2011-01-08.
- ^ Programming is Hard, Let's Go Scripting…, Larry Wall, December 6, 2007
- ISBN 978-1-31612322-5, "A major characteristic of modern scripting languages is their interactivity, sometimes referred to as a REPL programming environment. […] The characteristics of ease of use and immediate execution with a REPL environment are sometimes taken as the definition of a scripting language.")
{{cite book}}
: CS1 maint: postscript (link - ^ Brown, Vicki. "Scripting Languages". MacTech | The journal of Apple technology. Retrieved 2009-07-22.
{{cite web}}
: CS1 maint: url-status (link) - ^ Loui, Ronald (2008). "In praise of scripting". IEEE Computer. Archived from the original on 2015-09-23. Retrieved 2013-08-27.
- ^ IBM Corporation (1967). IBM System/360 Operating System Job Control Language (C28-6529-4) (PDF).
- ^ Mooers, Calvin. "TRAC, A Procedure-Describing Language for the Reactive Typewriter". Archived from the original on 2001-04-25. Retrieved March 9, 2012.
- ^ Van Vleck, Thomas (ed.). "Multics Glossary – A — (active function)". Retrieved March 9, 2012.
- ^ Varian, Melinda. "VM AND THE VM COMMUNITY: Past, Present, and Future" (PDF). Retrieved March 9, 2012.
- ^ Van Vleck, Thomas (ed.). "Multics Glossary – R — (RUNCOM)". Retrieved March 9, 2012.
- ^ "What is glue code (glue code language)? - Definition from WhatIs.com". WhatIs.com. Retrieved 2022-01-31.
- ^ Larson, Quincy (10 January 2020). "Interpreted vs Compiled Programming Languages". Free Code Camp. Retrieved 23 February 2022.
{{cite web}}
: CS1 maint: url-status (link) - ^ Balkis, Anton. "Script Adalah". Raja Tips. Retrieved 23 February 2022.
{{cite web}}
: CS1 maint: url-status (link) - ^ Axelsson, Mats. "Shell scripts - What can you change". Linux Hint. Retrieved 23 February 2022.
{{cite web}}
: CS1 maint: url-status (link) - ^ "Job Control Basics (Bash Reference Manual)". www.gnu.org. Retrieved 2022-05-20.
- ^ Oraperl, CPAN]
- ^ Perl, Underground Oracle FAQ
- ^ van Rossum, Guido (January 6–8, 1998). "Glue it all together". Glue It All Together With Python. python.org.
Further reading
- Barron, David William (2001). The World of Scripting Languages. ISBN 0-471-99886-9.
External links

- Patterns for Scripted Applications at the Wayback Machine (archived October 10, 2004)