sicp.io

Read the idea. Run the program.

Structure and Interpretation of Computer Programs

Study procedures, data, state, evaluators, and register machines through 105 lessons. Each lesson pairs the text with runnable Scheme-compatible source and an execution trace.

Explore the course

Start the course.

0 of 105 lessons complete0%

SICP code
(define (factorial n)
  (if (= n 0)
      1
      (* n (factorial (- n 1)))))

(factorial 6)
; → 720

See source and result together.

The example above defines factorial recursively. Every lesson embeds a browser workbench where the code runs with its output, values, and execution trace.