home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / compiler / 2227 < prev    next >
Encoding:
Text File  |  1993-01-22  |  17.9 KB  |  426 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!world!iecc!compilers-sender
  3. From: crowl@jade.CS.ORST.EDU (Lawrence Crowl)
  4. Subject: Summary: Compiler Textbooks
  5. Reply-To: crowl@jade.CS.ORST.EDU (Lawrence Crowl)
  6. Organization: Computer Science Department, Oregon State University
  7. Date: Fri, 22 Jan 1993 00:25:58 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <93-01-155@comp.compilers>
  10. Keywords: books, courses, summary
  11. Sender: compilers-sender@iecc.cambridge.ma.us
  12. Lines: 412
  13.  
  14. I recently asked this newsgroup to send me recommendations for an
  15. undergraduate compilers textbook.  This posting contains the edited
  16. responses, both from news and mail.  I have also listed some texts we had
  17. lying around.  They have no reviews.
  18.  
  19.   Steve Lembark <LEMBARK@sysjj.ug.eds.com> writes:
  20.  
  21.     quick way to get a list of them: call OpAmp Tech. Books and ask for
  22.     their catalog.  If its in print they've got it.  their number is
  23.     +1 800 468 4322.  no, i don't work there.
  24.  
  25. In addition, Kurt M. Bischoff of Iowa State University sent information
  26. about the Ox attribute grammar compiling system, which may be suitable for
  27. use in a course.  I appended his messages (edited) to the end of this
  28. post.
  29.  
  30.   Lawrence Crowl        503-737-2554    Computer Science Department
  31.                crowl@cs.orst.edu    Oregon State University
  32.           ...!hplabs!hp-pcd!orstcs!crowl    Corvallis, Oregon,  97331-3202
  33.  
  34. -----------------------------------------------------------------------
  35.  
  36. Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman, "Compilers:
  37. Principles, Techniques, and Tools", Addison Wesley, ISBN
  38. 0-201-10088-6.
  39.  
  40.   Recommended by Kbvelama@top.cis.syr.edu.
  41.   Recommended by Adam Goldberg <adam@microware.com>.
  42.  
  43.   Manny Powers <mpowers@Bonnie.ICS.UCI.EDU> writes:
  44.  
  45.     I am an undergraduate at UC Irvine.  Our professor used [Aho,
  46.     Sethi, and Ullman].  This book was packed with a tremendous amount
  47.     of information (we went through 12 chapters in one quarter).  It
  48.     explained subjects very well (although it did get kind of dry once
  49.     in awhile).  Overall I thought it was an excellent book for this
  50.     class.
  51.  
  52. P. J. Brown, "Writing Interactive Compilers and Interpreters", Wiley,
  53. 1979, ISBN 0-471-27609-X (hardbound?), reprinted 1985 ISBN
  54. 0-471-10072-2 (paper).
  55.  
  56.   Recommended by TDARCOS@MCIMAIL.COM (Paul Robinson).
  57.  
  58.   (John Levine) writes:
  59.  
  60.     This is a great book, but it ... is long out of print.  If anyone
  61.     can find a source for it, I'd like a copy myself.  [I was mistaken,
  62.     it's still in print in paperback. -John]
  63.  
  64.   tfj@apusapus.demon.co.uk (Trevor Jenkins) writes:
  65.  
  66.     This is one of the few books that addresses real implementation
  67.     issues.
  68.  
  69.     P J Brown has a good writing style, one of the best bits of the
  70.     book is the "Deadly Sins". A list of aphorisms (much like those in
  71.     "Elements of Programming Style" *) dedicated to the compiler
  72.     (interpreter) writer.
  73.  
  74.   thutt <thutt@MAIL.CASI.NASA.GOV> writes:
  75.  
  76.     If the book, "Writing Interactive Compilers and Interpreters" in
  77.     paperback form from Wiley is the one that implements a Pascal
  78.     compiler and Pascal interpreter for the 8086 chip, it is truly so
  79.     full of errors in the actual code (generated code as well as the
  80.     compiler itself) as to make it almost useless.
  81.  
  82.     The practical approach that is taken really leaves a lot out
  83.     (explanation), and the descriptions of the code do not correspond
  84.     very well to the published source.
  85.  
  86.     (If I have confused the above book, then I apologize.  I am sorry I
  87.     bought the book I did, whatever it is.)
  88.  
  89. Fischer and LeBlanc, "Crafting a Compiler" (Ada version).
  90.  
  91.   Recommended by miller@diego.llnl.gov (Patrick Miller).
  92.  
  93.   mfeldman@seas.gwu.edu (Michael Feldman) writes:
  94.  
  95.     The language being compiled is a decent Ada subset; the language of
  96.     discourse of the book is Ada. That will get your students started
  97.     very nicely!
  98.  
  99.   crigler@osceola.cs.ucf.edu (James Crigler) writes:
  100.  
  101.     When I took the compiler course here, we used the book Prof. Mike
  102.     mentions and I didn't like it.  Caveat: We were using lex/yacc to
  103.     create a compiler, which is, of course (:-) the opposite approach
  104.     to parsing.  (Since I had the class they've gone back to using the
  105.     Dragon book :-) but I can't afford a copy :-(
  106.  
  107.   robichau@lambda.msfc.nasa.gov (Paul Robichaux) writes:
  108.  
  109.     Here's a vote _for_ Fischer/LeBlanc. It's the text for the
  110.     undergrad compiler course at Georgia Tech, and the class project
  111.     usually revolves around building a compiler, using a Pascal-ized
  112.     lex/yacc suite for the parser and Pascal for the remainder.
  113.  
  114.     IMHO the discussion and description in the Ada version of LeBlanc
  115.     is more clear and more appropriate for undergrad courses than the
  116.     dragon book.  YMMV.
  117.  
  118.   mfeldman@seas.gwu.edu (Michael Feldman) writes:
  119.  
  120.     ... Fischer/LeBlanc is the only compiler book acknowledging Ada as
  121.     a suitable language in which to write a compiler. ...
  122.  
  123.     Fischer/LeBlanc provides a lot of very useful code segments,
  124.     procedures, packages, etc., for "Crafting a Compiler" in Ada. The C
  125.     version of their book does the same with C, though the language
  126.     being compiled is _still_ an Ada subset.
  127.  
  128.     [Refering to James Crigler's comments.]  In my opinion, your
  129.     professor did you a disservice by requiring a book that (1) used
  130.     Ada as the language of discourse and (b) focused on hand-coding a
  131.     compiler, then gave you a project in which you used lex/yacc/C to
  132.     do the actual work. That caused too much "dissonance" and,
  133.     naturally, you had an unpleasant experience. Probably soured you on
  134.     Ada, too.
  135.  
  136.   Jim Clausing <jac@cis.ohio-state.edu> writes:
  137.  
  138.     I have had tremendous success with _Crafting a Compiler_ (or
  139.     _Crafting a Compiler in C_, if you prefer C to Ada, though frankly
  140.     I used the Ada version even when teaching the course in Pascal).
  141.  
  142.   eigenstr@cs.rose-hulman.edu (Todd Eigenschink) writes:
  143.  
  144.     Our compilers course at Rose-Hulman (targeted for seniors, but
  145.     there's really no restriction) used 'Crafting a Compiler' by
  146.     Fischer and LeBlanc last winter.  I consider myself a fairly bright
  147.     student and didn't have any problems with it at all.  It's not as
  148.     technical as, say, the dragon book, but it covered topics
  149.     adequately (especially considering it's only a 10-week course and
  150.     we had to actually _write_ a compiler).
  151.  
  152. Fischer and LeBlanc, "Crafting a Compiler" (C version).
  153.  
  154.   moss@CRAFTY.FOX.CS.CMU.EDU (J. Eliot B. Moss) writes:
  155.  
  156.     We have been using the Fischer and LeBlanc text (Crafting a
  157.     Compiler, C edition). While every text has its problems, this one
  158.     workes well for a project oriented course.
  159.  
  160.   arnold@cc.gatech.edu (Arnold Robbins) writes:
  161.  
  162.     It is much more code-oriented than most books, which makes things
  163.     more solid and easier to grasp.  I did the work to translate the
  164.     original Ada code in "Crafting A Compiler" into C for that book,
  165.     and as a result had to read the book *very* closely; doing so gave
  166.     me an appreciation for how good a book it is.
  167.  
  168. Holub, "Compiler Design in C"
  169.  
  170.   hernandz@edmund.cs.andrews.edu (Aldy Hernandez) writes:
  171.  
  172.     I think the best "textbook" for a compiler class is Holub's
  173.     "Compiler Design in C." (I repeat.... I THINK!)
  174.  
  175.     It goes over most of the theory and implements all of the theory
  176.     presented.  The book has received very good reviews from almost
  177.     everyone, including "Dr. Dobb's Journal".  It implements most of
  178.     what other compiler textbooks have left out.  Things like
  179.     structures, unions, typedefs, etc.  The author implements a
  180.     workable version of YACC, LEX, and a C compiler.
  181.  
  182.     Most importantly (to me) is that, when the author's algorithms
  183.     aren't the best, he points you to "good" algorithms in Aho's book
  184.     (or others).
  185.  
  186.   zell@SEAS.UCLA.EDU (Adam W. Zell) writes:
  187.  
  188.     a little bit too hackish in the code, for my taste
  189.  
  190. Robin Hunter, "Compilers: Their Design and Construction Using Pascal",
  191. John Wiley and Sons, 1985, ISBN 0-471-90720-0.
  192.  
  193. Karen A. Lemone, "Design of Compilers: Techniques of Programming Language
  194. Translation", CRC Press, 1992, ISBN 0-8493-7342-5.
  195.  
  196. Thomas W. Parsons, "Introduction to Compiler Construction", W. H. Freeman
  197. and Company, 1992, ISBN 0-7167-8261-8.
  198.  
  199.   Recommended by tm@netcom.com (Toshiyasu Morita).
  200.  
  201.   James Wilkinson <wilkins@cs.cofc.edu> writes:
  202.  
  203.     I like the book by Parsons, but I haven't actually _used_ this book
  204.     in a course.  I have used some others, and if I had to choose one
  205.     right now I would choose Parsons.
  206.  
  207. Thomas Pittman and James Peters, "The Art of Compiler Design: Theory and
  208. Practice", Prentice Hall, 1992, ISBN 0-13-048190-4.
  209.  
  210. A. T. Schreiner and G. Friedman, "Introduction to Compiler Construction
  211. with UNIX", Prentice-Hall, 1985.
  212.  
  213.   Recommended by Sebastian.Schmidt@PrakInf.TU-Ilmenau.DE (Sebastian
  214.   Schmidt).
  215.  
  216. William M. Waite and Lynn R. Carter, "An Introduction to Compiler
  217. Construction", HarperCollins, 1993, ISBN 0-673-39822-6.
  218.  
  219.   William Waite  <waite@riker.cs.colorado.edu> [an author] writes:
  220.  
  221.     I have just completed a book for a senior-level undergraduate
  222.     compiler class, co-authored with Dr. L. R. Carter of the Software
  223.     Engineering Institute.  I have been using it in draft form for
  224.     several years, and it was published by HarperCollins in September.
  225.     It's always hard to characterize a book briefly, but I feel that
  226.     this one has significant advantages for an undergraduate course:
  227.  
  228.     - It presents a complete, balanced picture of the compiler rather
  229.       than the usual emphasis on parsing.
  230.     - It provides general principles for semantic analysis and code
  231.       generation, not simply a collection of special cases.
  232.     - Although the techniques are all based on theory, the book does
  233.       not make that theory its central theme.
  234.  
  235.     Here is a list of chapters and page counts:
  236.  
  237.     1.  The Characteristics of a compiler (15pp)
  238.     2.  The Compiler's Interface (27pp)
  239.     3.  Lexical Analysis (31pp)
  240.     4.  Syntactic Analysis (41pp)
  241.     5.  Recursive Descent Parsing (29pp)
  242.     6.  Shift-Reduce Parsing (18pp)
  243.     7.  Managing Contextual Information (41pp)
  244.     8.  Types and Data Mapping (30pp)
  245.     9.  Action Mapping and the Target Program Tree (40pp)
  246.     10. Operator Identification (38pp)
  247.     11. Code Generation (37pp)
  248.  
  249.     Chapter 2 describes the module interfaces that are used to
  250.     communicate with the outside world, but are not central to compiler
  251.     construction issues (source text input, error reporting and
  252.     external value management).  Chapter 4 explains the general concept
  253.     of syntactic analysis and syntactic error recovery (including how
  254.     the process is specified) without a commitment to a particular
  255.     parsing strategy.  Chapter 7 explains the general principles used
  256.     to analyze all computations over trees, and shows how to implement
  257.     such computations.  Name analysis is used as the primary example in
  258.     this chapter.  Chapter 9 restricts itself to mapping statements and
  259.     mapping expressions in which the operators are not overloaded.
  260.     This restriction is removed in Chapter 10 through the use of a
  261.     general technique for overload resolution that is also useful in
  262.     code generation.
  263.  
  264.     There is an Appendix containing a complete project to translate a
  265.     simple algebraic language to VAX assembly code.  Our students
  266.     complete this project (or a similar one -- we rotate languages) in
  267.     one semester.
  268.  
  269.     If you have specific questions, I'd be happy to answer them.  You
  270.     can get a copy of the text by asking your local HarperCollins
  271.     representative or calling John Lenchek at (708)486-2834.
  272.  
  273.     Our project IS designed for a semester system, but we offer a
  274.     suggestion for truncating it:  Have the students write a "lint"
  275.     program rather than a compiler.  Cover Chapters 1-7, selecting
  276.     either 5 or 6 depending on the parsing method.  Require that their
  277.     "lint" program detect and report lexical errors, syntax errors,
  278.     undefined and multiply-defined symbols, and type agreement errors.
  279.     If you use a language with only integer and Boolean variables and
  280.     no coercions, then you avoid the need for overload resolution.  (A
  281.     suitable language for such a project would be Pascal-, defined by
  282.     Brinch-Hansen in "Brinch-Hansen on Pascal Compilers").
  283.  
  284.     This approach has the advantage of covering the most significant
  285.     material (structuring the linear input text and managing contextual
  286.     information).  Overload resolution is the only "scientific" aspect
  287.     of the problem not covered.  (Target tree construction and code
  288.     generation are really applications of contextual information and
  289.     overload resolution, while data mapping is straghtforward data
  290.     processing.)  If time permits (and since we are not on a quarter
  291.     system I can't say how likely that is) you can cover overload
  292.     resolution and extend the language to handle reals as well as
  293.     integers.  Because of the systematic technique we advocate for this
  294.     problem, the increase in code complexity is very small, so the
  295.     actual project development time is perhaps half a week longer with
  296.     overload resolution than without it.  Class time required to
  297.     present the technique is somewhat more -- probably in the range of
  298.     four to six one-hour lectures.
  299.  
  300. Wirth and Gutknecht, "Project Oberon: The design of a compiler and
  301. operating system", Addison-Wesley, 1992, ISBN 0-201-54428-8.
  302.  
  303.   Recommended by G_DOTZEL@ame.nbg.sub.org (Guenter Dotzel).
  304.  
  305.   thutt <thutt@MAIL.CASI.NASA.GOV> writes:
  306.  
  307.     The very best 'practical' book on operating systems and compilers
  308.     that I have seen ...  This contains the (nearly) complete
  309.     implementation of the Oberon operating system, and the complete
  310.     implmentation of a production compiler.  The source is available
  311.     for ftp from neptune.ethz.ch.  Recommended reading.
  312.  
  313. "A First Course in Compilers Using ANSI C, Lex and Yacc"
  314.  
  315.   zell@SEAS.UCLA.EDU (Adam W. Zell) writes:
  316.  
  317.     thin book, skims over theory
  318.  
  319. "High Level Languages And Their Compilers"
  320.  
  321.   zell@SEAS.UCLA.EDU (Adam W. Zell) writes:
  322.  
  323.     Excellent text, with diverse languages discussed
  324.  
  325. ----------------------------------------------------------------------
  326.  
  327. This message is not to recommend a complete text book, but to tell you
  328. about some software and a paper that can be used for programming projects
  329. in a compilers course.  The approach is for the students to take a small
  330. working compiler, study it, and then add features to the language by
  331. changing the compiler.  The compiler is written as an attribute grammar
  332. which is preprocessed to produce code for Yacc and Lex.
  333.  
  334. Several professors have expressed that they intend to use Ox in their
  335. compilers courses this Spring.  There is also interest in using Ox for
  336. research and commercial software production.
  337.  
  338. Kurt M. Bischoff, Computer Science Dept., Iowa State University, Ames,
  339. Iowa bischoff@cs.iastate.edu
  340.  
  341.  
  342.              An Attribute Grammar Compiling System
  343.                            based on
  344.                         Yacc, Lex, and C
  345.  
  346. Ox generalizes the function of Yacc in the way that attribute grammars
  347. generalize context-free grammars.  Ordinary Yacc and Lex specifications
  348. may be augmented with definitions of synthesized and inherited attributes
  349. written in C syntax.  From these specifications, Ox generates a program
  350. that builds and decorates attributed parse trees.  Ox accepts a most
  351. general class of attribute grammars.  The user may specify postdecoration
  352. traversals for easy ordering of side effects such as code generation.  Ox
  353. handles the tedious and error-prone details of writing code for parse-tree
  354. management, so its use eases problems of security and maintainability
  355. associated with that aspect of translator development.
  356.  
  357. The translators generated by Ox use internal memory management that is
  358. often much faster than the common technique of calling malloc once for
  359. each parse-tree node.
  360.  
  361. Ox is a Yacc/Lex/C preprocessor, and is designed to bring attribute
  362. grammars closer to the mainstream of Unix-based language development.  Ox
  363. inherits all of the familiar syntax and semantics of Yacc, Lex, and C.  It
  364. is relatively easy to convert programs between Ox code and "pure
  365. Yacc/Lex/C" code.
  366.  
  367. Ox has been used to build a compiler for a small (eighty grammar rules)
  368. block-structured imperative programming language, and has been tested and
  369. found to be portable among the following systems running Unix:
  370.  
  371.      Hewlett-Packard PA, 680x0
  372.      Sun 3, SPARCstation
  373.      DECstation 2100, 3100, 5000
  374.      Silicon Graphics Inc. R3000
  375.      NeXT workstation
  376.      Data General AViiON, 88000
  377.  
  378. The author of Ox is Kurt M. Bischoff (bischoff@cs.iastate.edu), Department
  379. of Computer Science, Iowa State University.
  380.  
  381. For more information, please send your e-mail address to:
  382.  
  383.      ox-request@cs.iastate.edu
  384.  
  385. The following Ox-related documents are available in Postscript format by
  386. electronic mail:
  387.  
  388.      * User Manual for Ox: An Attribute-Grammar Compiling System
  389.      based on Yacc, Lex, and C, by Kurt M. Bischoff. TR92-30,
  390.      Computer Science Department, Iowa State University, Ames,
  391.      IA, December, 1992.  40 pages.
  392.  
  393.      * Design, Implementation, Use, and Evaluation of Ox: An
  394.      Attribute-Grammar Compiling System based on Yacc, Lex, and
  395.      C, by Kurt M. Bischoff. TR92-31, Computer Science
  396.      Department, Iowa State University, Ames, IA, December, 1992.
  397.      80 pages.  Includes the text of TR92-30.
  398.  
  399.      * GPPL: A Small Block-Structured Imperative Programming
  400.      Language Implemented Using Ox, by Kurt M. Bischoff. TR92-32,
  401.      Computer Science Department, Iowa State University, Ames,
  402.      IA, December, 1992.  66 pages.  Includes sample GPPL
  403.      programs and Ox/C source code for the compiler.  GPPL is
  404.      suitable for instruction and experimentation, or as a
  405.      template for design of a block-structured language.
  406.  
  407. To obtain one of these technical reports, please send an e-mail message
  408. consisting of:
  409.  
  410.      send tr <TR#>
  411.  
  412. to almanac@cs.iastate.edu, where <TR#> is one of: TR92-30, TR92-31,
  413. TR92-32.
  414.  
  415. To obtain an ASCII-format abstract of one of the above, send a message
  416. like:
  417.  
  418.      send abstract <TR#>
  419.  
  420. to the same address.
  421.  
  422. Send questions to: ox-request@cs.iastate.edu.
  423. -- 
  424. Send compilers articles to compilers@iecc.cambridge.ma.us or
  425. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  426.