Programming Languages
|
|
Computers only understand binary codes so the first programs were written using this notation. This form of programming was soon seen to be extremely complex and error prone so assembler languages were developed. Soon it was realized that even assembler languages could be improved on. Today, a good programming language must be: |
|
• Totally unambiguous (unlike natural languages, for example, English — `old women and men suck eggs’, does this mean that men or old men suck eggs?). |
|
• expressive — it must be fairly easy to program common tasks, |
|
• practical — it must be an easy language for the compiler to translate, |
|
• Simple to use. |
|
All programming languages have a very precise syntax (or grammar). This will ensure that a syntactically-correct program only has a single meaning. |
|
|
High-level Programming Languages |
Assembler code is a Low-Level Language. It is so-called because the structure of the language reflects the instruction set (and architecture) of the CPU. A programmer can get very close to the physical hardware. Low-level languages allow very efficient use of the machine but are difficult to use. |
|
Fortran 90, FORTRAN 77, ADA, C and Java are examples of High-Level Languages. They provide a much higher degree of abstraction from the physical hardware. They also allow for portable programs to be written, i.e., programs that will run on a variety of different systems and which will produce the same results regardless of the platform. As well as having the above benefits, high-level languages are more expressive and secure and are much quicker to use than low-level languages. In general, however, a well written assembler program will run faster than a high-level program that performs the same task. |
|
At the end of the day, an executable program that runs on a CPU must still be represented as a series of binary digits. This is achieved by compiling (translating) a high-level program with a special piece of software called a compiler. Compilers are incredibly complicated programs that accept other programs as input and generate a binary executable object file as output. |