Home›Lesson Plans›Computer Science›Programming · Grade 11

How Code Runs: Compilers & Interpreters

Eleventh graders learn what happens between writing code and running it: a computer only understands machine code, so source code must be translated — all at once by a compiler, or line by line by an interpreter. They check the ideas, then classify real languages.

Grade 11How Code Runs: Compilers & Interpreters55 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Explain source vs machine code.
  • ✓Compare compiler & interpreter.
  • ✓See the tradeoffs.
  • ✓Classify real languages.
Essential Question

How does the code you type actually get run by a computer?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Check It · Interactive

How Code Runs

Project each item and have students answer about compilers and interpreters.

⚙️ Understand how your code gets runTry it
Answer each question about how code runs.
The Lesson · Explicit teaching

55 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Lost in Translation

6 min

Your computer does not speak Python — so how does it run it?

👩‍🏫 Teacher Moves

  • Pose the question.
  • Share ideas.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Share.
  • Get ready.
2

Use — Compilers & Interpreters

13 min

Students learn.

👩‍🏫 Teacher Moves

  • Send students to How Code Runs.
  • Note translation to machine code.
  • Note compiler vs interpreter.

🎒 Student Actions

  • Answer.
  • Note it.
  • Note it.
3

Modify — Trace It

14 min

Students practice.

👩‍🏫 Teacher Moves

  • Say what a compiler does.
  • Say what an interpreter does.
  • Name a tradeoff.

🎒 Student Actions

  • Say.
  • Say.
  • Name.
4

Create — Classify It

15 min

Students apply.

👩‍🏫 Teacher Moves

  • List a few languages.
  • Mark compiled or interpreted.
  • Say one effect of each.

🎒 Student Actions

  • List.
  • Mark.
  • Say.
5

Reflect — Reflect

7 min

Students close.

👩‍🏫 Teacher Moves

  • Define machine code.
  • Compiler vs interpreter?
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
3A-CS-02

Explain levels of abstraction and translation.

CSTA
3B-CS-02

Explain how abstractions hide complexity.

CSTA
3A-AP-21

Evaluate how programs are executed.

ISTE
5a

Understand how systems run code.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Translation diagram.
  • Frame: "code is translated into ___."
  • Use a simple example.

Support & Access

IEP / 504
  • Start with "code must be translated."
  • One difference.
  • Use a visual.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Explain bytecode & the JVM.
  • Compare compile vs run time.
  • Time a compiled vs interpreted run.
Materials

What to gather

  • 📽️Screen / board
  • ⚙️Translation diagram
  • 💻How Code Runs
  • 📋Language sort sheet
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

source codethe code you writemachine codeinstructions the CPU runscompilertranslates all code firstinterpreterruns code line by linetranslateconvert to machine codeexecuterun the programruntimewhile the program runsabstractionhiding lower-level detail
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
Why must source code be translated?
The computer only runs machine code.
QUESTION 2
What does a compiler do?
Translates the whole program into machine code before it runs.
QUESTION 3
What does an interpreter do?
Runs the code line by line, translating as it goes.

Reflect: how code runs.

Have students classify real languages as compiled or interpreted. A printable sort sheet is in the CS library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 Compilers & InterpretersFlip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 Compilers & InterpretersQuiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ Compilers & InterpretersPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: abstraction, compiler, execute, interpreter, machine code, runtime, source code, translate
  1. translates all code first
  2. while the program runs
  3. the code you write
  4. convert to machine code
  5. hiding lower-level detail
  6. run the program
  7. instructions the CPU runs
  8. runs code line by line

Part B · Show what you learned

  1. Why must source code be translated?
  2. What does a compiler do?
  3. What does an interpreter do?
Answer key — Part A: 1) compiler · 2) runtime · 3) source code · 4) translate · 5) abstraction · 6) execute · 7) machine code · 8) interpreter
Part B: 1) The computer only runs machine code. 2) Translates the whole program into machine code before it runs. 3) Runs the code line by line, translating as it goes.