Sponsored
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy New
$39.00
FREE delivery Tuesday, April 28
Ships from: Amazon.com
Sold by: Amazon.com
$39.00
FREE delivery Tuesday, April 28
Or Prime members get FREE delivery Saturday, April 25. Order within 31 mins. Join Prime
In Stock
$$39.00 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$39.00
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Shipper / Seller
Amazon.com
Amazon.com
Shipper / Seller
Amazon.com
Returns
FREE 30-day refund/replacement
FREE 30-day refund/replacement
Quick refund
Usually issued within 24 hours. See exceptions
FREE return
At least one free return option available.
Convenient dropoff
At any of our 50,000 US locations.
See return policy
Gift options
Available at checkout
Available at checkout This item is a gift. Change
At checkout, you can add a custom message, a gift receipt for easy returns and have the item gift-wrapped
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$21.95
Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! See less
$4.99 delivery Saturday, May 2. Details
Or fastest delivery April 29 - May 1. Details
Only 1 left in stock - order soon.
$$39.00 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$39.00
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by Half Price Books Inc.
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

  • Writing An Interpreter In Go

Follow the author

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

Writing An Interpreter In Go Paperback – August 7, 2018

4.6 out of 5 stars (221)

{"desktop_buybox_group_1":[{"displayPrice":"$39.00","priceAmount":39.00,"currencySymbol":"$","integerValue":"39","decimalSeparator":".","fractionalValue":"00","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"0%2BcAHorJALDb5b%2B0SzB2iT7iNVoRzBvwVtAwMDaMfGQBTzSJr3m2WTGw8BsecnPhDvB%2Bqyhjx%2B%2Blnap726M8aXfXeV%2FuiKQGl1sCCQULMj9egP9O8XIgyo%2FgWwl8c3t0z2teLdR9RBXY4ZxW%2FzH82A%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$21.95","priceAmount":21.95,"currencySymbol":"$","integerValue":"21","decimalSeparator":".","fractionalValue":"95","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"0%2BcAHorJALDb5b%2B0SzB2iT7iNVoRzBvwcNeCk2f5g7Pfd9By2w%2Fgr7s3YLGmMIAvAZPrmnxTWI%2Fx5KdiAPeHUXuwiTp2S%2BJR3Agdp6vuBPdAJQyN3nWXq46Yy%2BBxE%2BrdHG8KemFXGg4DUXe9JgBeYOqHyVyBpZoSiqFsp0mIIHlea8WbXR4Mxkth%2FQWglk7w","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

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!"
Sponsored

Frequently bought together

This item: Writing An Interpreter In Go
$39.00
Get it as soon as Tuesday, Apr 28
In Stock
Ships from and sold by Amazon.com.
+
$39.00
Get it as soon as Tuesday, Apr 28
In Stock
Ships from and sold by Amazon.com.
+
$43.56
Get it as soon as Tuesday, Apr 28
In Stock
Ships from and sold by Amazon.com.
Total price: $00
To see our price, add these items to your cart.
Details
Added to Cart
Choose items to buy together.

Customers also bought or read

Loading...

Product details

  • Publisher ‏ : ‎ Thorsten Ball
  • Publication date ‏ : ‎ August 7, 2018
  • Language ‏ : ‎ English
  • Print length ‏ : ‎ 264 pages
  • ISBN-10 ‏ : ‎ 3982016118
  • ISBN-13 ‏ : ‎ 978-3982016115
  • Item Weight ‏ : ‎ 3.53 ounces
  • Dimensions ‏ : ‎ 7 x 0.6 x 10 inches
  • Best Sellers Rank: #399,199 in Books (See Top 100 in Books)
  • Customer Reviews:
    4.6 out of 5 stars (221)

About the author

Follow authors to get new release updates, plus improved recommendations.
Thorsten Ball
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

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.

Sponsored

Customer reviews

4.6 out of 5 stars
221 global ratings
Sponsored
An ambitious book that is concise in it's delivery
5 out of 5 stars
An ambitious book that is concise in it's delivery
I took three stars off this review because the writing on the binding is upside down and ruins my bookshelf. Fortunately, this book is worth 8 stars if they fix that issue. It'll rock your face off. I won't repeat what others have already mentioned, solid theory, working code, test driven development, fun af, etc. The real beauty of this book is in it's repetition of actually teaching the reader over and over again, in subtle and nuanced ways how to expand the language as you go. The celebration at the end, is well worth it. This book will be transformative in the tech scene and may inadvertently launch a thousand new languages. This is how I ran through it. Two bookmarks. One to mark where I have coded to, the other one for where I am reading ahead to. As I find time, I hop into vscode, use copilot for some auto-complete help, made quick work of the sections, watch the tests blow up, and code to make them work until I arrive at my read to bookmark. Finally, I commit when I've completed adding a feature and repeat this process until the end. My reading time consisted of me reading a chapter or section, and then scrolling through my code on the github app following along on how it all worked. I highly advise keeping the SICP and Nystrom's Crafting Interpreter literature nearby, just to have the additional light bulb moments. This will be money well spent. I didn't spend any, however, as I received this and the compiler one for Christmas '23. Some of the best gifts I've ever been given.
Thank you for your feedback
Sorry, there was an error
Sorry we couldn't load the review

Top reviews from the United States

  • Reviewed in the United States on September 24, 2020
    Format: KindleVerified Purchase
    Just like the author says in the beginning, the book is intended to be a practical guide to programming language design, and fill the void between step-by-step tutorials and academic volumes. The book definitely delivers on the promise - it builds the interpreter from the ground up, from lexer to parser to evaluator, with tests written first to give the reader an immediate view of what's coming. I especially liked the fact that the author doesn't cut corners on writing test harness for the code, and doesn't abuse the "<such and such> is left as an exercise for the reader" phrase - that alone is an indicator of thoroughness and no-nonsense approach to writing. Also, be sure to download the "lost chapter" from the link at the end of the book - coming from the C/C++ background, this was an eye opener for me on what a good macro system can do.

    Looking forward to reading his Compiler book.
    3 people found this helpful
    Report
  • Reviewed in the United States on June 6, 2017
    I've read many books and web articles on writing compilers and interpreters and this is one of the most accessible yet. The author describes step by step how to construct a Top Down Operator Precedence or Pratt Parser. The book contains a lot of simple elegant code that is a joy to read. The book contains just enough theory to help you understand , but not too much that you get overwhelmed. Recommend to any one interested in how parsers work. I would love it if the author writes a second volume focused on optimization or compiling down to native instruction.
    14 people found this helpful
    Report
  • Reviewed in the United States on April 12, 2020
    Format: PaperbackVerified Purchase
    I have both the waiig and the wacig books. I followed both books and entered the code myself. It took me about 2 months to finish the books and code in sequence. (It's important that you follow them in sequence.)

    The compiler book went much faster because the basics are the same as the interpreter book. Instead of tree-walk to eval, the compiler emits instructions for the vm to execute. Since early in my career I was an assembly language programmer. The vm's stack architecture is quite natural to me so the vm portion, though new, was easy for me to follow as well.

    Both books are wonderfully written. Code in both book work as advertised. I enjoyed reading and following the code immensely.

    Ever since I left school I wanted to someday write a compiler. I did it! :-) . I am thinking about re-implementing the programs in Python. That should be quite fun, I would think.
    8 people found this helpful
    Report
  • Reviewed in the United States on May 17, 2018
    A good book for getting started on writing an interpreter. By the end of this book, you have a functioning little language and interpreter for the author's homegrown language called Monkey.

    You learn the basics of lexing, parsing (using Pratt Parsing) and evaluation (tree walking) and how you can use these techniques in developing an interpreter.

    This is a great book for getting started writing an interpreter and shows that it isn't some sort of magic. The code is written in Go, however, the techniques are covered in enough depth so that you can easily translate them.

    I dock it one star because I felt the author could have left out writing all of the tests and left that to the downloadable code. While testing your code is a good thing, I feel that it's coverage in the book was a little too much. Leaving this out would have left a little more room to add more language features or perhaps show how to handle right associativity with the Pratt Parser.
    12 people found this helpful
    Report
  • Reviewed in the United States on March 16, 2019
    Format: PaperbackVerified Purchase
    The writing is very accessible, and the Pratt Parser implemented is thoughtfully constructed. You can build the whole thing in a couple of months as a side project, and although there are several parts that are not production-ready, the author generally notes these up front so you can go back later and improve them.

    Also, I really like the fact that the interpreter is built TDD-style. That makes it easy to spot errors early, and also to extend the implementation painlessly.
    3 people found this helpful
    Report
  • Reviewed in the United States on June 23, 2017
    This is probably the 9th book about compilers I bought and read in the last two years... And I loved it. The author is really honest with his introduction on why he wrote the book and what is expected to cover on it so you are completely warned from the beginning.

    This is not a book to learn Go (there are better books about it) neither a book about how to design a programming language (there are many other academic books about it) or a book about different parsing algorithms (for that I recommend Language Implementation Patterns by Parr) but it is a book about writing an interpreter in Go, exactly as the title says, and I love it.
    16 people found this helpful
    Report
  • Reviewed in the United States on August 5, 2019
    Format: PaperbackVerified Purchase
    So far so good, I love this book. It's simple to follow, and Thorsten's style of teaching is great.
    One person found this helpful
    Report
  • Reviewed in the United States on October 30, 2025
    Format: KindleVerified Purchase
    Go is easy to read. This instructional book is easy to read. The text even includes code that executes recursively and uses closures. But it leaves out simple yet crucially important things, like looping constructs (for/while) and modules (import, private/public).

    The "Lost Chapter" covering meta programming is a nice touch, though. It's a separate, free chapter, and well worth your time.

Top reviews from other countries

Translate all reviews to English
  • N. Danson
    5.0 out of 5 stars 5 stars for the book, but 2 for the kindle formatting
    Reviewed in the United Kingdom on June 24, 2023
    Format: KindleVerified Purchase
    The book is really good. I’ve written a few toy compilers and interpreters, but wanted to get an insight into how other do it without dedicating my life to compiler research papers.

    To avoid copy/paste I took the code and verbatim copied to Rust.

    The book is generally very good - not perfect but overall worth 5 stars. But on Kindle the code formatting is awful and very hard to read. Obviously I haven’t checked the paperback version but the code formatting makes the examples very hard to read.

    So a good book and worth it, but shame about the code formatting
  • Josh Weston
    5.0 out of 5 stars Worth every penny
    Reviewed in Canada on July 9, 2022
    Format: PaperbackVerified Purchase
    I learned so much from working through this book, and not just about interpreters - about dealing with complexity, writing proper unit tests, writing a REPL, etc. I am looking forward to moving on to the next book in the series on writing a compilers.
  • Joel Thormeier
    5.0 out of 5 stars Great book for learning by doing
    Reviewed in Germany on January 11, 2024
    Format: PaperbackVerified Purchase
    I mostly got this to have a project to learn more about Go with. But generelly it's an excellent book that I can recommend as an introduction to both go and building interpreters. Personally, I understand systems best by working on them and this strikes the perfect balance between a theory laden dissertation and a trivial example. It's clear, concise and hands on. However, if you are mostly interested about in depth theoretical aspects of interpreters or already have the foundations this is probably not for you.
  • Franck
    5.0 out of 5 stars Un tour de force
    Reviewed in France on October 9, 2017
    Ce livre réussi le tour de force d’aborder un sujet complexe souvent obscure et de le rendre limpide et accessible avec une facilité déconcertante.
    Non seulement l'auteur ne triche pas (vous allez réellement écrire 100% du code sans outils tierce ou librairies spécialisées) mais vous allez le faire de façon extrêmement progressive.
    Le découpage des étapes est tellement bien fait qu’à aucun moment vous ne devez absorber plus d’un ou deux concepts à la fois. Tout s’enchaine d’une façon fluide et logique. Lorsqu’une question germe dans votre esprit, la réponse apparait sur la page comme si l’auteur était dans votre tête !

    A lire absolument.
    Report
  • A. Hahn
    5.0 out of 5 stars Fantastic introduction
    Reviewed in Sweden on November 19, 2023
    Format: PaperbackVerified Purchase
    An introduction to interpreters for anyone