Watch the Amazon Original series Cross now on Prime Video. Yours with Prime.
Add Prime to get Fast, Free delivery
Amazon prime logo
Buy new:
-20% $55.99
FREE delivery Friday, December 13
Ships from: Amazon.com
Sold by: Amazon.com
$55.99 with 20 percent savings
List Price: $69.99
FREE Returns
FREE delivery Friday, December 13
Or fastest delivery Thursday, December 12. Order within 1 hr 17 mins
Only 14 left in stock (more on the way).
$$55.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$55.99
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Ships from
Amazon.com
Ships from
Amazon.com
Sold by
Amazon.com
Sold by
Amazon.com
Returns
Returnable until Jan 31, 2025
Returnable until Jan 31, 2025
For the 2024 holiday season, eligible items purchased between November 1 and December 31, 2024 can be returned until January 31, 2025.
Returns
Returnable until Jan 31, 2025
For the 2024 holiday season, eligible items purchased between November 1 and December 31, 2024 can be returned until January 31, 2025.
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
Payment
Secure transaction
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
$50.39
FREE Returns
Clean copy. Clean copy. See less
FREE delivery Wednesday, December 18
Or fastest delivery Thursday, December 12. Order within 1 hr 17 mins
Only 1 left in stock - order soon.
$$55.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$55.99
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.
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

Follow the authors

See all
Something went wrong. Please try your request again later.

Retargetable C Compiler, A: Design and Implementation 1st Edition

4.3 4.3 out of 5 stars 27 ratings

