COMPILER vs INTERPRETER
The interpreter is software that is able to execute program code (written by the programmer) and then translate it into machine language, in order that the machine carries out the instructions requested by the programmer. The commands made by the programmer are executed line by line, while following the logic contained within the code. This process is extremely different from the compiler, where within the compiler, the results are already within the sort of one command within the sort of machine language, where the translation process is carried out before the program is executed.
Whereas Compiler itself is a system program that is used as a tool in programming. Software that does the process of translating code (which is made by the programmer) into machine language. The result of this translation is machine language. In some compilers, output in the form of machine language is implemented with a different assembler process.
To be clearer about the differences between Interpreters and Compilers, it helps me explain in more detail about these two things.
Difference between Compiler and Interpreter:
1. If you want to run a compiled program you can do it without needing the source code. The interpreter needs source code.
2. If the compiler, then making code that can be run by the machine is done in 2 separate stages, namely parsing (making code objects) and linking (combining object code with the library). There is no separate process for interpreters.
3. If the compiler needs a linker to combine the object code with various libraries in order to produce a code that can be run by the machine. Interpreters don't need linkers to combine object code with various libraries.
4. Interpreter is suitable for making / testing modules (sub-routines / small programs). So the compiler is rather troublesome because to change a module / small object code, the linking process must be done / re-merging all objects with the required library.
5. The compiler can optimize / improve the quality of the code that can be run. Some are optimized to be faster, some are smaller, others are optimized for systems with multiple processors. If interpreters are difficult or even cannot be optimized.
understanding of compilers & interpreters
understanding of compilers
For years, high-level language programming (high level languange-HLL) has been known outside in the computer programming environment because of its ease of manufacturing. In recent years there have been two factors of concern in program development, namely: program stability and maintenance. As is known, computers do not 'recognize' HLL, so we need a conversion into machine language.
Compiler is a program that translates from HLL into machine language on a computer. Besides the translation program, the compiler also has several important functions, such as diagnostics, for example the ability to detect errors. A violation of the HLL specification will be detected and reported to the programmer by the compiler so that it is immediately repaired so as to facilitate the formation of machine language equivalents.
interpreter understanding
Interpreter is software that's ready to execute program code (written by the programmer ) then translate it into machine language , so that the machine carries out the instructions requested by the programmer. The commands made by the programmer are executed line by line, while following the logic contained within the code.
This process is extremely different from the compiler , where within the compiler, the results are already within the sort of one command within the sort of machine language , where the translation process is carried out before the program is executed. The interpreter will translate the language into the target language directly orally while the translator will translate the language into the target language in writing.
Java is run using an interpreter, the Java Virtual Machine (JVM). This causes the Java ASCII text file that has been compiled into Java bytecodes are often run on different platforms.
compiler and interpreter:
They are both the same as they achieve the same goal, but inherently different about how they achieve that goal. Compiled code takes the program (source) written in several types of programming languages, and then finally translates them into object code or machine language. The compiled code does the job much more efficiently, because it produces a complete machine language program, which can then be executed. The interpreter translates the instructions one at a time, and then executes the instructions immediately. Compiler itself is a computer program written usually in several language implementations.
Compilers and interpreters are both what we call translators. Their aim is to translate source language programming code such as (C ++, VB, Java, assembly and so on) into low-level languages (machine language) that are understood by computers.
How translators differ:
Compiler translates sorce code at once.
The interpreter translates the whole ASCII text file one line at a time.
Assembler may be a utility wont to translate programming language statements into the target computer's machine language .

No comments:
Post a Comment