Introduction
Imagine you want to tell a computer what to do, but the computer only understands a special language made of numbers. The problem is how to change the instructions you write into this language the computer can follow.
Think of a compiler like a translator who turns a recipe written in French into English so a cook who only speaks English can follow it. The translator also checks if the recipe makes sense and points out any mistakes.
┌─────────────┐ ┌───────────────┐ ┌─────────────┐
│ Source Code │ →→→ │ Compiler │ →→→ │ Output Code │
└─────────────┘ └───────────────┘ └─────────────┘
↑ │ ↓
│ │ ┌───────────┐
│ └────────────>│ Errors │
│ └───────────┘