Education

Input & Output Devices

Introduction to computer languages & compiler and interpreter



INTRODUCTION TO COMPUTER LANGUAGES &
COMPILER AND INTERPRETER


Introduction to computer languages

A language usually consists of all the verbal or written symbols and expressions that are used to exchange ideas and information . Communication can take place between individuals or between an individual and a computer . There are two basic types of languages used in computer i.e. , low level and high level languages .

I.                  Low level languages

Low level languages are compatible with the hardware of the computer and consists of binary or mnemonic codes . These languages are understood by computer in a better manner . It is difficult for the programmer to understand the low level languages . Low level languages are subdivided into Machine and Assembly languages .

A.      Machine language :

The lowest form of computer language is machine language .The only language understood by the computer is the machine language . Almost all the programs that is written are in High level languages .a computers can understand only machine language , these high level programs are translated to machine level languages using a software program . It is the most basic form of programming and hence explicit instructions are to be given to the machine to perform every operation . The machine language is preferred  for the following situations are given below :

i.                     For simple or small programs .
ii.                   Simple control applications where less computation is required .
iii.                  Application where prototype is final product .

B.      Assembly Language :

To overcome the difficulties of writing program in machine program in machine code , symbolic languages . (called assembly languages) were developed in 1950’s and were extensively used in second generation computer . These languages enabled instructions to be written using symbolic codes (called mnemonics) rather than in string of 0’s &1’s . One word represented a particular machine language instructions or words are put together to form a program , they are translate by  computer into machine language to assembly language e.g. Microprocessor 8085 , 8086 have their own assembly language .

II.               High level languages

Programming languages that are machine independent are high level language . High level languages can be used with a number of different hardware makes , with little or no modifications . These languages are easier to learn than symbolic languages e.g. , are fortron , BASIC , PASCAL , C , C++ etc. all of which have certain set of rules and draw of languages are statements rather than mnemonics . The other advantages are given below :

1.       They require less time to write
2.       These are easier to maintain
3.       High level languages provide better documentation
4.       Program written in such a language can be executed in any computer



Compiler and interpreter




COMPILER :

A compiler converts all the source code into machine code , creating an executable file . The output of the compiler is called object code . The object code must then be linked to produce a true executable file . The programmer can copy the executable object code on to any similar system and run the program .

INTERPRETER :

An interpreter also converts source code to machine code .  Instead of creating an executable object code file , however , the interpreter translates and then executable object code on to any similar system and rum the program . One line at a time . The interpreter code runs slower than complied code because the code must be interpreted each time it is run , and a copy of the interpreter must accompany the code everywhere it goes .




               

Comments