[ LiB ]Low-Level LanguagesThe Pros of High-Level Languages

Today's High-Level Languages

The terms high-level, interpreted, and scripting all share a similar conceptual space when it comes to programming, and this often causes confusion. Over the next few pages I'll explain each term. Pay attentionthere may be a quiz coming up!

High-level languages are designed with the native language of the programmer in mind. They are sometimes referred to as problem-oriented languages and are often very specific in focus. BASIC is a good example of a high-level language; it was designed for first-time programmers as a learning tool. COBOL and FORTRAN are other good examples. COBOL was designed for business problems, and FORTRAN for solving scientific and mathematical problems.

NOTE

Python is sometimes referred to as a "Very High Level Language" (VHLL). This term appeared in the mid 1990s to describe languages used for rapid prototyping. Two features that supposedly separate VHLLs from your standard high-level language are dynamic types and an interactive environment that allows you to make changes without having to go through the entire relink recompile steps.

Instructions in high-level languages closely resemble everyday language, making high-level languages much easier to learn and use than their low-level equivalents. The programmer does not need to have detailed knowledge of the internal working of the computer in order to program instructions. Each instruction in high-level is equivalent to several machine code instructions that then are either compiled or interpreted to translate them into machine code.

Interpreted versus Compiled Languages

A high-level interpreted language translates the programmer's written code step-by-step at runtime, or when the program is actually running. A high-level compiled language translates a programmer's written code before the program is run, a process normally called compiling. This changes the written code into an executable or object-code that can then be run as a program on a computer.

Many modern programming languages allow themselves to be both interpreted and compiled, but normally a particular language is more suited to one or the other. AWK, Perl, and Python are examples of interpreted programming languages. BASIC, COBOL, C, and FORTRAN are examples of compiled programming languages.

When a program is compiled, the compiler takes the source code files and generates object code with those files. The object code is then wrapped together during a linking process to produce an actual executable. This process is illustrated in Figure 1.2.

Figure 1.2. The process of compiling source code into an executable file or program

graphic/01fig02.gif


When comparing the two types of languages, you can usually make two generalizations. The first is that interpreted programs are usually much slower than their compiled counterparts (although the actual process of compiling may take quite a bit of time as well). The second is that interpreted languages are more flexible at runtime than compiled languages because they can interact with the execution environment. In other words, in order to gain flexibility, you must slow down.

Scripting Languages

Scripting is a term used to denote the scripting of a computer, akin to an actor who follows a script to perform a play. A scripting language is a high-level language used to assemble components into a predefined software architecture. Scripting languages, sometimes called glue-languages, are designed for scripting the operation of a computer. Normal operations that would be considered scripting are administrative tasks such as running automatic backups, text processing, running server-side requests such as CGI processing, or automating software tests. Python, Lua, and Ruby are considered scripting languages in one form or another, as are ASP, AWK, JavaScript, Perl, and VBScript.

The scripting-language family is hard to pin down. VHLL languages include the various types of UNIX shell command-line interpreters, and even languages like AWK, Perl, and lisp can be classified as scripting languages. Unfortunately, there is no universally accepted definition of what a pure scripting language actually is, but they usually have most of the following features:

[ LiB ]Low-Level LanguagesThe Pros of High-Level Languages