Translate

Total Page Views


Thursday, January 31, 2013

Third Generation Computer Languages

A program is a list of instructions that performs a particular task. Assembly programs were very long, this made it difficult to maintain programs written in Assembly. In the late 1950 Computer Scientists came up with high level computer languages which were closer to English and Mathematics.

High Level languages are relatively easy for people to learn and to program computers. Fig 4.2, shows examples of four programs written in diffe rent high level programming languages which display the message “Hello World” on the computer screen.

World
High Level Programming Languages

The computer cannot understand instructions given in a high level language. A transla tor is needed to convert the high level language program into machine code. Imagine that you got an opportunity to go to Japan as part of a student exchange program. As a student ambassador you need to make a speech to students about Sri Lanka. How would you carry out your speech?

If you knew how to speak in Japanese, that would be the best way to carryout your speech. But if you knew English couldn’t you still made the speech? You could by getting help of a translator who is conversant in both Japanese and English. This is exactly how things work in a computer. A translator is used to translate instructions given in a high level language into machine code.

Coming back to the earlier example you could use two approaches to conduct your speech. One way to carry out your speech is for you to speak a few sentences in English and pause allowing the translator to repeat what you have said in Japanese. The second approach is that you could prepare your speech before hand and give awritten copy of it to the translator. You could conduct your speech completely in English. Your Japanese friends would not understand anything you say, but would probably patiently wait till you finish. After you have finished the translator could now repeat your entire speech in Japanese.

These two approaches are used by computers to translate high level language programs to machine. Translator software which uses the first approach are called Interpreters and the latter are known as compilers.

An Interpreter converts a program written in a high level language to machine code as follows.
1. Interpret the next high level language instruction to machine code
2. Execute translated machine code instruction
3. Goto 1st step

A compiler on the other hand translates (compiles) the entire high level language program into machine code. The converted machine code program is usually stored on disk. In Microsoft Windows such machine code files generally have the extensions .EXE. You can get the computer to execute these instructions by running
the executable file. i.e. by typing the name of the executable file in the command prompt or by selecting the executable using the Windows Task Bar Run command.

There are hundreds of different high level programming languages available with newer ones being developed regularly. This is because different people have made different attempts to make Programming (Writing Computer programs) much easier. Some of the high level computer languages are general purpose. This means that these languages could be used to write programs which solve a wide range of problems. These could include, business applications, games, web applications etc. Java, C++, Visual Basic are example of such languages.

There are some high level languages which are special purpose. These languages are intended for writing specific types of programs only. For example COBOL was a language that was used for developing Business type applications. Fortran is used to developing scientific, engineering types of applications. Most of the languages that are used in the software industry fall into the Third Generation Computer Language category..

0 comments

Post a Comment