High-level source code is converted to native machine code either by an interpreter or a compiler. Interpreted code requires a runtime in order to perform the conversion each time the program is executed whereas compiled code typically produces a standalone machine code program that can be executed without further interpretation. There are some exceptions, most notably Java which is first compiled to Java byte code which is then interpreted by the Java virtual machine on each execution.
An interpreter always converts high-level code to native machine code but, because it must perform the conversion while the code is executing via the interpreter, interpreted code executes much more slowly than native machine code.
Technically, a compiler is simply a program that converts high-level code to a lower-level code. That lower-level code could be another high-level language. For example, a C++ source could be compiled to produce a C source. However, converting the other way around (such as from C to C++) can only be done manually because humans can think in abstract terms far more easily than machines can.
Low-level assembly language source are converted to machine code using an assembler. Machine code can also be disassembled to produce an assembly-like source known as a disassembly, however the resultant code is extremely low-level because there are no named variables (only memory offsets) and all user-comments will have been stripped out during assembly or compilation.
This depends upon the programming language.
For C, there are several steps that the source code must go through before it can be executed:
1) Preprocessing: the CPP processes all macros - all the keywords which start with a '#'
2) Compiling: This converts the source code into assembly code
3) Assembly: This converts the assembly code into machine code, which is placed in an object file (object files do not c
4) Linking: combines various object files together to build the executable file
5) Loader: Loads the executable file into an appropriate location in memory and starts execution (this step is not as easy as it sounds, as some programs are not "position independent", meaning that they can't be placed anywhere in memory)
Note that modern compilers frequently combine steps 2 and 3 together, and skip assembly code altogether.
Other programming languages are interpreted, or compiled multiple times.
Java for example is compiled into "byte code" which is either interpreted by the JVM (Java Virtual Machine) or JIT compiled (Just-in-time) by the JVM into machine code. Even though java is compiled twice, it should be noted that the JIT compilation is done "on the fly", and does not produce an executable. Executable code fragments are compiled as needed and loaded into memory when it is time to execute the code fragment.
A Compiler translates source code into target language.
A target language may be machine language or assembly language . If it is an assembly language then it can be further converted to machine language.
A compiler takes the whole source code check it for errors and generates the target code.
A compiler is a separate program that converts the entire source program into machine language before executing it. However, a compiler only translates one translation unit at a time, creating an object file from each unit. A linker is required to link these object files together. Execution is not part of the compilation/linking process, that has to be done manually. However, most integrated development environments will provide a single-click "build" option that compiles, links and then executes the resultant machine code (unless any errors occur at compile time or link time of course).
Compiler translator translates entire programe into machine code.
Assembler and/or Compiler.
Compiler or Assembler
Compiler
Translator means it is a one kind of changer that change the program in to the machine language code.There are two types of language translator Compiler and Interpreter.Compiler complies the entire program before translating in to the machine code.Whereas Interpreter translates and executes the program line by line.
Machine language is the native language of the machine and requires no translation. Every other programming language must be translated into machine code in order to execute, which means you need to program the computer to perform that translation. A compiler translates the entire source code to produce a machine code executable, whereas an interpreter translates high-level statements as they are executed within the runtime environment.
The Java Runtime Environment (JRE) converts the byte code to machine language.
A compiler is a program that translates a programming language (like c++, java, pascal, php etc...) to a language that computers can "understand" (i.e. "1001010110101010...")
Assembly langue is translated into machine language by an assembler.
Translator means it is a one kind of changer that change the program in to the machine language code.There are two types of language translator Compiler and Interpreter.Compiler complies the entire program before translating in to the machine code.Whereas Interpreter translates and executes the program line by line.
an assembler is aroutine program that translates assemly language source code to a machine language object code
Machine language is the native language of the machine and requires no translation. Every other programming language must be translated into machine code in order to execute, which means you need to program the computer to perform that translation. A compiler translates the entire source code to produce a machine code executable, whereas an interpreter translates high-level statements as they are executed within the runtime environment.
The Java Runtime Environment (JRE) converts the byte code to machine language.
A compiler is a program that translates a programming language (like c++, java, pascal, php etc...) to a language that computers can "understand" (i.e. "1001010110101010...")
Two types of language translators are: a compiler, which translates the entire source code into machine code before running the program, and an interpreter, which translates and executes the source code line by line.
Compiler -- spends some time evaluating the entire program and then translates all the programming statements of a program into a machine language program, which is then executed at once.Interpreter -- translates interactively each programming statement into an immediately usable machine language instruction. Although an interpreter slows down the execution speed of a program somewhat, it does not require extra steps to compile and link like a compiler.In a production environment where throughput is more critical, a compiled language is preferred.Any high-level language can either be interpreted or compiled.
Assembly langue is translated into machine language by an assembler.
Translator is defined as a computer program that converts instructions written in one language to another without changing the initial logic in terms of computer language.
A translator takes a program written in source language as input and converts it into a program in target language as output. It also detects and reports the error during translation. • Translating the high-level language program input into an equivalent machine language program.
SOURCE PROGRAM=A set of instructions of the high level language used to code problems to find its solution on a computer is referred as source program. OBJECT PROGRAM=The computer translates the source program into machine language program called object program by using an interpreter or compiler is called object program.
This is usually the first stage in compilation. The source code is read and checked for syntax and usability then passed to the compile stage to be converted to object (or machine) code that the computer can understand.Translator translates program written in one programming language into (equivalent) program written in another language. For example, Java to C# translator would translate Java program into (equivalent) C# program. This is similar to as if you would translate some text in English into Spanish or vice versa.If target language is lower level language like assembly language, machine language, or pseudocode, translator is called compiler. For example, some C++ compiler could compile (translate) program in C++ into machine code.