Skip to content
UPEEC

Compilers and Interpreters

Compilers translate a whole program to machine code before it runs; interpreters execute it statement by statement.

Beginner
Comments 0
  • A compiler (C, C++, Rust) translates source code into machine code ahead of time. Result: fast executables, errors caught early, but you must rebuild for each target CPU.
  • An interpreter (classic Python, JavaScript engines start this way) reads and executes code at run time. Result: quick to try changes, slower execution.
  • Hybrid (Java, C#): source → bytecode → run on a virtual machine, often with a JIT (just-in-time) compiler.

For microcontrollers you use a cross-compiler — it runs on your PC but produces machine code for the chip, e.g. arm-none-eabi-gcc for ARM Cortex-M.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.