Programming Language
Programming Languages
• Suppose a person is giving travel directions to a friend. That friend might explain that direction in any one of the several languages such as English,
Japanese, Russian, Chinese, or even Tagalog.
• The directions are the same, no matter what language is used
• Similarly, a problem can be solved by writing a program in one of many programming languages such as Java, C, C++, Pascal, Basic, etc
Programming Languages
Can be categorized into four groups:
1. Machine language
-
composed of binary digits
Difficult for humans to read and understand
Can be executed directly by a computer
Each CPU type has its own machine language
-
i.e. you can’t run a program written in a Sun Microsystem computer on an Dell with an
Intel processor
2. Assembly language
-
Replaced binary digits with mnemonics, which are short, english-like words that represent commands. i.e. ADD, MUL, SUB
It was easier for programmers to deal with words, than with binary numbers
Cannot be executed directly by a computer – needs to be translated into machine language
Programming Languages
3. High-level language
-
Expressed in English-like phrases, and thus are easier to understand
A single high level language statement can accomplish the equivalent of hundreds of machine language code
High level refers to the fact that programming statements are expressed in a way far removed from the machine language that is ultimately executed
It insulates the programmer s from needing to know the underlying machine language for the processor on which they are working
Examples: Java, Pascal, C, C++, Ada, Smalltalk
4. Fourth-generation languages
-
include special facilities for automatic interaction with databases
Examples: Visual C++, Visual Basic
Programming Languages
High Level Language
<a + b>
Assembly Language
Machine Language
1d [%fp-20], %o0
1d[%fp-24], %o1
Add %o0, %o1, %o0
…
1101
1102
1101
1011
0000
1111
0010
1111
0000
1110
0000