• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

What’s Being Compared

Both compilers and interpreters translate high-level language to executable form, but they differ fundamentally in when and how translation happens. This distinction shapes language design, tooling, debugging, and deployment.

The Core Tension

A compiler translates the entire source program before execution, producing a separate executable. An interpreter translates and executes the program line by line during execution. The trade-off is between runtime performance (compiler) and development flexibility (interpreter).

Comparison

DimensionCompilerInterpreter
TranslationEntire program ahead of timeLine by line during execution
Execution speedFast (pre-compiled)Slow (translation overhead at runtime)
OutputSeparate executable fileNo separate file — runs immediately
DebuggingHarder (disconnected from source)Easier (direct source interaction)
Error detectionBefore execution (compile time)During execution (runtime)
Memory usageLower at runtimeHigher (translator stays in memory)
PortabilityRecompile for each targetRun interpreter on each target
SecuritySource not distributedSource (or bytecode) must be present

When to Choose Compiler

  • Performance-critical applications
  • Production deployment (fast startup and execution)
  • Applications distributed without source
  • Languages with static typing and compile-time checks

When to Choose Interpreter

  • Rapid prototyping and development
  • Scripting and glue code
  • Interactive programming environments (REPLs)
  • Educational settings

The Insight

Modern languages blur the distinction — Java is compiled to bytecode (by javac) then interpreted/JIT-compiled by the JVM. Python compiles to bytecode (.pyc) before interpretation. The practical reality is a spectrum from pure compilation (C, Go) through JIT compilation (Java, C#) to pure interpretation (bash, early Python).

Connections