Re: [?] Trees vs. Tuples for IRs (Dwight VandenBerghe)
18 Sep 1998 23:04:03 -0400

          From comp.compilers

Related articles
[?] Trees vs. Tuples for IRs (Nick Shaffner) (1998-09-13)
Re: [?] Trees vs. Tuples for IRs (Chris Clark USG) (1998-09-18)
Re: [?] Trees vs. Tuples for IRs (1998-09-18)
Re: [?] Trees vs. Tuples for IRs (1998-09-19)
Re: [?] Trees vs. Tuples for IRs (Clifford Click) (1998-09-22)
Re: [?] Trees vs. Tuples for IRs (William D Clinger) (1998-09-26)
Re: [?] Trees vs. Tuples for IRs (Peter Klausler) (1998-09-26)
| List of all articles for this month |

From: (Dwight VandenBerghe)
Newsgroups: comp.compilers
Date: 18 Sep 1998 23:04:03 -0400
Organization: Compilers Central
References: 98-09-042
Keywords: design, optimize

On 13 Sep 1998 22:44:37 -0400, "Nick Shaffner" <>
>.. Also, having dealt only
>with trees in the past, it seems that tuples might be easier to
>manipulate - is this generally true?

I think it's the other way around, Nick. Tuples can be a pain to work
with. Trees keep the natural order around - you have context to work
with. You know you're in a loop body, for example. There has been a
lot of debate about this in the literature, andone very interesting
work that champions tree is "The Art of Compiler Design - Theory and
Practice" by Pittman and Peters. The authors show how
Transformational Attribute Grammars (essentially, tree transformations
with attributes hung on the nodes) can be used to accomplish the usual
forms of AST optimization that tuples are traditionally used for. I
happen to like the tree approach better - tuples seem crude to me, in
a way. Even though the dragon book makes heavy use of them.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.