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.
DMCA Disclaimer: This site complies with DMCA Digital Copyright Laws. Please bear in mind that we do not own copyrights to these books. We’re sharing this material with our audience ONLY for educational purpose. We highly encourage our visitors to purchase original books from the respected publishers. If someone with copyrights wants us to remove this content, please contact us immediately. All books on the edubookpdf.com are free and NOT HOSTED ON OUR WEBSITE. If you feel that we have violated your copyrights, then please contact us immediately (click here).