Anonymous

What Is Compiler, Interpreter, Assembler?

15

15 Answers

Joe McHugh Profile
Joe McHugh answered
A compiler is responsible for translating a source code, which is written in a programming language, into a target language. This is most commonly done in order to create an executable program. A compiler is mainly used for programs that translate a source code into an assembly language or machine code, which are both a lower level language than the source code.

There are different types of compilers, for example, a cross-compiler is one that will run a compiled program on a computer whose operating system or CPU is different from the one on which the compiler runs; and a decompiler translates from a low level language to a higher one.

An interpreter is a program that carries out the instructions that are written in a programming language. It can do this in a number of ways: It can directly perform the source code; it can decipher the source code into an efficient code (also known as intermediate representation) and implement this straight away; or it specifically carries out a precompiled code that has been made and stored by a compiler.

Compiling and interpreting are the two primary ways that programming languages are realised.

Assemblers create an object code by translating assembly instruction mnemonics into opcodes. They also determine symbolic names for memory locations as well as for other entities. A prime characteristic of assemblers is the use of symbolic references, which saves time consuming manual calculations and address updates after a program has been modified. The majority of assemblers also have macro facilities so that they can perform textual substitution, which means that they are able to create short sequences of instructions.

It is easier to write an assembler for high level languages than it is to write a compiler, and in fact, they have been around since the 1950s.
Hassan Raza Profile
Hassan Raza answered
Compiler: A compiler is program that converts the instruction of a high level language into machine language as a whole. A program written in high level language is called source program. After the source program is converted into machine language by the compiler, it is called an object program.

The compiler checks each statement in the source program and generates machine instructions. Compiler also checks syntax errors in the program. A source program containing an error cannot be compiled into an object program.

A compiler can translate the programs of only that language for which it is written. For example C++ compiler can translate only those programs, which are written in C++. Each machine required a separate compiler for each high level language.

Interpreter: An interpreter is a program that converts one statement of a program at a time. It executes this statement before translating the next statement of the source program. If there is an error in the statement, the interpreter will stop working and displays an error message.

The advantage of interpreters over compilers is that an error is found immediately. So the programmer can make corrections during program development.

The disadvantage of interpreter is that it is not very efficient. The interpreter does not produce an object program. It must convert the program each time it is executed. Visual basic uses interpreter.
Anonymous Profile
Anonymous answered
What are the differences between a compiler, interpreter and assembler?
piyoosh tripathi Profile
Assembler- A computer program that takes computer instructions and converts them into a pattern of bits that the computer can understand and perform by it certain operations.

Compiler- This is a special program that processes statements written in a programming language and turns them into machine language that a computer's processor uses.

Here is an article that explains the difference between a compiler and an interpreter.

Structured Programing- a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify.
Anonymous Profile
Anonymous answered
A compiler translates a program from one computer language ( source language ) into a program in another computer language ( target language ). The source language for a compiler is usually a high level language There are several kinds of computer languages and computer language translators.

An assembler consists of little more than a table look up routine, where each word of the source language ( assembly language ) is looked up in a table for its numerical equivalent, which is then output as part of the target language program. Assembly language generally gives the programmer precise and direct access to every capability of the computer hardware.

Whereas a compiler will translate a computer program into machine code that executes at a later time, an interpreter actually executes the program as it is read. An interpreter must read its input program over and over to compute the results, but a compiler translates it only once. Compilers take longer to get the output from the first time a computer program is run, but subsequent runs are much faster because no additional translation is needed.
John Pol Profile
John Pol answered
Assembler is the step comes in between a sorce code
and .exe file.the steps are like this Sorce code--
Preprocessor-->compiler(Assemble code)-->Assembler(Object
Code)-->Libraries linking-->executable files created.
"The assembler creates object code. On a UNIX system you
may see files with a .o suffix (.OBJ on MSDOS) to indicate
object code files".
Anonymous Profile
Anonymous answered
Figure out atleast three major differences b/n compiler, interpreter and assembler?
Anonymous Profile
Anonymous answered
An assembler is a program that takes basic computer instructions and converts them in to a pattern of bits that the computer processor can use to perform its basic operations
Anonymous Profile
Anonymous answered
A compiler translates a program from one computer language ( source language ) into a program in another computer language ( target language ). The source language for a compiler is usually a high level language There are several kinds of computer languages and computer language translators.

An assembler consists of little more than a table look up routine, where each word of the source language ( assembly language ) is looked up in a table for its numerical equivalent, which is then output as part of the target language program. Assembly language generally gives the programmer precise and direct access to every capability of the computer hardware.

Whereas a compiler will translate a computer program into machine code that executes at a later time, an interpreter actually executes the program as it is read. An interpreter must read its input program over and over to compute the results, but a compiler translates it only once. Compilers take longer to get the output from the first time a computer program is run, but subsequent runs are much faster because no additional translation is needed.
Ren Yan Profile
Ren Yan answered
Compiler translate the whole program at once to produce the object cod.
Interpreter translate the program statement by statement.
Source link  innovation.colorado.edu target="_blank" rel="external">en.wikipedia.org
Anonymous Profile
Anonymous answered
Compiler means which takes source code as input and convert it into m/c readable code at once.
Whereas interpreter will convert source code into m/c readable code line by line.

Answer Question

Anonymous