Categories of Programming Languages
Hundreds of programming languages are currently in use around the world. Some are highly specialized and used in only one branch of science or industry, while others are well known and used almost everywhere. Some languages are obsolete and used only to maintain older systems, while others are so new that many programmers do not even know that they exist.
You can group programming languages in several different ways. For example, you might group them into those that use structured programming and those that do not. Or you might group them by those used in business versus those used in scientific circles. Programming languages are usually grouped, however, by their place in the evolution of programming languages. Based on evolutionary history, programming languages are divided into three broad categories:
- Machine languages
- Assembly languages
- Higher-level languages
- Machine and Assembly Languages
Machine languages are the most fundamental of languages. Using a machine language, a programmer creates instructions in the form of machine code (1's and 0's) that a computer can follow. Machine languages are defined by hardware design. In other words, the machine language for a Macintosh is not the same as the machine language for a Pentium PC. In fact, the machine language for different Pentium versions is slightly different. A computer understands only its native machine language-the commands in the instruction set. Instruct the computer to perform elementary operations such as loading, storing, adding, and subtracting.
Assembly was developed by using short, English-like, abbreviations to represent common elements of machine code. To develop software with an assembly language, a programmer uses a text editor (a simple word processor) to create source files. To convert the source files into object code, the developer uses a special translator program, called an assembler, to convert each line of assembler code into one line of machine code. This is where the name assembly language comes from. assembly languages are highly detailed and cryptic, they are still much easier to use than machine language. About the only time, programmers write programs of significant size in an assembly language is when they are concerned with the code being efficient and fast. (One example of this rule is action games, where the program's speed is critical. Instead, programmers use assembly languages to find-tune important parts of programs written in a higher-level language.
There is not much you can tell by looking at machine code (1s and Os), and you would have to know a huge amount of specialized information before you could write it. Assembly code, however, is a bit less cryptic …but only a bit. As you can see in Figure 12B.2, assembly code uses specialized English-like phrases along with hardware-specific numbers.
- Higher-Level Languages
What-level was developed to make programming easier. These languages are called higher-level languages because their syntax is more like human language than either assembly or machine language code. Higher-level programming languages use familiar words rather than the detailed strings of digits that make up machine instructions. To express computer operations, these languages use operators such as the plus and minus signs that are the familiar components of mathematics. As a result, people can read, write, and understand computer programs much more easily when using a higher-level language. Still, the instructions must be translated into machine language before the computer can understand and carry them out. One line of a higher-level language usually translates into many lines of machine language. This makes it faster to write in a higher-level language, but you sacrifice some control over the actual code produced.
Programming languages are sometimes discussed in terms of generations. Later generations include languages that are both easier to use and more powerful than those in earlier generations. Machine languages, therefore, are called first-generation languages and assembly languages are generation languages, The higher-level languages began with the third generating.
0 Comments