Multiple choiceQuestion 1 · Apply
Loading…
By the end you can give benefits and drawbacks of each approach and justify which one suits a given situation.
| Compiler | Interpreter | |
|---|---|---|
| Translation | Whole program, before running | One statement at a time, during running |
| Output | Executable machine code | None saved |
| Speed of the running program | Faster — already machine code | Slower — each statement is translated every run |
| Errors | All reported before the program runs | Stops at the first error reached |
| Portability | Executable is for one processor/OS; must be recompiled for another | Source runs anywhere an interpreter exists |
| Distribution | Can ship the executable without source code | Source code must be supplied |
| Development | Slower to test, because each change means recompiling | Quick to test changes interactively |
| Memory while running | The executable itself; no translator needed | Interpreter must be in memory too |
Exam questions usually say "justify", which means name the choice and connect it to the situation.