Caffeinated Coder
Book an appointment
Lesson 24 · How programs really run

Compilers and interpreters up close

The CPU only runs machine code, so every program you write has to be translated. Follow one line of Python, return len(alist), as a lexer cuts it into tokens and a parser builds a syntax tree. Then see the three roads from there: a compiler such as clang writes machine code ahead of time, CPython writes bytecode that its virtual machine runs, and a JIT compiles the hot code while the program runs. Each road trades start-up time, speed and portability differently.

12 min10 steps5 questionsIntermediate
Fig 24 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.