WritingAnInterpreterInGo - (EPUB全文下载)
文件大小:0.57 mb。
文件格式:epub 格式。
书籍内容:
Writing An Interpreter In Go
Thorsten Ball
Writing An Interpreter In Go
Acknowledgments
Introduction
The Monkey Programming Language & Interpreter
Why Go?
How to Use this Book
Lexing
1.1 - Lexical Analysis
1.2 - Defining Our Tokens
1.3 - The Lexer
1.4 - Extending our Token Set and Lexer
1.5 - Start of a REPL
Parsing
2.1 - Parsers
2.2 - Why not a parser generator?
2.3 - Writing a Parser for the Monkey Programming Language
2.4 - Parser's first steps: parsing let statements
2.5 - Parsing Return Statements
2.6 - Parsing Expressions
2.7 - How Pratt Parsing Works
2.8 - Extending the Parser
2.9 - Read-Parse-Print-Loop
Evaluation
3.1 - Giving Meaning to Symbols
3.2 - Strategies of Evaluation
3.3 - A Tree-Walking Interpreter
3.4 - Representing Objects
3.5 - Evaluating Expressions
3.6 - Conditionals
3.7 - Return Statements
3.8 - Abort! Abort! There's been a mistake!, or: Error Handling
3.9 - Bindings & The Environment
3.10 - Functions & Function Calls
3.11 - Who's taking the trash out?
Extending the Interpreter
4.1 - Data Types & Functions
4.2 - Strings
4.3 - Built-in Functions
4.4 - Array
4.5 - Hashes
4.6 - The Grand Finale
Resources
Feedback
Changelog
Cover
Table of contents
Acknowledgments
I want to use these lines to express my gratitude to my wife for supporting me. She's the reason you're reading this. This book wouldn't exist without her encouragement, faith in me, assistance and her willingness to listen to my mechanical keyboard clacking away at 6am.
Thanks to my friends Christian, Felix and Robin for reviewing early versions of this book and providing me with invaluable feedback, advice and cheers. You improved this book more than you can imagine.
Introduction
The first sentence of this introduction was supposed to be this one: "Interpreters are magical". But one of the earliest reviewers, who wishes to remain anonymous, said that "sounds super stupid". Well, Christian, I don't think so! I still think that interpreters are
magical! Let me tell you why.
On the surface they look deceptively simple: text goes in and something comes out. They are programs that take other programs as their input and produce something. Simple, right? But the more you think about it, the more fascinating it becomes. Seemingly random characters - letters, numbers and special characters - are fed into the interpreter and suddenly become meaningful
. The interpreter gives them meaning! It makes sense out of nonsense. And the computer, a machine that's built on understanding ones ............
书籍插图:
以上为书籍内容预览,如需阅读全文内容请下载EPUB源文件,祝您阅读愉快。
书云 Open E-Library » WritingAnInterpreterInGo - (EPUB全文下载)