Crafting Interpreters
Publisher: craftinginterpreters.com
Published: 2021
Language: eng
Format: Web Book
Description: _Crafting Interpreters_ contains everything you need to implement a full-featured, efficient scripting language. You’ll learn both high-level concepts around parsing and semantics and gritty details like bytecode representation and garbage collection. Your brain will light up with new ideas, and your hands will get dirty and calloused. It’s a blast.

Starting from <code>main()</code>, you build a language that features rich syntax, dynamic typing, garbage collection, lexical scope, first-class functions, closures, classes, and inheritance. All packed into a few thousand lines of clean, fast code that you thoroughly understand because you write each one yourself.
Table of contents: title: Frontmatter; title: Dedication; title: Acknowledgements; label: I.
title: Welcome; label: 1.
title: Introduction; label: 2.
title: A Map of the Territory; label: 3.
title: The Lox Language; label: II.
title: A Tree-Walk Interpreter; label: 4.
title: Scanning; label: 5.
title: Representing Code; label: 6.
title: Parsing Expressions; label: 7.
title: Evaluating Expressions; label: 8.
title: Statements and State; label: 9.
title: Control Flow; label: 10.
title: Functions; label: 11.
title: Resolving and Binding; label: 12.
title: Classes; label: 13.
title: Inheritance; label: III.
title: A Bytecode Virtual Machine; label: 14.
title: Chunks of Bytecode; label: 15.
title: A Virtual Machine; label: 16.
title: Scanning on Demand; label: 17.
title: Compiling Expressions; label: 18.
title: Types of Values; label: 19.
title: Strings; label: 20.
title: Hash Tables; label: 21.
title: Global Variables; label: 22.
title: Local Variables; label: 23.
title: Jumping Back and Forth; label: 24.
title: Calls and Functions; label: 25.
title: Closures; label: 26.
title: Garbage Collection; label: 27.
title: Classes and Instances; label: 28.
title: Methods and Initializers; label: 29.
title: Superclasses; label: 30.
title: Optimization; title: Backmatter; label: A1.
title: Appendix I: Lox Grammar; label: A2.
title: Appendix II: Generated Syntax Tree Classes