10
Writing a Programming Language
Up to this point, we have explored the systems programming capabilities of Go, focusing on how to manipulate raw byte streams, carefully manage memory, and interact with the operating system. Building a programming language from scratch is the natural culmination of these concepts. There is no better way to understand core principles such as syntax trees, scope, and evaluation strategies than by building a programming language from scratch. In this chapter, we will construct the three pillars of an interpreter: a lexer to transform raw text into tokens, a parser to structure those tokens into a tree, and an evaluator to execute the code. The simplicity, the strong standard library, and the excellent tooling make ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access