-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
Building Programming Language Interpreters
By:
Overview of this book
Designing a custom programming language can be the most effective way to solve certain types of problems—especially when precision, safety, or domain-specific expressiveness matters. This book guides you through the full process of designing and implementing your own programming language and interpreter, from language design to execution, using modern C++.
You’ll start by exploring when and why building a domain-specific language is worth it, and how to design one to fit a specific problem domain. Along the way, you’ll examine real-world interpreter architectures and see how their design decisions affect language behavior, capabilities, and runtime trade-offs.
The book then walks through the entire process of interpreter implementation: defining syntax, building a lexer and parser, designing an abstract syntax tree, generating executable instructions, and implementing a runtime. All examples are in modern C++, with a focus on clean architecture and real-world usability.
By the end, you’ll have a fully working interpreter for a domain-specific language designed to handle network protocols—plus the knowledge and tools to design your own programming language from scratch.
*Email sign-up and proof of purchase required
Table of Contents (25 chapters)
Preface
Modeling the Programming Language Runtime Environment
Defining the Scope
The Blurred Lines Between Native Code, Virtual Machines, and Interpreters
Instructions, Concurrency, Inputs, and Outputs
Native Types, User Types, and Extension Points
Putting It All Together: Making Trade-Off Decisions
Modeling the Programming Language Syntax
Review of Programming Language Paradigms
Values, Containers, and the Language Meta-Model
Lexical Scopes
Putting It All Together and Creating a Coherent Vision
Implementing the Interpreter Runtime
Initialization and Entry Point
Execution Frames, the Stack, and Continuations
Running and Testing Language Operators
Interpreting Source Code
Lexing: Turning Text into a Stream of Tokens
Parsing: Turning a Stream of Tokens into a Parse Tree
Analyzing: Turning a Parse Tree into an Abstract Syntax Tree
Generating: Turning an Abstract Syntax Tree into Instructions
Proving That It Works
Unlock Your Exclusive Benefits
Other Books You May Enjoy
Index
Next-gen Packt Reader
DRM-free PDF/ePub downloads