Besides devoting too many pages to parsing, I think compiler practitioners have low opinion of the book because it isn't useful for them. For example, the second edition claims to be updated to modern optimization techniques, and in a sense that's true, but it is useless because the book isn't using SSA. For practitioners, SSA is not optional these days, and everything about optimization in the book needs to be updat…
But the dragon book introduces three address code. SSA is a variant of three address code. Take a look here http://www.cs.columbia.edu/~aho/cs4115/Lectures/15-03-25.htm... .
Tell HN: The dragon compiler book (2nd edition) is a great book
31–40 of 48 posts
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#32I have the first edition but do not have an intention to create compilers yet, and the book is the hardest book I have for recreational reading. I can not just open it in the middle and find anything understandable.
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#33Besides devoting too many pages to parsing, I think compiler practitioners have low opinion of the book because it isn't useful for them. For example, the second edition claims to be updated to modern optimization techniques, and in a sense that's true, but it is useless because the book isn't using SSA. For practitioners, SSA is not optional these days, and everything about optimization in the book needs to be updat…
But the dragon book introduces three address code. SSA is a variant of three address code. Take a look here http://www.cs.columbia.edu/~aho/cs4115/Lectures/15-03-25.htm... .
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#34Earlier quoted context omitted.
But the dragon book introduces three address code. SSA is a variant of three address code. Take a look here http://www.cs.columbia.edu/~aho/cs4115/Lectures/15-03-25.htm... .
Well yes, but you can't use the algorithm in the dragon book to generate three address code to generate SSA, because SSA has additional constraints. The dragon book really dropped the ball here, there is no excuse why it doesn't include any algorithm for SSA construction.
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#35From the parsers I see in the wild (not strictly speaking about compilers here), I think most programmers should definitely spend some time studying the basics of them. It’s incredible to me how people mess up parsing even the simplest of file formats or make it super complicated.
I'm having flashbacks to a well funded startup I used to work at. People seemed to think that to how to handle having commas in data while still being able to use CSV files was an area of active research. At, like, a dozen different layers in the application we would strip commas from any and all strings, but they would still frequently slip through and screw up the entire pipeline. The complaints I made about this q…
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#36Earlier quoted context omitted.
But the dragon book introduces three address code. SSA is a variant of three address code. Take a look here http://www.cs.columbia.edu/~aho/cs4115/Lectures/15-03-25.htm... .
3AC/TAC is something fundamentally different than SSA. Sure, both somehow superficially constrain how you write variable assignment statements - if your intermediate representation contains such things and is a list of instructions. 3AC means that your "instructions" have In fact SSA makes no constraints on the number of operands in an instruction/operation what so ever.
```
p = a + b
q = p-c
p = q * d
```
Ssa:
```
p1 = a+ b
q1= p1 - c
p2 = q1 * d
```
Given the above examples how is it not straightforward to use ssa instead of three address code using what the dragon book teaches? What is wrong with the above examples?
In fact section 6.2.4 in the dragon book it says:
“Two distinctive aspects distinguish SSA from three-address code. The first is that all assignments in SSA are to variables with distinct names; hence the term static single-assigment.” The second one is that ssa uses a function to combine two definitions
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#37Besides devoting too many pages to parsing, I think compiler practitioners have low opinion of the book because it isn't useful for them. For example, the second edition claims to be updated to modern optimization techniques, and in a sense that's true, but it is useless because the book isn't using SSA. For practitioners, SSA is not optional these days, and everything about optimization in the book needs to be updat…
Do you recommend a book that’s more up-to-date?
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#38Just some clarification, it is not difficult to understand but difficult to build from scratch. I'm thinking maybe a book that asks me to build up BNF expressions for a series of grammars of gradually increasing complexity would be nice.
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#39What is a good book just for recursive descend parsing? I dabbed into some compiler books but found BNF difficult. Just some clarification, it is not difficult to understand but difficult to build from scratch. I'm thinking maybe a book that asks me to build up BNF expressions for a series of grammars of gradually increasing complexity would be nice.
Re: Tell HN: The dragon compiler book (2nd edition) is a great book
#40What is a good book just for recursive descend parsing? I dabbed into some compiler books but found BNF difficult. Just some clarification, it is not difficult to understand but difficult to build from scratch. I'm thinking maybe a book that asks me to build up BNF expressions for a series of grammars of gradually increasing complexity would be nice.
Came across it on HN but I have not read it though.