Programming languages can be executed using different approaches. Compiled and Interpreted languages differ mainly in how source code is translated and executed by the computer.
- Compiled Language translates the complete source code into machine code before execution.
- Interpreted language execute source code directly using an interpreter, without producing a separate machine code file.

The table below shows the major differences between compiled and interpreted languages:
| Compiled Language | Interpreted Language |
|---|---|
| Source code is generally translated into machine code before execution. | Source code is generally processed and executed at runtime. |
| A compiler is used to translate the source code. | An interpreter or runtime environment is used to execute the code. |
| Compilation produces machine code or an executable program. | The source code is generally executed without producing a standalone native executable first. |
| Compilation errors are generally detected before the program is executed. | Many errors are detected when the corresponding code is executed. |
| Once compiled, the program generally runs with less translation overhead. | Execution may have additional runtime overhead due to interpretation or runtime processing. |
| Changes to the source code usually require recompilation. | Changes can generally be tested without creating a separate native executable. |
| Generated machine code is usually specific to the target platform and architecture. | Source code can often run on different platforms when the required runtime is available. |
Real-World Examples
Compiled Languages
- C: Common in operating systems and embedded systems.
- C++: Widely used in game development and high-performance applications.
- Go: Popular for cloud services, networking, and backend systems.
- Rust: Designed for system programming and performance-critical software.
Interpreted Languages
- Python: Popular in artificial intelligence, data analysis, and automation.
- JavaScript: Mainly used in web and server-side development.
- Ruby: Commonly found in web applications and scripting.
- PHP: Primarily used for server-side web development.