answersLogoWhite

0

Compilers are only necessary for programmers; ordinary users do not require them. A compiler is a program which converts a high-level source input into a lower-level source output, reducing the amount of abstraction. In most cases the output is native machine code and/or an assembly source, however there are some exceptions, such as the Java compiler which outputs Java byte code, and cross-language compilers such as C++ to C compilers.

Machine's do not understand either high-level source code or low-level assembly code, they only understand their own native machine code. Thus conversion to machine code is necessary. Once converted to machine code, no further translation is necessary.

Assembly sources must be converted using an assembler, however assembly is a machine-dependent language (it is non-portable). High-level languages are generally portable and are either compiled or interpreted. Interpretation requires a runtime program to perform the conversion while the source code is executing and performs poorly compared to a native machine code program. Java is both compiled and interpreted. That is; Java source code compiles to Java byte code which is suitable for interpretation by the Java virtual machine.

It is not possible to compile a low-level source to produce a high-level output. For example, you cannot convert C to C++ using a compiler, just as you cannot convert assembly language to C. Compilers can only reduce the amount of abstraction in the source code, not increase it. If you want to add more abstraction, you need to do so manually.

User Avatar

Wiki User

7y ago

What else can I help you with?