What Is Compiler And Why Do We Need Compilers?


15 Answers

Amen Bukhari Profile
Amen Bukhari answered
For performing different task on the computer, a compiler is communication medium that translate source language into target language. Compiler allows the user to perform customized task on machine. Initially for writing compiler machine language was used. After some development assembly language and these days high level language are used for writing compiler. We need compiler because it allows us to communicate with hardware. It is also use to cover the "GAP" between Humans and the computer language. Computer can understand only one language that binary language consists of only two digits are 0 and 1.

Binary language is also called machine language. When there is only Machine Language then programmers write their compilers in this language. But it is very difficult and tedious job. The role of compiler is take source code written in high level language (Java, C++, VB.Net etc). The High Level Languages are easily understood by humans. So compiler converts the program written in formal language (Source language) into machine language (target language). As we know that computers can easily understand machine language. There are different programs related to compiler that works before compilation such as editor, preprocessor, assembler, linker or loader, debugger and profiler.
Abadit Ali Profile
Abadit Ali answered
To understand the concept of complier you must know about the program and machine codes.A program is a set of instructions which is developed by a programmer using any of the computer programming languages. These languages are human readable languages.

A machine code is a language which is readable only by a computer. A human is not able to understand the machine codes. So when the instructions are send to computer in human readable language a program is used to translate the human readable language into machine language. That program is called compiler.

The purpose of the compiler is to translate the programs written in human readable language to machine language which is understandable to computer machine. A compiler reads instruction in the programs and translates it, if there is any error it also identify it and warns about it to user. The error could be typing mistake (syntax error) or a logical error. when all the erros are removed the instructions are sent to the computer for processing.
Amen Bukhari Profile
Amen Bukhari answered
Compiler is language processor used to translate program written in high level language into the machine level language. It is also use to cover the "GAP" between Humans and the computer language. A program written in high level programming language is called the source program. The source program is stored on the disk in a file. The compiler translates the source program into machine codes and makes another program file is called the object file. The object file contains the translated program. Files, source and object are saved on the disk permanently.

The object programs translated by compiler can executed a number of times without translating it again. If there are any errors in the source program the compiler specifies the errors at the end of compilation. The errors must be removed before the compiler can successfully compile the source program.

Computer understands only two words 0 and 1. Machine language or binary languages were used to write compilers. But it is very difficult to write complex code in form of 0 and 1. So we use high level programming languages are used to write compiler. Compiler is also used to communicate with hardware.
ch ch Profile
ch ch answered
A computer can take data in binary digits. every character (a-z,0-1,@,!,etc...) has a specific code called as ASCII codes .system takes in data by converting these ascii codes into binary codes .for e.g. 'a' ascii code is 65.its value in binary code is 100001. similarly every character has a ascii code and system accept it in binary mode.
system knows only binary code which is known as machine language.we enter data in English language.
but computer knows only machine a mediator is required to convert our language into machine language which is called translator.
you may heard about languages such as c,c++,java etc.. using these ,programs(software) are written in our language . A compiler is nothing but a translator which translates these programs into machine level language.Computer accepts it and process according to the instructions and give input in machine level language.A compiler translates this into
our language.
maheen mirza Profile
maheen mirza answered
It is one of the language translators.These are used to translate the entire program at once and store their translated form on disk.These translators cannot execute the translated program .It has to go through some other stages to be able to get executed.
Anonymous Profile
Anonymous answered
Every language has its own syntax that's why the concept of compiler arose! By compiler the syntax of one language is understood and converted into the parse tree which can be easily converted into any other language.
Anonymous Profile
Anonymous answered
Compiler is to communicate between human and machinee.It converts high level language into machinee language . Computer understand only machine language i.e binary language      ( 0 and 1.)
Anonymous Profile
Anonymous answered
New compilers support configurable architectures
and can generate efficient instruction
schedules for cores that support high levels of instruction
and/or data parallelism. Today's leading
compilers achieve a level of efficiency where
it is no longer required to write performancecritical
code in assembly instead of C. Although
Altium’s Viper compiler framework is designed
to support the processor architectures of the 21st
century, there seem to be remarkable advantages
in execution speed and code size of about 10 and
40% when compilers for traditional 8 and 16-bit
processors are built with Viper.
Nisar Adil Profile
Nisar Adil answered
Before going to the compiler definition and explanation. First you must know why we need a compiler so the answer is that the computer only understands the binary language i.e. 1 and 0 for example 10+10=20 the computer calculate it as binary of 10 which is 1010. And how this binary value is calculated is shown below.    2 10  2 5 0  2 2 1  2 1 0  We have different languages which helps us in developing certain application programs etc e.g. C, Cobol, Pascal etc. So the compiler is needed in this stage so that the compiler can convert the statements written in a certain language to the computer language, each language has its own compiler once a programmer writes certain statement in the language tool and the file created in the language tool is called source code or source statement the compiler parses or analyses the statements for Syntax error so that the processor can read and execute it. Normally the output of the compilation is called the object module or object code. And the object code is the code that the processor executes on instruction at a time.  The compilers work with the higher level languages that are also called at third generation languages or 3GL.
sharath kumar Profile
sharath kumar answered
It's a program that decodes instructions written in a higher order language and produces an assembly language program.. I.e. The programme written by humans can't be understood by comp.. So the compiler transforms this prog to machine understood language.!! And this exactly does the job like a translator for the ppl who doesn't get the language of other countries..!!! Hope this helps you..!!!
Wendy Profile
Wendy answered
It is a computer program that translates one computer language into another computer language. The reason for something like this is so that the computer can more easily process and understand the information.
Anonymous Profile
Anonymous answered
Compiler is a pgm which is used 2  convert  higher level  language  2  lower level language .ie, human readable pgm into  machine readable pgm,.
Anonymous Profile
Anonymous answered
A compiler converts programming language commands into machine code.

It's a lot easier programming in commands like "Register A add Register B" than "010101011 10101111 11101010 10100001."   All the computer understands is ones and zeros, and humans don't work well with binary.

Answer Question