# Writing a C Compiler: Build a Real Programming Language from Scratch

Real Programming Scratch: Writing a C Compiler is a hands-on book that guides readers through building a compiler for a significant subset of C. It covers parsing, program analysis and x64 assembly code generation, with algorithms in pseudocode so you can implement the compiler in a language of your choice.

- [Original product page](https://loonieperks.com/product/writing-a-c-compiler-book)
- [View offer](https://loonieperks.com/visit/writing-a-c-compiler-book)
- Market: CA
- Language: en-CA
- Currency: CAD
- Category: Books, Music & Hobbies &gt; Books, Music & Movies &gt; Books & Comics
- Price: 72.12 CAD
- Previous price: 91.99 CAD
- Discount: 22%
- Price checked: 2026-11-13T12:13:50.373Z
- Rating: 4.4 / 5
- Reviews: 73

Prices and deal status are the latest recorded data, not a guarantee of availability. Confirm the price and availability with the store.

## At a glance

- Build a working compiler for a significant subset of C, adding features chapter by chapter.
- Learn lexer and recursive-descent parser concepts, including conversion of C code into an abstract syntax tree.
- Explore program analysis and generation of x64 assembly for operations, function calls and control flow.
- Algorithms are presented in pseudocode, allowing implementation in a programming language of your choice.
- Optimization topics include constant folding, dead store elimination and register allocation.

## Pros

- The project-based progression starts with a compiler for a simple C program and expands it incrementally.
- Pseudocode avoids tying the compiler implementation to one programming language.
- Combines compiler construction concepts with concrete x64 assembly code generation.

## Specifications

### Publication details
- Publisher: No Starch Press
- Publication date: Aug. 20 2024
- Language: English
- Print length: 792 pages
- ISBN-13: 978-1718500426
### Dimensions and installation
- Weight listed: 369 g
- Dimensions: 17.93 x 3.33 x 23.65 cm

## Before you buy

- The description says no prior compiler-construction or assembly experience is needed, but it does not specify prerequisite programming knowledge or provide a syllabus beyond the listed topics.

## A good fit for

- Programmers seeking a practical introduction to compiler construction through a substantial project.
- Readers interested in C language parsing, program analysis, x64 code generation and optimization.
- Developers who want pseudocode guidance that can be implemented in their preferred language.

## Less suited to

- Readers seeking a reference limited to C syntax or application programming rather than compiler construction.
- Buyers who need a guide to a compiler target other than the described x64 assembly.

## Customer feedback

Aggregate ratings lean positive, with most ratings in the five-star category, but a smaller share falls in the middle and lower categories. Without review comments, those figures cannot explain what readers liked or disliked, so use the detailed topic coverage and project approach to judge fit.

## Frequently asked questions

### What does the book teach?
It guides readers through building a compiler for a significant subset of C, covering lexing, parsing, program analysis, x64 assembly code generation and selected optimizations.
### Do I need to know assembly or compiler construction first?
The listing says no prior experience with compiler construction or assembly code is needed. It does not specify broader programming prerequisites.
### Can I implement the compiler in a language other than C?
The algorithms are described in pseudocode, and the listing says you can implement the compiler in whatever language you like.
### How long is the book?
The listed print length is 792 pages.

## Alternative options

- [Hands-On Network Programming with C: Learn socket programming in C and write secure and optimized network code](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [CPython Internals: Your Guide to the Python 3 Interpreter](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [Quantum Readiness: Are You Ready?](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [The Machine in the Back of the Book: Write an Emulator for a Lost 1984 Computer in Any Language, Then Run the Games and Story Printed Inside](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [PLCs for Beginners: An introductory guide to building robust PLC programs with Structured Text](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [TLS Cryptography In-Depth: Explore the intricacies of modern cryptography and the inner workings of TLS](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [The Computer Science Principles: A Dynamic and Practical Approach](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [Mastering PTX and SASS: Low-Level GPU Programming for NVIDIA Architectures](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [Cahier d’écriture 3 ans: Lignes, Formes, Chiffres & Coloriage \(French Edition\)](https://loonieperks.com/visit/writing-a-c-compiler-book)

## Add-ons

- [Building a Debugger: Write a Native x64 Debugger From Scratch](https://loonieperks.com/visit/writing-a-c-compiler-book)
- [Crafting Interpreters](https://loonieperks.com/visit/writing-a-c-compiler-book)

## Images

![Writing a C Compiler: Build a Real Programming Language from Scratch — 1](https://loonieperks.com/i/BN-qoVtdki0_QsqVTuCLE2FkXjqBHZzVOwosEJLXFhnyiWJVlheecClD7_AcVJjQShM9G78L6YWW7R_676FWpl8KH4he3nbS364Ag9W8_nnABCte1S-M.jpg)

![Writing a C Compiler: Build a Real Programming Language from Scratch — 2](https://loonieperks.com/i/XLcHCZapumG-p21B8rWaQGmIUwvDYk2wzlTrxTNdmqkbg3v2S-ycpzE1xopLpNCVkFxyitR1EhImruRTwkkb7FkZrN9tjr2qG0t-9eMHQPtMyFjRwCO5.jpg)

![Writing a C Compiler: Build a Real Programming Language from Scratch — 3](https://loonieperks.com/i/kFMSdpOeOQFr6ddtxDhwI3VKBrDN2-NHvO8Ft9lhuo7H5NpsgthhjEU5keLu8Kx0kVbTXDcH7CvmLbJcO1RQTWyd0STOZhNBgyFel00muq2xWUZnE7Dz.jpg)

![Writing a C Compiler: Build a Real Programming Language from Scratch — 4](https://loonieperks.com/i/Tjpe5QjTwyWV2h1AMsEJZLZlqM30atEyKi0Pu0brmQ7H3sRo1cf0yhBO7hymCjfSUqSymFzzfGkN1cQ8lANVv5bPnVp8BwDU6ZcAErlSKQnlIO75oTfj.jpg)

![Writing a C Compiler: Build a Real Programming Language from Scratch — 5](https://loonieperks.com/i/8z0StPi9cFwD94PCnK4CrB7fyY12UBPDabJEwt53b1a1DrpcawuE_SMMayPNfoY3eqYOOsWfWmiaGO9A0nb6HjMC5-z8XeQ7ofCS5_zmvAPko3VMc1M7.jpg)

![Writing a C Compiler: Build a Real Programming Language from Scratch — 6](https://loonieperks.com/i/p8-s1k-H4Q8Y7GCdKLshGLGhwS-gA0tQcIg0GNglyhGGCETMZSt8p2jAsuehrhtwFsxUYtTRvjPhDdTWuBxm0npXFPnUmkWyCGwY7wq2Xl_bIgcTXNrJ.jpg)

![Writing a C Compiler: Build a Real Programming Language from Scratch — 7](https://loonieperks.com/i/Zidrf4jmX9ejZX5OpeNUG1NQfTrCSEabEmmqjV-3j_qRxvJU8PF_WG7cmJhJru-8XOWAJ5MC93MLykrI69n1C4P02LtctWgvl-PA4tEbV_oBmrmbGKPY.jpg)
