-
Book Overview & Buying
-
Table Of Contents
Practical Systems Programming in Go
By :
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 Go an ideal choice for building interpreters or compilers from scratch. The name of our programming language is SMALL, and, in this chapter, we are going to create its first, minimal version, which we will enrich in Chapter 11, Adding New Features...