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 courseStart the course.
SICP code
(define (factorial n)
(if (= n 0)
1
(* n (factorial (- n 1)))))
(factorial 6)
; → 720See 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.