5 ms·
I have the second edition, copyright 2007, and chapter 6 is "intermediate code generation". The whole chapter is definitely not about type checking -- is yours
by chubot 3y ago
I have the second edition, copyright 2007, and chapter 6 is "intermediate code generation". The whole chapter is definitely not about type checking -- is yours?
https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811 https://www.amazon.com/Compilers-Principles-Techniques-Tools...
It has 11 sub-sections, 2 of which are about type checking
6.3 - Types and Declarations, pages 370-378
6.5 - Type Checking - pages 386 - 398
So that's about 20 pages out of 993 pages. A fraction of a chapter!
---
What I was referring to is the appendix "A Complete Front End", which contains a lexer and parser, but not a type checker! Doesn't sound complete to me.
I guess they have a pass to create the three-address code, and type checking is only in service of that. But they don't give you the source code!
---
Also weirdly, when you look at the intro chapter "The structure of a compiler", it goes
1.2.2 Syntax Analysis
1.2.3 Semantic Analysis (3 paragraphs that mentions type checking and coercions)
1.2.4 Intermediate Code Generation
But when you look at the chapters, there's NO semantic analysis chapter! It goes from (4) Syntax analysis, (5) Syntax-directed translation, to (6) intermediate code generation.
I think there's a missing chapter! (or two)
- ww520 3y agoI have the 1st edition printed 1988. Chapter 6 is Type Checking, chapter 7 is Runtime Environments, and chapter 8 is Intermediate Code Generation. WTF. The 2nd edition is really butchered.
- chubot 3y agoWow yeah. So in the first edition pages 343 to 388 is a full chapter on type checking. It looks much more coherent. What the heck happened ...
- adastra22 3y agoStandard thing: older textbooks are generally better. They tend to get dumbed down in new revisions, and modified to fit stupid standards about class syllabus.
- chubot 3y agoThis reminds me that I actually bought the first edition of the GC handbook on purpose, because it had more C++ material, which was relevant to my project. The second edition cut a bunch of C++ material out. And yeah I don't think I missed anything -- I think it even had better diagrams. So yeah I believe that general rule! I didn't realize that at the time I bought the Dragon Book. Pretty sad how you can lose knowledge over time! --- The books also respond to fashion -- e.g. Java was a popular teaching language, so they had to add more Java. I think that is reasonable in some ways but can backfire in the long term. Although I guess I am not too excited about MIX assembly in TAOCP and so forth, so it's a hard problem
- adastra22 3y agoObviously sometimes the updates are fixing real critiques of earlier editions. Those are good. But many times it is “fixing” critiques along the line of “cut out advanced material because it is too much to cover in 1 semester.” Makes sense in an academic context, but not for professionals like you and me that are looking for that kind of stuff. Books also tend to become more sparse on the page, and with more pointless “illustrative” stock photos that add nothing and take up page real estate (leading to more advanced topics being dropped to reclaim space), but make the book seem more approachable to undergraduates. Generally applies more to physics, chemistry, and math books than computer science, but it is a general phenomenon.