Crafting Interpreters · Week 1

Crafting Interpreters 2: A Map of the Territory: reading guide

Read the chapter

A tour of the parts of a language implementation: scanning, parsing, static analysis, intermediate representations, optimization, code generation, virtual machines and runtimes, plus the shortcuts and alternate routes like transpilers and JITs.

Time About 2 hours this week

Why it matters

This map tells you where every later chapter fits. It is also the vocabulary you need to read about any real compiler or VM.

How to approach it

Read it once now, then come back to it when you start clox in week 8; it will make more sense the second time. Sketch the mountain diagram from memory afterward.

Challenges

3 challenges at the end of the chapter.

Challenge 1 (find the scanner and parser in a real open source implementation) is the most valuable; pick a language you use and actually open the source. The other two are think-about-it questions.

Traps

  • Trying to memorize every term. You will learn them by building them.

Links

Back to week 1