FutureLogic Lesson → Software → Cambridge IGCSE 0478

Compiler vs Interpreter vs Assembler Explained Simply

A CPU cannot run a high-level language directly — programs have to be translated first. This lesson builds the mental model behind the three translators before you ever touch a comparison table.

Compiler vs Interpreter vs Assembler Explained Simply

A CPU does not understand high-level programming languages. It only understands machine code — binary instructions. So any program written in a language like Python or Java has to be translated before it can run.

That single idea explains why translators exist at all. Once you see translation as the job, the three tools in this topic stop being a list to memorise and start being three answers to the same question: how do we turn code a human wrote into instructions a processor can execute?

⏱ Estimated time: 13–16 minutes
🎯 Level: Cambridge IGCSE 0478
📚 Pairs with the Topic 4 revision notes

Before we begin…

If compilers and interpreters blur together, it is usually because they are introduced as definitions before the reason for translation is clear. We will fix the order: first why translation is needed, then the three translators, then how to compare them.

By the end of this lesson, you will be able to:

Describe the three levels of language.
Explain what a compiler does.
Explain what an interpreter does.
Explain what an assembler does.
Compare compiler and interpreter fairly.
Avoid the common translator mistakes.

Three levels of language

Before the translators, you need the three levels of language they move between.

LevelWhat it is
High-level languageA human-friendly programming language, closer to English.
Assembly languageA low-level language that uses short mnemonics for instructions.
Machine codeBinary instructions that the processor can execute directly.

Translation is always about moving down these levels — ending at machine code, because that is the only thing the CPU actually runs.

The compiler

A compiler translates the whole high-level program into machine code before it is executed.

Syllabus-relevant consequences of that approach:

  • It can produce executable / object code as output.
  • The compiled program can then run without translating the source every time.
  • Compilation errors are typically reported after the compiler has processed the program, rather than one at a time during execution.

The interpreter

An interpreter translates and executes the high-level code instruction by instruction.

Consequences:

  • It is useful during development and testing, because you can run code and see results immediately.
  • It stops when it reaches an error, at the line where the error occurs.
  • The source program is interpreted again each time it is run.

The assembler

An assembler does a different job from the other two. It translates:

assembly language → machine code

Note the input carefully. A compiler and an interpreter both start from a high-level language. An assembler starts from assembly language. That difference in input is the cleanest way to tell the assembler apart from the other two.


Comparison table

TranslatorInputHow it translatesTypical result
CompilerHigh-levelWhole programTranslated program / object / executable
InterpreterHigh-levelInstruction by instructionExecutes during translation
AssemblerAssemblyAssembly instructionsMachine code
A useful way to picture it: a compiler is like translating an entire book before anyone reads it; an interpreter is like a live translator speaking each sentence as it is said. Same goal, very different timing.

Exam Tip: compare the same characteristic

When comparing a compiler and an interpreter, both halves of your sentence must describe the same feature — usually when translation happens.

Good: “A compiler translates the whole program before execution, whereas an interpreter translates and executes one instruction at a time.”

Common Mistakes:
  • Saying the assembler translates high-level code — it translates assembly language.
  • Claiming a compiler “finds all errors” — it reports errors after compilation, but that is not the same as guaranteeing a program is correct.
  • Claiming an interpreter never creates machine-code instructions — be careful with absolute wording of this kind.
  • Assuming a compiler automatically makes a program error-free — it does not.

Check Your Understanding

  1. Which two translators take a high-level language as input?
  2. What is the input to an assembler?
  3. State one difference between a compiler and an interpreter, comparing the same characteristic.
Check the answers

1. The compiler and the interpreter. 2. Assembly language. 3. A compiler translates the whole program before execution, whereas an interpreter translates and executes one instruction at a time.

Where each one is used in practice

The differences are not just academic — they shape when each translator is chosen. Interpreters suit development and testing, because running code line by line and stopping at the first error gives quick feedback while you are still writing. Compilers suit finished software that will be distributed, because once a program is compiled it can be run repeatedly without translating the source each time, and the source code does not need to be shared. Assemblers sit apart from both: they exist to turn assembly language into machine code, one level lower than the other two ever work.

Final Summary

Compiler

Whole high-level program → machine code before execution.

Interpreter

Translates and executes high-level code one instruction at a time.

Assembler

Assembly language → machine code.

Exam Success

Compare compiler and interpreter on the same characteristic — usually timing.

A CPU only speaks machine code. Compilers, interpreters and assemblers are just three ways of translating into that one language.
FutureLogic Education

Computer Science should feel clear, visual and achievable.

Download free revision PDFs, explore the Learning Hub, or try FutureLogic resources designed to help students move from confusion to confidence.