Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 02 · How Computers Work · The machine runs a program · about 15 min to read

Play it as a journeyTutor comes with a plan

How Code Becomes Execution (compilers, stack & heap)

How Code Becomes Execution
How Code Becomes Execution · Open board

The road from the words you type to the bytes the chip runs, and the two work areas a running program keeps while it’s on that road: one that grows and shrinks with every function call, one that holds anything that has to outlive the call that made it.

Before you start. The CPU (fetch-decode-execute, the ISA, assembly) left you with a chip that does exactly one thing, forever: fetch an instruction, decode it, run it - it has no idea what a word, a loop or a function is. The Memory Hierarchy (cache, locality, the memory wall) left you with the other half: while that chip runs, everything the program is working on sits in memory, in copies at different speeds.

Lesson 8 of 41 in How Computers Work

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 1952: “Nobody believed that”
  • The fix: translate it all first, or one line at a time
  • While it runs, where does any of this live?
  • A call, traced: the ticket that says where to come back
  • When a card overflows
  • Down to the bytes

Terms it explains: compiler, interpreter, stack, heap, pointer, buffer overflow, use-after-free, memory leak, AST, bytecode, CALL/RET, dereference (*), GC, JIT, linker, segfault, stack frame, stack overflow, use-after-free / dangling pointer.

Review How Computers Work