Indicative content
The output of each type of translator
- A compiler translates the whole program in one go and produces object code.
- The object code is saved as an executable file, which is already in machine code so the processor can run it directly.
- An interpreter does not produce object code, so no translated file exists for the company to save and sell.
- An interpreter translates one line at a time and executes it immediately, but that translation is not kept.
Whether the program has to be translated each time it is run
- Compiled code is translated once, so the executable can be run as many times as the customer likes without being translated again.
- If the source code is edited, the whole program has to be compiled again to produce a new executable.
- An interpreted program is translated again every time it is run, so a customer who runs the program often waits for translation at every run.
- An executable runs faster than interpreted code because it is already in machine code.
What the customer needs on their computer to run the program
- A customer who installs the executable needs no compiler on their computer, so the program will run straight away.
- If the company supplied the source code instead, the customer would need an interpreter installed, and it would have to be an interpreter for their type of computer.
- A customer given only the executable does not have the source code, so cannot change the program.
Conclusion
- A compiler is the better choice for this company, because the executable can be sold and the customer runs it without it being translated again and without being given the source code.
- Using an interpreter would mean supplying the source code to customers and translating the program on every run.
Levels
- Level 0 (0 marks): No rewardable content.
- Level 1 (1–2 marks): Basic, independent points are made, showing elements of understanding of key concepts/principles of computer science. (AO1) The discussion will contain basic information with little linkage between points made or application to the context. (AO2)
- Level 2 (3–4 marks): Demonstrates adequate understanding of key concepts/principles of computer science. (AO1) The discussion shows some linkages and lines of reasoning with some structure and application to the context. (AO2)
- Level 3 (5–6 marks): Demonstrates comprehensive understanding of key concepts/principles of computer science to support the discussion being presented. (AO1) The discussion is well developed, with sustained lines of reasoning that are coherent and logically structured, and which clearly apply to the context. (AO2)
Level 3 responses must cover all three bullets for this company's program, including translating once rather than on every run, and reach a conclusion.
Do not accept 'a compiler fixes errors' (a compiler reports syntax errors at the end of translation, it does not fix them) or 'a compiler is easier to use' with no link to output, translation or the customer. Do not accept answers about translating to assembly language.