
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet or computer – no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera, scan the code below and download the Kindle app.


Writing An Interpreter In Go Paperback – Aug. 7 2018
Amazon Price | New from | Used from |
Kindle Edition
"Please retry" | — | — |
- Kindle Edition
$26.05 Read with Our Free App - Paperback
$51.07
Purchase options and add-ons
Writing An Interpreter In Go - Version 1.7 - Find out more at https://interpreterbook.com
In this book we will create a programming language together. We'll start with 0 lines of code and end up with a fully working interpreter for the Monkey programming language.
Step by step. From tokens to output. All code shown and included. Fully tested.
Buy this book to learn:
- How to build an interpreter for a C-like programming language from scratch
- What a lexer, a parser and an Abstract Syntax Tree (AST) are and how to build your own
- What closures are and how and why they work
- What the Pratt parsing technique and a recursive descent parser is
- What others talk about when they talk about built-in data structures
- What REPL stands for and how to build one
Why this book?
This is the book I wanted to have a year ago. This is the book I couldn't find. I wrote this book for you and me. So why should you buy it? What's different about it, compared to other interpreter or compiler literature?
- Working code is the focus. Code is not just found in the appendix. Code is the main focus of this book.
- It's small! It has around 200 pages of which a great deal are readable, syntax-highlighted, working code.
- The code presented in the book is easy to understand, easy to extend, easy to maintain.
- No 3rd party libraries! You're not left wondering: "But how does tool X do that?" We won't use a tool X. We only use the Go standard library and write everything ourselves.
- Tests! The interpreter we build in the book is fully tested! Sometimes in TDD style, sometimes with the tests written after. You can easily run the tests to experiment with the interpreter and make changes.
This book is for you if you...
- learn by building, love to look under the hood
- love programming and to program for the sake of learning and joy!
- are interested in how your favorite, interpreted programming language works
- never took a compiler course in college
- want to get started with interpreters or compilers…
- ... but don't want to work through a theory-heavy, 800 pages, 4 pounds compiler book as a beginner
- kept screaming "show me the code!" when reading about interpreters and compilers
- always wanted to say: "Holy shit, I built a programming language!"
- ISBN-103982016118
- ISBN-13978-3982016115
- Publication dateAug. 7 2018
- LanguageEnglish
- Dimensions17.78 x 1.52 x 25.4 cm
- Print length264 pages
Frequently bought together

Customers who viewed this item also viewed
Product details
- Publisher : Thorsten Ball (Aug. 7 2018)
- Language : English
- Paperback : 264 pages
- ISBN-10 : 3982016118
- ISBN-13 : 978-3982016115
- Item weight : 100 g
- Dimensions : 17.78 x 1.52 x 25.4 cm
- Best Sellers Rank: #292,770 in Books (See Top 100 in Books)
- #620 in Programming Languages Textbooks
- #967 in Programming Languages (Books)
- Customer Reviews:
About the author

Thorsten Ball is a professional software developer and writer.
His writing is a result of his love for what he calls "recreational programming", where he digs deep into various topics, hoping to come out the other end with a better understanding of what it is that we do when we program. For the last few years, the two topics that kept his attention the most are systems programming and programming languages.
He's also interested in the other side of doing professional software development: software engineering in a team, communicating through code, team and company culture and how to write great code together.
This fascination with programming and what it means to develop software, turned into his two books and various blog posts, podcast appearances and talks.
Customer reviews
-
Top reviews
Top reviews from Canada
There was a problem filtering reviews right now. Please try again later.
To get the deepest understanding, try customizing some elements of the Monkey language to your own preference. For example, change "else" to "otherwise", and add support for comments and multiline strings.
Top reviews from other countries

I am an experienced developer who has read many computer books, including ones on compilers and interpreters. This one is probably at the top of my list of well written computer programming books.
This book is different. It takes a practical approach. It uses a very modern language. It also uses modern compiler theory, for example incorporating Vaughn Pratt's innovative algorithm for finite state parsing. The author has clearly put in the necessary effort to get the prose and code properly proof read and edited. The writing style makes the subject interesting, and the code snippets actually work. Each section builds on the previous to iterate on the solution. I took the author's advice and coded along with the book, which means I got good practice in the Go language, and as I made minor mistakes and corrected them, I gained deeper understanding of the material.
This book is not really a book on compiler theory. There are other books way better for that. I have read some of those books and this book is a much better read. It keeps you interested and yet covers just enough theory to accomplish the goal stated in the title. It is by a programmer for programmers. There is plenty of code in the book, so it might not be for you if you don't like reading and writing code. I would highly recommend this book for those that do.


If this had gone through a proper edit, it would be a great book.
