Description
Crafting Interpreters by Robert Nystrom, ISBN-13: 978-0990582939
[PDF eBook eTextbook] – Available Instantly
- Publisher: Genever Benning
- Publication date: July 28, 2021
- Language: English
- 639 pages
- ISBN-10: 0990582930
- ISBN-13: 978-0990582939
Despite using them every day, most software engineers know little about how programming languages are designed and implemented. For many, their only experience with that corner of computer science was a terrifying “compilers” class that they suffered through in undergrad and tried to blot from their memory as soon as they had scribbled their last NFA to DFA conversion on the final exam.
That fearsome reputation belies a field that is rich with useful techniques and not so difficult as some of its practitioners might have you believe. A better understanding of how programming languages are built will make you a stronger software engineer and teach you concepts and data structures you’ll use the rest of your coding days. You might even have fun.
This book teaches you everything you need to know 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.
Starting from main(), you will 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 wrote each one yourself.
Table of Contents:
FRONTMATTER
Dedication
Acknowledgements
I. WELCOME
1. Introduction
Design Note: What’s in a Name?
2. A Map of the Territory
3. The Lox Language
Design Note: Expressions and Statements
II. A TREE-WALK INTERPRETER
4. Scanning
Design Note: Implicit Semicolons
5. Representing Code
6. Parsing Expressions
Design Note: Logic Versus History
7. Evaluating Expressions
Design Note: Static and Dynamic Typing
8. Statements and State
Design Note: Implicit Variable Declaration
9. Control Flow
III. A BYTECODE VIRTUAL MACHINE
14. Chunks of Bytecode
Design Note: Test Your Language
15. A Virtual Machine
Design Note: Register-Based Bytecode
16. Scanning on Demand
17. Compiling Expressions
Design Note: It’s Just Parsing
18. Types of Values
19. Strings
Design Note: String Encoding
20. Hash Tables
21. Global Variables
22. Local Variables
23. Jumping Back and Forth
Design Note: Considering Goto Harmful
24. Calls and Functions
25. Closures
Design Note: Closing Over the Loop Variable
26. Garbage Collection
Design Note: Generational Collectors
27. Classes and Instances
28. Methods and Initializers
Design Note: Novelty Budget
29. Superclasses
30. Optimization
BACKMATTER
A1. Appendix I: Lox Grammar
A2. Appendix II: Generated Syntax Tree Classes
Design Note: Spoonfuls of Syntactic Sugar
10. Functions
11. Resolving and Binding
12. Classes
Design Note: Prototypes and Power
13. Inheritance
What makes us different?
• Instant Download
• Always Competitive Pricing
• 100% Privacy
• FREE Sample Available
• 24-7 LIVE Customer Support