Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Explain how a compiler translates a program

Trace whole-program translation, executable creation and error reporting before execution.

Section 4 · Software

Cambridge IGCSE Computer Science 0478 · Software · 2026–2028 Version 6 · 4.2

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6. It covers subject content sections 4.1–4.2 only. The separately published 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding.

Before you begin

  • No programming language is required. Be comfortable with place value and multiplication; each lesson introduces the computer-science notation it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

Does a compiler translate the whole program or one line at a time?

What you will learn

  • Describe whole-program compilation
  • Explain how an executable is produced
  • Explain how compiler errors are reported

A compiler translates the whole source program

A compiler translates the complete high-level program before execution and produces an executable file. If errors are found, it can report them for the program so the programmer can fix the source and compile again.

Apply and check the rule

Once built, the executable can run without translating each source line anew, though the machine and operating-system requirements still matter. Compilation does not guarantee the program's logic is correct; tests are still needed.

Pause and explain

When does the compiler's executable run?

Put the idea to work

Worked example

A compiler finds errors in three parts of a source file. What does the programmer usually do next?

Show the worked solution
  1. Read the compiler's report for the detected errors.
  2. Correct the source code.
  3. Compile the whole program again to produce an executable.

Answer Fix the reported source errors and recompile the whole program.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

Put the compiler workflow in order: run executable, translate all source, report errors if found.

Give me a hint

Translation occurs before execution.

Compare my reasoning
  1. Translate the complete source.
  2. Report detected errors or produce an executable.
  3. Run the executable after successful compilation.

Translate all source → report errors or create executable → run executable.

Look for these in your work

  • Whole source first
  • Error/build result
  • Run last
2 · Independent

A compiler reports syntax errors in several locations. Why can this help during development?

Give me a hint

Consider what information the report gives before running the program.

Compare my reasoning
  1. The programmer can review several detected problems.
  2. They can correct the source and compile again.
  3. The report does not prove there are no logic errors.

A whole-program report can help fix several detected errors in one edit-and-compile cycle, but testing is still needed for logic errors.

Look for these in your work

  • Multiple issues visible
  • Correction loop
  • Logic limit
3 · Transfer

A compiled program runs without syntax errors but gives the wrong answer for a valid input. Explain why compilation did not prevent the problem.

Give me a hint

Syntax and logic are different kinds of correctness.

Compare my reasoning
  1. The compiler checked translation and detected errors it recognises.
  2. The algorithm may still be logically wrong.
  3. Testing with suitable inputs is needed to find incorrect behaviour.

Compilation verifies that source can be translated, not that its algorithm produces the right answer. Test behaviour and correct the logic.

Look for these in your work

  • Translation role
  • Logic error
  • Testing need

Common mistakes

  • Saying the compiler executes each source line immediately
  • Assuming compilation proves the program is logically correct
Recall without your notes

What can you explain now?

What does a compiler produce after translating a program?

Compare with the explanation

An executable file

Compilation translates the complete source into an executable before it is run.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

What is the compiler's output, and when is it produced?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.