Question:
What is the difference between compiler,interpreter and assembler?
2009-05-01 22:31:39 UTC
hat is the difference between compiler,interpreter and assembler
Eight answers:
just "JR"
2009-05-02 01:25:51 UTC
A compiler takes a text file written in a programming language, and converts it into binary code that a processor can understand: it makes an ".exe" file. You compile only once, then always run the "exe" file.

Borland Turbo C is a compiler: you write in C in a text file, then you compile to get and exe file.

An interpreter does the same, BUT in real time: each time you run the code, it is "compiled", line by line: Basic is an interpreter.

An assembler is similar, in the way that, instead of taking a plain text file, ie in C, it takes a code written in Assembler Mnemonics, and convert it into binaries.

All "executable" files are in binaries (just 1's and 0's) - maybe viewed in hex (0x12de...)
Arghodeep
2014-08-02 06:52:09 UTC
I Just Can Say That :



Compiler : Reads Codes Written In High Level Language(Readable Language) and Converts Them to Low level Language(Machine/Object Code) That Can Be Processed By A

Microprocessor.It Saves The Converted Codes Into File With Extension *.obj(Object File).



Note : The Converted Codes don't Get Executed At This Time.







Assembler : Same As Compiler.It Compiles The Code Written

In Assembly Language to Object Code.





Interpreter : It Reads Codes Translates Them and Execute Them

Line/Line.



Note : It Doesn't Make Any File.





Debugger : It Debugs(Removes Error) Source Code(H.L. Language).







Linker : Links Required Libraries to That Object File Codes and Makes A Single Executable File With Extension *.exe.



Note : It Can Link Multiple Object Files.
Mike L
2009-05-02 01:32:14 UTC
In a nutshell:



A compiler takes your source programming code and converts it into an executable form that the computer can understand. This is a very broad explanation though, because some compilers only go so far as to convert it into a binary file that must then be "linked" with several other libraries of code before it can actually execute. Other compilers can compile straight to executable code. Still other compilers convert it to a sort of tokenized code that still needs to be semi-interpreted by a virtual machine, such as Java.



An interpreter does not compile code. Instead, it typically reads a source code file statement by statement and then executes it. Most early forms of BASIC were interpeted languages.



An assembler is similar to a compiler, except that it takes source code written in "Assembly Language", which is just shorthand for the actual machine/processor specific instructions, values, and memory locations, and it converts those instructions to the equivalent machine language. Very fast and small executable code but very tedious to write.



Incidentally, many compilers, especially older C compilers, for example, actually convert the C source code to assembly language and then pass it through an assembler. The benefit is that someone adept at assembly can tweak the compiler-generatd assembler code for speed or size.
?
2014-07-04 20:41:05 UTC
Compiler converts source code to some kind of intermediate form. For static language, a compiler usually converts the source code to assembly, which usually did not get stored to disk, then the assembler is invoked to convert the assembly to binary code, which is usually stored as object file(.o or .obj suffix usually), then linker is invoked to link object file(s) to binary executable. Also it is common to refer to this whole process of compiling, assembling, linking as compiling. So you may call gcc a compiler, but it actually invokes cc1 which is the compiler to compile, as which is the assembler to assemble, ld which is the linker to link.



For language which has a intermediate so called bytecode form, the source code is first converted to byte code, this process can be called compiling,javac serves as an example. Bytecode cannot be run on host machines, it needs a program, which is actually the process from the viewpoint of OS, to interpret the bytecode to the host machine, this program is called a interpreter, think ofjava. Some language, like python, do the compiling and interpreting work with a single command python.
2015-08-06 13:33:59 UTC
This Site Might Help You.



RE:

What is the difference between compiler,interpreter and assembler?

hat is the difference between compiler,interpreter and assembler
Alok Alok
2014-07-20 21:14:51 UTC
http://vijaybhargav05bop.blogspot.in/2013/03/assembler-compiler-interpreter-linker.html



It's a good answer.
2014-01-09 00:29:55 UTC
COMPILER: for convert high level language into machine language.

ASSEMBLER: for convert assembly language in to machine language.
Lynn
2016-03-14 03:06:47 UTC
The world is the planet Earth. The universe is the world and everything else out there.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...