10.2. What Is a Scripting Language?

If a script is a program run by an interpreter, it won't come as much of a surprise that a scripting language is the programming language that a script is written in. Scripting languages tend be high-level languages, operating closer to the human programmer than the computer CPU. For example, where C allows you to access addresses in memory via pointer variables (see Chapter 6), scripting languages do not generally provide such low-level operations. Instead, they include extensive libraries of functions for dealing with everything from text manipulation, to file handling, and even access to databases. Scripting languages are very powerful, allowing you to get the most done with as little code as possible.

Each scripting language tends to specialize in a particular application domain:

  • AppleScript is great for scripting applications with a graphical user interface (GUI).

  • Python and Perl have excellent text-manipulation facilities.

  • Ruby includes powerful object-oriented (OO) features to aid in structuring large programs.

  • Bash makes it easy to leverage other commands and programs.

  • PHP is designed for building websites, with features for accessing databases and producing HTML.

  • JavaScript is designed to work in web browsers and can be used to create Dashboard widgets on Mac OS X 10.4 "Tiger".

Scripting languages are often referred to as glue languages, because they are generally used to glue together other applications and programs. For example, the Bash ...

Get Beginning Mac OS® X Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.