Transcript for:
Translators and Their Types

[Music] hi guys in this video we are going to discuss on what is translators and different types of translators let us consider two person trying to communicate with each other here one person knows english language and the other person knows hindi language if they communicate with each other it will not be a successful communication since both the guys don't know a common language in this scenario the translator comes into picture the translator will be knowing both the languages and it will help them to have a successful communication in between them similarly if a programmer want to communicate with the computer then there should be a translator who can convert the programming language into machine language a translator is a programming language processor that converts a computer program from one language to another it takes a program written in source code and converts it into machine code it discovers and identify the errors during the translation there are three different types of translators assembler compiler and interpreter the assembler is used to translate the program written in assembly language into machine level language if you guys want to know about what is assembly language low level language and high level language then please watch my previous video then you will be understanding this concept very well i will be giving the link in the description coming back to assembler here the source program written in the assembly language is given as input to the assembler the output generated by the assembler is the object code or machine code example for assembler translators are fab forton assembly program and map macro assembly program compiler will convert the high level language into machine level language it will read the complete source program in high level language and if the code is error free then it will convert it into machine level language if there is any error in the source code then the compiler will specify the error at the end of compilation process let us do this in practical annual check since there is no error in the code the compiler waits till the end of compilation process once the compilation is done then it will print the output as shown now we will create an error by removing the semicolon from fifth and seventh line then the compiler will begin from first and it will identify the error at fifth line but it won't stop there it will compile till the end of compilation process once the compilation process ends it will throw both the error fifth and seventh line but here it won't give any result it will throw only errors example for compilers are gcc gnu compiler collection and cobalt common business oriented language just like compiler interpreter also used to convert high level language into machine level language but it converts one at a time it will do step by step execution with this it is easier to detect errors than in a compiler it is faster than a compiler as it immediately execute the code upon reading the code it will go to the first line then it execute next it will go to the second line it executes next it will move to the third line and if it finds any error then it will stop there and it will print the result but it won't execute the fourth line let us do this in practical and we'll check here we are using python as an interpreter since there is no error in the code it will do step by step execution and it will throw the output now we will create an error in the third line we will remove t from print then we will rebuild it rebuild the program then it will print hi everyone which is there in second line when it go to third line and it will execute at that time it will find that error and it will print that error further it won't be going to fourth line it will stop at third line itself but it will be printing second line hi everyone but in case of compiler it won't print any result example for interpreters are python and lisp list processing okay friends this is it for now in the next video we will cover some more topics on programming concept