1. Explain the distinction between interpretation and compilation. What are the
ID: 3663157 • Letter: 1
Question
1. Explain the distinction between interpretation and compilation. What are the comparative advantages and disadvantages of the two approaches?
12. Is Java compiled or interpreted (or both)? How do you know?
13. What is the difference between a compiler and a preprocessor?
14. What was the intermediate form employed by the original AT&T C++ compiler?
15. What is P-code? 16. What is bootstrapping? 17. What is a just-in-time compiler?
18. Name two languages in which a program can write new pieces of itself “on the fly.”
19. Briefly describe three “unconventional” compilers—compilers whose purpose is not to prepare a high-level program for execution on a microprocessor.
20. List six kinds of tools that commonly support the work of a compiler within a larger programming environment.
21. Explain how an IDE differs from a collection of command-line tools.
Explanation / Answer
1. Compiler takes the whole program as input, whereas the interpreter takes one line of input at a time. Compiler converts the high level language into machine(low) level language using some intermediate language. Whereas the interpreter converts directly from high level language to machine language. In case of compiler if errors encountered all the errors are displayed after checking the entire code, whereas if it is interpreter as it takes only one line of code at a time, if an error encounters at some line, the code stops interpreting at that moment and will not proceed further.
12. Java is both compiled and interpreted. javac is a Java compiler which takes the high level language as input and will convert into an intermediate code called byte code which is machine independent. It can then be given to the Java interpreter which converts the byte code into object code which is machine understandable so that it can be executed on that machine. Hence Java is both compiled and interpreted.
13. As the name itself suggests the preprocessor processes the program on a whole and will do the required replacements and arrangements before submitting the code to the compiler. The preprocessor will replace some of the code with the required specifications. Usually the preprocessing instructions will start with a hash (#) symbol. The compiler then compiles the code and will convert into machine level language.
14. The C++ compiler initially converts the high level language into C language and is then given as input to the C compiler. C++ compiler adopts the C compiler for compiling. This is the reason C++ is initially called C with classes.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.