What “scripting” means
A script is a short program that automates a task, often by controlling other programs. The name comes from the idea of a script that tells actors what to do: the script does not do everything itself, it directs components that already exist.
Scripting languages are languages commonly used this way. They tend to prioritize quick writing over strict structure. Typical features are an interpreter that runs the code directly, flexible handling of text and lists, and few formalities before the first useful line. The label is loose, since a language used for scripting can also be used for large applications, and historians and programmers do not agree on exact boundaries.
Job control and the shell
The idea has early roots. On mainframe computers, users wrote job control instructions that told the system which programs to run and in what order. When time-sharing systems arrived, command lines let users type instructions interactively, and it was a small step to save a list of commands in a file and run them together.
In Unix systems of the 1970s, the shell served both purposes: it was a command interpreter and a programming language. Small tools, each doing one thing, could be connected so that the output of one became the input of the next. Shell scripts chained such tools to do work like renaming files, summarizing logs or backing up directories. Tools for processing text, such as awk, grew out of the same environment.
Languages for text and administration
By the 1980s, system administrators needed more power than shell scripts offered, but did not want to write and compile a full program for each chore. Perl, created by Larry Wall in the late 1980s, filled the gap. It was strong at pattern matching in text and let people write compact programs quickly. It became popular for report generation, file conversion and, later, early web programs.
Other languages followed. Python, designed by Guido van Rossum in the early 1990s, emphasized readable layout and a broad standard toolbox. Ruby and others came along later. Each had its fans, and arguments over which was best have continued for decades without a decisive answer.
The web adds a new use
The growth of the World Wide Web created large demand for small programs. Early web servers could run scripts when a visitor requested a page, producing output tailored to each request. Programs of this type, often called CGI scripts in the 1990s, handled forms, guest books and counters. Perl was widely used for this.
PHP, which emerged in the mid-1990s, was designed to be embedded directly in web pages, mixing program statements with HTML markup. That made it easy for someone who knew basic page writing to add dynamic features. It spread quickly on shared hosting services, where many people published sites.
In the browser, JavaScript appeared in 1995, introduced by Netscape. It lets pages respond to clicks and update content without reloading. Despite the similar name, it has little to do with Java; the naming was a marketing decision. Over time, JavaScript became a core part of web browsers, and later it also moved to servers and other settings.
Why people like them
Scripting languages succeeded because they matched how much programming is actually done. Many tasks are small, specific and one-off: convert these files, collect these numbers, check this list. For such jobs, the time spent writing the program matters more than the time the computer takes to run it.
Common advantages include:
- Quick edit-and-run cycles, since there is no separate build step.
- Built-in handling of text, dates and collections.
- Large libraries for common tasks, shared among users.
- Ability to connect programs written in other languages.
These traits, along with interpreters that were available for free, helped scripting languages spread widely in education and in the open-source community.
Limits and criticisms
There are trade-offs. Scripts that grow into large systems can become hard to maintain, particularly when the language lets mistakes slip through until the program runs. Compact code can be hard to read months later; Perl in particular acquired a reputation for programs that were quick to write and puzzling to revisit. Security issues have also arisen when web scripts accepted input without careful checking, an important lesson in the history of computer security.
Performance is sometimes cited as a weakness. The answer is mixed and depends on the implementation and workload, and modern interpreters have improved considerably. Many projects use a scripting language for most of the work and a compiled language for the few parts where speed is critical. The distinction between the two approaches is discussed in the article on compilers and interpreters.
Everyday automation
Scripts are also behind many unnoticed conveniences. Scheduled tasks that back up files, programs that resize a folder of photos, or spreadsheets with macros that fill in reports are all examples of automation. Office programs gained their own built-in scripting languages, so people who never thought of themselves as programmers could record or write routines.
This is a theme that runs through the history of programming languages: tools spread when they let ordinary users solve their own problems. Scripting lowered the barrier between using a computer and programming it, and for many people today that is where programming begins.