Programming foundations

Stage 3 · Lesson 6 of 9

Compiled vs interpreted code

How computers run your code

The CPU only understands , so something must translate the code you write. A , as used for C++, translates the whole program ahead of time into a native , a file the computer runs directly. It catches many errors before the program runs.

An interpreter instead reads and runs a program as it goes. Most modern languages mix the two. Java and C# compile to bytecode, a middle form that a runs.

That machine also compiles the bytecode to machine code on the fly, which is called just-in-time (JIT) compiling. CPython compiles to bytecode for its interpreter. compile frequently run code while the program runs.

The practical differences are when errors appear, how fast code starts and runs, and what must be installed to run it.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Keep handy

  • Quick explanations of OS basics like processes and memory when a lecture skips a step

Also worth your time

  • Everything from a key press to a rendered page; read it after this stage

Mark this stage as not done?