Re: [?] Trees vs. Tuples for IRs

dwight@pentasoft.com (Dwight VandenBerghe)
18 Sep 1998 23:04:03 -0400

          From comp.compilers

Related articles
[?] Trees vs. Tuples for IRs nshaf@intur.net (Nick Shaffner) (1998-09-13)
Re: [?] Trees vs. Tuples for IRs clark@quarry.zk3.dec.com (Chris Clark USG) (1998-09-18)
Re: [?] Trees vs. Tuples for IRs dwight@pentasoft.com (1998-09-18)
Re: [?] Trees vs. Tuples for IRs heinrich@idirect.com (1998-09-19)
Re: [?] Trees vs. Tuples for IRs cliff.click@Eng.Sun.COM (Clifford Click) (1998-09-22)
Re: [?] Trees vs. Tuples for IRs will@ccs.neu.edu (William D Clinger) (1998-09-26)
Re: [?] Trees vs. Tuples for IRs pmk@sgi.com (Peter Klausler) (1998-09-26)
| List of all articles for this month |

From: dwight@pentasoft.com (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" <nshaf@intur.net>
wrote:
>.. 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.


Dwight
--


Post a followup to this message

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