Scripting language

from Wikipedia, the free encyclopedia

Script languages (also script languages ) are programming languages that are executed via an interpreter . Sometimes they do without language elements, the benefits of which only come into play when dealing with more complex tasks. In script languages, for example, the mandatory declaration of variables is usually dispensed with - this is advantageous for the rapid creation of small programs (see also prototyping ), but disadvantageous for large programs , for example because of the lack of checking for typing errors in variable names.

Programs that are written in scripting languages, even to scripts or scripts called while in the operating environment of Microsoft usually the term macro is used. Scripts are delivered almost exclusively in the form of source text files in order to enable easy editing and adaptation of the program.


Frequently present characteristics are:

With some scripting languages, the program code (as well as other data) can be manipulated by the program itself; that makes those languages ​​particularly flexible.

The areas of application and properties of conventional programming languages ​​and script languages ​​now overlap strongly (see the section on delimitation ), which is why a strict separation between conventional programming languages ​​and script languages ​​is rarely possible.


From an architectural point of view, scripting languages ​​are often used to connect or call up existing components in an application program . The components themselves are developed in a more complex programming language. An example of this is a shell script that calls external programs. These programs are generally developed in different programming languages. Another example is the BPEL language , which is used to describe web services that can be developed in various programming languages.

Script languages ​​were initially only used for smaller automations, but today they are also used in areas that were previously reserved for the classic programming languages. Improvements in the interpreters have reduced the speed difference compared to static languages; Together with the advancement of computing power, this often results in an acceptable execution speed that could previously only be achieved with compiled programs. In addition, variables can optionally be declared in some of the independent programming languages ​​for better error checking. With modern script languages, some applications, for example for the evaluation of data, can therefore be implemented completely without external programs.


Command line interpreter

Some script languages ​​are derived from the command line interpreters of the operating systems. The interpreters are primarily for interactive use; H. designed for entering commands. The input language is expanded to include variables, arithmetic expressions, control structures ( if , while ) and others, thus enabling the automation of tasks (e.g. during unattended installation ) by writing "small programs" in files. These files can then be executed by the interpreter. The files are called under the operating system Unix shell scripts (executed by one of Unix shells sh , csh ...) or under DOS and Windows also batch scripts (executed by COMMAND.COM and cmd.exe ).

Command line interpreters are to be distinguished from interactive languages ​​(such as Lisp , Python , Tcl or Perl in the debugger ), which can execute interactive program sections for testing and debugging, but are not so closely integrated in the operating system.


Scripting languages ​​available as a library


Script languages ​​of various programs

Script languages ​​can also be used in application programs to automate tasks or expand the capabilities of the program. Some of the functionality of the program itself is also implemented in this script language. In this way, users can quickly expand the functionality of such a program with new functions or modify existing ones without rewriting the program themselves. These extensions can themselves be so extensive that the program performs completely new tasks that - from the user's point of view - have nothing in common with the previous program. So the text editor Emacs also became an e-mail program (Wanderlust) or a web browser (Emacs-W3).

In contrast to plug-ins , scripts or macros are much more flexible and are mainly used for small automation.


Script languages ​​on the WWW

For the WWW , scripting languages ​​are often used on the servers to create dynamic pages or entire web applications . This happens, for example, with wikis , forums , guest books and online businesses .

Furthermore, client-side scripting languages ​​are also integrated in the websites themselves and executed in the browsers .

Examples: server-side

  • Perl - first scripting language that was widely used in web servers
  • PHP - the most common scripting language on web servers; was designed directly for this task
  • Python - can be connected to a web server or used with a stand-alone web server
  • Ruby - is executed either via CGI or with mod_ruby, increasingly also using Ruby on Rails
  • JavaScript , e.g. B. can also be used on the server side with Node.js
  • VBScript in ASP

Examples: client-side

  • JavaScript (standardized as ECMAScript ) is supported by all modern browsers
  • CoffeeScript , is transcompiled to JavaScript
  • TypeScript , is transcompiled to JavaScript

Independent scripting languages

Script languages ​​can also be executed by other programs separately from their interpreter. Some of these are designed for special tasks, others are general-purpose languages. These languages ​​have the concepts such as namespaces and encapsulation necessary for extensive program projects and are therefore not infrequently used for larger applications .

Examples: specialized languages

  • awk - word processor (list generator) under Unix
  • GLE - Graphics Layout Engine, script language for creating graphics and diagrams

Examples: general languages

  • Perl - programming language with advanced word processor capabilities
  • PHP - originally designed for web application development
  • Python - partially object-oriented programming language
  • REBOL - programming language by Carl Sassenrath
  • REXX - scripting language from IBM
  • Ruby - object-oriented programming language
  • Tcl - universal scripting language with advanced word processor capabilities and graphic toolkit Tk

Comparison of different scripting languages

language Paradigms Publishing year developer Typing Major implementations License
Groovy object-oriented , declarative , imperative 2003 The Groovy Project, Apache Software Foundation strong , static , dynamic - Apache License 2 (Open Source)
JavaScript object-oriented , functional , imperative 1995 Brendan Eich weak , dynamic SpiderMonkey , Rhino , SquirrelFish , V8 , Rhinoceros -
python object-oriented , functional , imperative 1991 Python Software Foundation, Guido van Rossum strong , dynamic CPython , Jython , IronPython , PyPy Python Software Foundation License
Scala object-oriented , functional , imperative 2003 École polytechnique fédérale de Lausanne under the direction of Martin Odersky strong , static - Scala, BSD- like
PHP object-oriented , functional , imperative 1995 The PHP Group weak , dynamic Zend Engine , HHVM , Phalanger (Compiler) PHP license and others, partly proprietary
Ruby object-oriented , functional , imperative 1995 Yukihiro Matsumoto strong , dynamic MRI / CRuby (YARV), JRuby , Rubinius (others) 2-clause BSD and own (see terms of use )
Tcl object-oriented , functional , imperative 1988 John Ousterhout weak , dynamic ActiveTcl , Jim Tcl BSD license

Comparison of syntactic possibilities in script languages

language Annotations Anonymous function Pattern matching Named parameters Optional parameters Currying Varargs
Groovy x x - (x) x x x
JavaScript - x - x x x x
python x x - x x (x) x
Scala x x x x x x x
PHP - x - - x (x) x
Ruby - x - (x) x x x
Tcl - x x (x) x (x) x

Web links

Wiktionary: Script language  - explanations of meanings, word origins, synonyms, translations

Individual evidence

  2. 4. Emacs-W3. In: TLDP . Retrieved May 30, 2019 (American English).
  3. Python License
  4. license
  5. Vararg's Java