Related articles |
---|
[3 earlier articles] |
Re: Is C++ really used ? salomon@silver.cs.umanitoba.ca (1997-05-04) |
Re: Is C++ really used ? krk@cygnus.com (Kim Knuttila) (1997-05-04) |
Re: Is C++ really used ? jlilley@empathy.com (John Lilley) (1997-05-04) |
Re: Is C++ really used ? dwight@pentasoft.com (1997-05-04) |
Re: Is C++ really used ? cdg@nullstone.com (Christopher Glaeser) (1997-05-04) |
Is C++ really used ? peter@bj-ig.de (Peter Brueckner) (1997-05-04) |
Re: Is C++ really used ? danwang@nordica.CS.Princeton.EDU (1997-05-07) |
Re: Is C++ really used ? kbreinho@bsquare.com (Keith L. Breinholt) (1997-05-08) |
Re: Is C++ really used ? geert@sun3.iaf.nl (1997-05-08) |
Re: Is C++ really used ? David.Monniaux@ens-lyon.fr (1997-05-08) |
Re: Is C++ really used ? chase@world.std.com (David Chase) (1997-05-08) |
Re: Is C++ really used ? clark@quarry.zk3.dec.com (1997-05-08) |
Re: Is C++ really used ? cliffc@risc.sps.mot.com (Cliff Click) (1997-05-08) |
[6 later articles] |
From: | danwang@nordica.CS.Princeton.EDU (Daniel Wang) |
Newsgroups: | comp.compilers |
Date: | 7 May 1997 11:25:09 -0400 |
Organization: | Princeton University Department of Computer Science |
References: | 97-04-156 97-04-171 |
Keywords: | C++, practice, OOP |
Kevin Jacobs <jacobs@darwin.cwru.edu> writes:
> In Andrew Appel's case, his "Modern Compiler Implementation in Java"
> hardly uses any object oriented design features in the compiler
> implementation. In fact he recommends in chapter 1 that all
> programs be written in as close to pure functional style as
> possible. I can only assume that his ML bias is showing through;
> after all New Jersey ML is his primary compiler research platform.
He also takes some pain to explain in Chapter 4 why OO features don't
work well in compiler frameworks. The basic argument being that in a
compiler the objects you deal with are fixed. (IR or AST nodes) The
computations you want to preform on them aren't. i.e. various data
flow analysis.
Therefore you should structure your code so that it is easy to add new
computations on the objects. If your code in a traditonal OO style
where each AST/IR object has a method for each analysis you have to
spread the implementation of your analysis across several objects, and
every time you change your analysis then you have to make globabl
changes to your code base. In a traditional GUI applications the
computations (redraw, handle event) you want to do are fixed but the
objects aren't. So it makes sense to structure code in an OO style.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.