Shop Boppo
To see product details, add this item to your cart. You can always remove it later.
Shipper / Seller
Amazon.com
Amazon.com
Shipper / Seller
Amazon.com
Returns
30-day refund / replacement
30-day refund / replacement
This item can be returned in its original condition for a full refund or replacement within 30 days of receipt.
Read full return policy
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
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
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 a C Compiler: Build a Real Programming Language from Scratch

Follow the author

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

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

4.3 out of 5 stars (77)

Purchase options and add-ons

A fun, hands-on guide to writing your own compiler for a real-world programming language.

Compilers are at the heart of everything programmers do, yet even experienced developers find them intimidating. For those eager to truly grasp how compilers work,
Writing a C Compiler dispels the mystery. This book guides you through a fun and engaging project where you’ll learn what it takes to compile a real-world programming language to actual assembly code.

Writing a C Compiler will take you step by step through the process of building your own compiler for a significant subset of C—no prior experience with compiler construction or assembly code needed. Once you’ve built a working compiler for the simplest C program, you’ll add new features chapter by chapter. The algorithms in the book are all in pseudocode, so you can implement your compiler in whatever language you like. Along the way, you’ll explore key concepts like:

  • Lexing and parsing: Learn how to write a lexer and recursive descent parser that transform C code into an abstract syntax tree.
  • Program analysis: Discover how to analyze a program to understand its behavior and detect errors.
  • Code generation: Learn how to translate C language constructs like arithmetic operations, function calls, and control-flow statements into x64 assembly code.
  • Optimization techniques: Improve performance with methods like constant folding, dead store elimination, and register allocation.

Compilers aren’t terrifying beasts—and with help from this hands-on, accessible guide, you might even turn them into your friends for life.

Frequently bought together

This item: Writing a C Compiler: Build a Real Programming Language from Scratch
$42.43
Get it as soon as Saturday, Sep 19
In Stock
Ships from and sold by Amazon.com.
+
$43.49
Get it as soon as Saturday, Sep 19
In Stock
Ships from and sold by Amazon.com.
+
$43.56
Get it as soon as Saturday, Sep 19
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...

From the Publisher

Copy of Writing a C Compiler on black background with No Starch Press logo
Review of Writing a C Compiler on black background
Review of Writing a C Compiler on black background

About the Author

Nora Sandler is a software engineer based in Seattle. She holds a BS in computer science from the University of Chicago, where she researched the implementation of parallel programming languages. More recently, she’s worked on domain-specific languages at an endpoint security company. You can find her blog on pranks, compilers, and other computer science topics at norasandler.com.

No Starch Press logo. A black circle with a white iron and a star in the center

About the Publisher

No Starch Press has published the finest in geek entertainment since 1994, creating both timely and timeless titles like Python Crash Course, Python for Kids, How Linux Works, and Hacking: The Art of Exploitation. An independent, San Francisco-based publishing company, No Starch Press focuses on a curated list of well-crafted books that make a difference. They publish on many topics, including computer programming, cybersecurity, operating systems, and LEGO. The titles have personality, the authors are passionate experts, and all the content goes through extensive editorial and technical reviews. Long known for its fun, fearless approach to technology, No Starch Press has earned wide support from STEM enthusiasts worldwide.

Editorial Reviews

Review

"Have you written C code and really wondered how this turns into code that runs on a processor? Nora's book will not only help you see how that works but will help you to understand how to do these sorts of translations for your own assets, in language and code accessible to people without a PhD in compilers."
—Lars Bergstrom, Director of Engineering at Google

"This book is a great introduction to the topic of compilers for programming languages. It is extremely thorough, with many suggestions for further reading, while being quite enjoyable to read
a 'soup-to-nuts' treatment of compiler writing for C-like languages."
—John Reppy, Professor of Computer Science, University of Chicago

"It is refreshing to read a book on compiler design with a focus on implementing a practical real-world language, rather than working through dry academic exercises . . . practical, fun, and exciting to read if you are sick of reading textbooks on the subject."
—Rick Battagline, author of The Art of WebAssembly

About the Author

Nora Sandler is a software engineer based in Seattle. She holds a BS in computer science from the University of Chicago, where she researched the implementation of parallel programming languages. More recently, she’s worked on domain-specific languages at an endpoint security company. You can find her blog on pranks, compilers, and other computer science topics at https://norasandler.com.

Product details

  • Publisher ‏ : ‎ No Starch Press
  • Publication date ‏ : ‎ August 20, 2024
  • Language ‏ : ‎ English
  • Print length ‏ : ‎ 792 pages
  • ISBN-10 ‏ : ‎ 1718500424
  • ISBN-13 ‏ : ‎ 978-1718500426
  • Item Weight ‏ : ‎ 13 ounces
  • Dimensions ‏ : ‎ 7.06 x 1.31 x 9.31 inches
  • Best Sellers Rank: #246,850 in Books (See Top 100 in Books)
  • Customer Reviews:
    4.3 out of 5 stars (77)

About the author

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

Discover more of the author’s books, see similar authors, read book recommendations and more.