Introduction
When a programmer writes code, it needs to be turned into instructions a computer can understand. This process is done by a compiler, which has two main parts that handle different jobs to make this happen smoothly.
Imagine writing a recipe in your native language and then having a chef translate it into a cooking plan for a kitchen robot. First, the recipe is checked for clarity and correctness, then it is converted into precise steps the robot can follow.
┌───────────────┐ ┌───────────────┐
│ Source Code │────▶│ Front-End │
│ (Human Code) │ │ (Parse & Check)│
└───────────────┘ └───────────────┘
│
▼
┌───────────────┐
│ Intermediate │
│ Representation│
└───────────────┘
│
▼
┌───────────────┐
│ Back-End │
│ (Generate & │
│ Optimize Code)│
└───────────────┘
│
▼
┌───────────────┐
│ Machine Code │
│ (Computer Run)│
└───────────────┘