制作口译员
Crafting Interpreters

原始链接: https://craftinginterpreters.com/

Crafting Interpreters 包含实现功能齐全、高效的脚本语言所需的一切。 您将学习有关解析和语义的高级概念以及字节码表示和垃圾收集等具体细节。 你的大脑会充满新想法,你的双手会变得肮脏、长满老茧。 太棒了。 从 main() 开始,您构建了一种具有丰富语法、动态类型、垃圾收集、词法作用域、一等函数、闭包、类和继承等功能的语言。 所有这些都包含在几千行干净、快速的代码中,您可以完全理解这些代码,因为每一行代码都是您自己编写的。 这本书有四种令人愉快的格式:

制作解释器提供了为新语言创建两个完整解释器的分步指南。 作者假设语言创建是初学者,涵盖了构建功能性、高效且安全的语言所需的每个必需概念和代码行。 这本书涵盖了词法分析器和解析器的开发、对输入进行标记、处理表达式、定义范围和对象、管理垃圾收集等等。 作者没有使用 Lex 和 Yacc 等工具生成代码,而是选择手动进行解析过程,从而为语言解释的底层机制提供有价值的见解。 总的来说,Crafting Interpreters 旨在为初学者提供开发自己的编程语言所需的知识和技能。
相关文章

原文

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 main(), 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.

The book is available in four delectable formats:

联系我们 contact @ memedata.com