{"desktop_buybox_group_1":[{"displayPrice":"$55.99","priceAmount":55.99,"currencySymbol":"$","integerValue":"55","decimalSeparator":".","fractionalValue":"99","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"pablkCzWMmCYBeYtdP18uTg%2BArU4sOykMdby%2Ff4UZ9QIE0dbPdZl9iCbqORz1g6qi%2BmTXjaR0O0KYDXJkM%2BuycCNH3NTr32R%2BY6co%2F35MTa4Fq0CQ3ZlwJ4vfgBTNy9yVGejvOMmyqs%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$50.39","priceAmount":50.39,"currencySymbol":"$","integerValue":"50","decimalSeparator":".","fractionalValue":"39","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"pablkCzWMmCYBeYtdP18uTg%2BArU4sOykSO9pVkoytqAdV785w701RdcQFb%2F%2Bm6yDn%2FXh4g5lcpzXd4jV9S5tp7vxZVYLBPvW7seb3BAjcI5xzEpdO6kf5kTbCeIFlwrZQfoj5j879G6b%2F4cqrZzKTwKWZBfHrp0VNTjnKXB1rsZ0h1Dy4C53ScpsO81P%2BICV","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

Designed as a self-study guide, the book describes the real-world tradeoffs encountered in building a production-quality, platform-retargetable compiler. The authors examine the implementation of lcc, a production-quality, research-oriented retargetable compiler, designed at AT&T Bell Laboratories for the ANSI C programming language. The authors' innovative approach-a "literate program" that intermingles the text with the source code-uses a line-by-line explanation of the code to demonstrate how lcc is built.

Frequently bought together

This item: Retargetable C Compiler, A: Design and Implementation
$55.99
Get it as soon as Friday, Dec 13
Only 14 left in stock (more on the way).
Ships from and sold by Amazon.com.
+
$37.12
Only 1 left in stock - order soon.
Ships from and sold by Woodville Books.
Total price: $00
To see our price, add these items to your cart.
Details
Added to Cart
spCSRF_Treatment
One of these items ships sooner than the other.
Choose items to buy together.

Editorial Reviews

From the Inside Flap

The compiler is the linchpin of the programmer's toolbox. Working programmers use compilers every day and count heavily on their correctness and reliability. A compiler must accept the standard definition of the programming language so that source code will be portable across platforms. A compiler must generate efficient object code. Perhaps more important, a compiler must generate correct object code; an application is only as reliable as the compiler that compiled it.

A compiler is itself a large and complex application that is worthy of study in its own right. This book tours most of the implementation of lcc, a compiler for the ANSI C programming language. It is to compiling what Software Tools by B.W. Kernighan and P.J. Plauger (Addison-Wesley, 1976) is to text processing like text editors and macro processors. Software design and implementation are best learned through experience with real tools. This book explains in detail and shows most of the code for a real compiler. The accompanying diskette holds the source code for the complete compiler.

lcc is a production compiler. It's been used to compile production programs since 1988 and is now used by hundreds of C programmers daily. Detailing most of a production compiler in a book leaves little room for supporting material, so we present only the theory needed for the implementation at hand and leave the broad survey of compiling techniques to existing texts. The book omits a few language features--those with mundane or repetitive implementations and those deliberately treated only in the exercises--but the full compiler is available on the diskette, and the book makes it understandable.

The obvious use for this book is to learn more about compiler construction. But only few programmers need to know how to design and implement compilers. Most work on applications and other aspects of systems programming. There are four reasons why this majority of C programmers may benefit from this book.

First, programmers who understand how a C compiler works are often better programmers in general and better C programmers in particular. The compiler writer must understand even the darkest corners of the C language; touring the implementation of those corners reveals much about the language itself and its efficient realization on modern computers.

Second, most texts on programming must necessarily use small examples, which often demonstrate techniques simply and elegantly. Most programmers, however, work on large programs that have evolved--or degenerated--over time. There are few well documented examples of this kind of "programming in the large" that can serve as reference examples. lcc isn't perfect, but this book documents both its good and bad points in detail and thus provides one such reference point.

Third, a compiler is one of the best demonstrations in computer science of the interaction between theory and practice. lcc displays both the places where this interaction is smooth and the results are elegant, as well as where practical demands strain the theory, which shows in the resulting code. Exploring these interactions in a real program helps programmers understand when, where, and how to apply different techniques. lcc also illustrates numerous C programming techniques.

Fourth, this book is an example of a "literate program." Like TEX: The Program by D.E. Knuth (Addison-Wesley, 1986), this book is lcc's source code and the prose that describes it. The code is presented in the order that best suits understanding, not in the order dictated by the C programming language. The source code that appears on the diskette is extracted automatically from the book's text files.

This book is well suited for self-study by both academics and professionals. The book and its diskette offer complete documented source code for lcc, so they may interest practitioners who wish to experiment with compilation or those working in application areas that use or implement language-based tools and techniques, such as user interfaces.

The book shows a large software system, warts and all. It could thus be the subject of a postmortem in a software engineering course, for example.

For compiler courses, this book complements traditional compiler texts. It shows one way of implementing a C compiler, while traditional texts survey algorithms for solving the broad range of problems encountered in compiling. Limited space prevents such texts from including more than a toy compiler. Code generation is often treated at a particularly high level to avoid tying the book to a specific computer.

As a result many instructors prepare a substantial programming project to give their students some practical experience. These instructors usually must write these compilers from scratch; students duplicate large portions and have to use the rest with only limited documentation. The situation is trying for both students and instructors, and unsatisfying to boot, because the compilers are still toys. By documenting most of a real compiler and providing the source code, this book offers an alternative.

This book presents full code generators for the MIPS R3000, SPARC, and Intel 386 and successor architectures. It exploits recent research that produces code generators from compact specifications. These methods allow us to present complete code generators for several machines, which no other book does. Presenting several code generators avoids tying the book to a single machine, and helps students appreciate engineering retargetable software.

Assignments can add language features, optimizations, and targets. When used with a traditional survey text, assignments could also replace existing modules with those using alternate algorithms. Such assignments come closer to the actual practice of compiler engineering than assignments that implement most of a toy compiler, where too much time goes to low-level infrastructure and accommodating repetitive language features. Many of the exercises pose just these kinds of engineering problems.

lcc has also been adapted for purposes other than conventional compilation. For example, it's been used for building a C browser and for generating remote-procedure-call stubs from declarations. It could also be used to experiment with language extensions, proposed computer architectures and code-generator technologies.

We assume readers are fluent in C and assembly language for some computer, know what a compiler is and have a general understanding of what one does, and have a working understanding of data structures and algorithms at the level covered in typical undergraduate courses; the material covered by Algorithms in C by R. Sedgewick (Addison-Wesley, 1990), for example, is more than sufficient for understanding lcc.

Acknowledgments

This book owes much to the many lcc users at AT&T Bell Laboratories, Princeton University, and elsewhere who suffered through bugs and provided valuable feedback. Those who deserve explicit thanks include Hans Boehm, Mary Fernandez, Michael Golan, Paul Haahr, Brian Kernighan, Doug McIlroy, Rob Pike, Dennis Ritchie, and Ravi Sethi. Ronald Guilmette, David Kristol, David Prosser, and Dennis Rithchie provided valuable information concerning the fine points of the ANSI Standard and its interpretation. David Gay helped us adapt the PFORT library of numerical software to be an invaluable stress test for lcc's code generators.

Careful reviews of both our code and our prose by Jack Davidson, Todd Proebsting, Norman Ramsey, William Waite, and David Wall contributed significantly to the quality of both. Our thanks to Steve Beck, who installed and massaged the fonts used for this book, and to Maylee Noah, who did the artwork with Adobe Illustrator.

Christopher W. Fraser
David R. Hanson

0805316701P04062001

From the Back Cover

This new text examines the design and implementation of lcc, a production-quality, retargetable compiler for the ANSI C programming language, designed at AT&T Bell Laboratories and Princeton University. The authors' innovative approach--a "literate program" that intermingles the text with the source code--gives a detailed tour of the code that explains the implementation and design decisions reflected in the software. And while most books describe toy compilers or focus on isolated pieces of code, the authors provide the entire source code for a real compiler, which is available via ftp. Structured as a self-study guide that describes the real-world tradeoffs encountered in building a production-quality compiler, this book is useful to individuals who work in application areas applying or creating language-based tools and techniques.

  • Explores the interaction between compiler theory and practice through the discussion of lcc.
  • Covers compiler theory only as needed to understand the implementation of lcc, focusing instead on practical, applied issues.
  • Encourages a broader understanding of programming in C through an examination of lcc, a production-quality compiler in use since 1988.
  • Provides full code generators for the MIPS R3000, SPARC, and Intel 80x86 architectures and successors.
  • The full source code for the lcc compiler, the three back ends, and the code-generator generator is freely available.
  • Uses icons and brief indices in the margins to cross- reference code fragments and connect code usage.
Audience

Senior undergraduate or graduate level second course. Any researcher or implementer of compilers for parallel or advanced computers.



0805316701B04062001

Product details

  • Publisher ‏ : ‎ Addison-Wesley Professional; 1st edition (January 31, 1995)
  • Language ‏ : ‎ English
  • Paperback ‏ : ‎ 584 pages
  • ISBN-10 ‏ : ‎ 0805316701
  • ISBN-13 ‏ : ‎ 978-0805316704
  • Item Weight ‏ : ‎ 2.1 pounds
  • Dimensions ‏ : ‎ 7.1 x 1.3 x 9.2 inches
  • Customer Reviews:
    4.3 4.3 out of 5 stars 27 ratings

About the authors

Follow authors to get new release updates, plus improved recommendations.

Customer reviews

4.3 out of 5 stars
27 global ratings

Top reviews from the United States

Reviewed in the United States on May 21, 2022
A+ amazon seller, quick delivery, excellent book.
Reviewed in the United States on October 16, 2012
I wish all programmers made books like this one about their products. It would make life so much easier.

This book contains literally all the code that you just concatenate together and get a full, working LCC compiler which I think is pretty cool. It's also the best form of commenting your code :v
5 people found this helpful
Report
Reviewed in the United States on November 2, 2016
Good description of compilers without getting bogged down in theory.
Reviewed in the United States on December 2, 2016
Got the package today, the book is in very nice condition. Excellent.
Reviewed in the United States on December 13, 2001
This book is definitely _not_ for beginners, but compilers are not supposed to be written by novices -- if there is rocket science in computers, it is compiler development. Crystal clear style and language make this book easy reading, and LCC is the best non-optimizing compiler I've seen (and believe me, I've seen many compiler sources): orthogonal, easy to follow design, well-thought data structures and overall architecture.
I treat this book as a perfect collection of brilliant ideas, many of which you will find implemented in most commercial compilers.
Whether it helps to write your own compiler? -- sure. Are you thinking about IR (internal representation) that will be easy to create and, most important, walk through and manipulate? -- take a look how Fraser et al did it; they did it well. Think how to write a front end or code generator? -- it's all there. Sure, blind copying won't work -- optimizing compiler will call for way more sophisticated BURG-like technique (one of the best known code generation techniques by now), but, all in all, it'll be BURG-like, and it's in the book as well.
So, if you want to show your students (or learn yourself) how compilers should be written, you cannot find anything better than LCC accompanied by this book. Fraser's team did it right.
27 people found this helpful
Report
Reviewed in the United States on October 22, 2005
First of all, this book is not for starters in the area of compiler design. Starters in the area of compiler design who are looking for a 'cookbook', I recommend to read 'Programming Language Processors in Java: Compilers and Interpreters' by David Watt.

Why do I like this book? Because it is a cookbook for a 'full blown' C Compiler in C itself. Well actually it's a compiler for a subset of C, but it is still very comprehensive!

It offers a lot of code snippets which are really well commented about what/where/how.

A disadvantage of this book is that it doesn't cover advanced topics such as code optimizations. This is the area where the action is right now. All other parts (scanning/parsing/etc) can be bought of the shelf.

But it remain a very nice text, to give you an valuable insight in how a compiler could be implemented.
7 people found this helpful
Report
Reviewed in the United States on April 25, 2019
Good book, but when I buy 'new' I don't want it damaged. This was the replacement order, and Amazon shipped in exactly the same way.
One person found this helpful
Report
Reviewed in the United States on February 23, 2006
This book lays out the compiler's source code in Web (think Knuth), in which instead of seeing an entire program, you see a small fragment, and notes to look up the rest on a different page. In my opinion, this makes the book nearly impossible to read.

In its defense, however, the book addresses many of the engineering concerns with writing a compiler, such as data structures or memory management strategies. This is cool.

Also lacking in this book is a good description of advanced optimization techniques and modern intermediate representations.
3 people found this helpful
Report

Top reviews from other countries

Translate all reviews to English
derek horne
4.0 out of 5 stars only bought it for the 3 different retargetable computer code ...
Reviewed in the United Kingdom on May 13, 2017
only bought it for the 3 different retargetable computer code, I use AHO and for a more complete compiler, I use Programming language processors in JAVA by Watt/Brown
Bernd Ulmann
3.0 out of 5 stars Inhalt toll, Form na ja...
Reviewed in Germany on December 11, 2016
Inhaltlich ist am Buch nichts auszusetzen, ganz im Gegenteil - einen detaillierten Einblick in Aufbau und Arbeitsweise eines Compilers wird man schwerlich anderenortes finden können. Schade ist die leider eher schlampige Ausführung - viele Seiten haben einen starken Grauschleier, wie man sie von Photokopien aus früheren Zeiten kennt. Zum Teil finden sich auch störende querlaufende graue Streifen. Die Form wird dem an sich hervorragenden Inhalt leider bei Weitem nicht gerecht. :-(