Categories: Programming

Crafting Interpreters

Pdf Book Name: Crafting Interpreters
Author: Robert Nystrom
Publisher: Genever Benning
ISBN-10, 13: 0990582930,9780990582939
Year: 2021
Pages: 639 / 612 Pages
Language: English
File size: 14 MB
File format: PDF,EPUB

Crafting Interpreters Pdf Book Description:

This book is broken into three parts. You’re reading the first one now. It’s a couple of chapters to get you oriented, teach you some of the lingo that language hackers use, and introduce you to Lox, the language we’ll be implementing. Each of the other two parts builds one complete Lox interpreter. Within those parts, each chapter is structured the same way. The chapter takes a single language feature, teaches you the concepts behind it, and walks through an implementation. It took a good bit of trial and error on my part, but I managed to carve up the two interpreters into chapter-sized chunks that build on the previous chapters but require nothing from later ones. From the very first chapter, you’ll have a working program you can run and play with. With each passing chapter, it grows increasingly full-featured until you eventually have a complete language. Aside from copious, scintillating English prose, chapters have a few other delightful facets. We’re about crafting interpreters, so this book contains real code. Every single line of code needed is included, and each snippet tells you where to insert it in your ever growing implementation. Many other language books and language implementations use tools like Lex and Yacc, so-called compiler-compilers that automatically generate some of the source files for an implementation from some higher level description.

There are pros and cons to tools like those, and strong opinions some might say religious convictions on both sides. We will abstain from using them here. I want to ensure there are no dark corners where magic and confusion can hide, so we’ll write everything by hand. As you’ll see, it’s not as bad as it sounds and it means you really will understand each line of code and how both interpreters work. A book has different constraints from the “real world” and so the coding style here might not always reflect the best way to write maintainable production software. If I seem a little cavalier about, say, omitting private or declaring a global variable, understand I do so to keep the code easier on your eyes. The pages here aren’t as wide as your IDE and every character counts. Also, the code doesn’t have many comments. That’s because each handful of lines is surrounded by several paragraphs of honest-to-God prose explaining it. When you write a book to accompany your program, you are welcome to omit comments too. Otherwise, you should probably use // a little more than I do. While the book contains every line of code and teaches what each means, it does not describe the machinery needed to compile and run the interpreter. I assume you can slap together a make file or a project in your IDE of choice in order to get the code to run. Those kinds of instructions get out of date quickly, and I want this book to age like XO brandy, not backyard hooch.

admin

Share
Published by
admin

Recent Posts

Office 365 All-in-One For Dummies 1st edition

Pdf Book Name: Office 365 All-in-One For Dummies 1st edition Author: Peter Weverka Publisher: For…

6 days ago

Biology Laboratory Manual 12th Edition

Pdf Book Name: Biology Laboratory Manual 12th Edition Author: Darrell Vodopich (Author), Randy Moore (Author)…

1 week ago

Chemistry and Biology of Beta-Lactams

Pdf Book Name: Chemistry and Biology of Beta-Lactams Author: Publisher: ISBN-10, 13: Year: Pages: Pages…

2 weeks ago

Coyotes: biology, behavior, and management

Pdf Book Name: Coyotes: biology, behavior, and management Author: edited by Marc Bekoff ; contributors…

2 weeks ago

Design Thinking for Engineering: A practical guide

Pdf Book Name: Design Thinking for Engineering: A practical guide Author: Iñigo Cuiñas, Manuel J.…

2 weeks ago

Irrigation Engineering and Hydraulic Structures

Pdf Book Name: Irrigation Engineering and Hydraulic Structures Author: S. K. Ukarande Publisher: Springer-Ane Books,…

2 weeks ago