home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-cv!ogicse!zephyr.ens.tek.com!uw-beaver!fluke!kurt
- From: kurt@tc.fluke.COM (Kurt Guntheroth)
- Newsgroups: comp.programming
- Subject: Re: Advantages/disadvantages of macros/inlining?
- Keywords: macro inline
- Message-ID: <1992Jul22.154647.877@tc.fluke.COM>
- Date: 22 Jul 92 15:46:47 GMT
- Article-I.D.: tc.1992Jul22.154647.877
- References: <1992Jul11.164201.14125@midway.uchicago.edu> <1992Jul13.162208.7651@webo.dg.com> <54558@mentor.cc.purdue.edu>
- Reply-To: kurt@tc.fluke.COM (Kurt Guntheroth)
- Organization: John Fluke Mfg. Co., Inc., Everett, WA
- Lines: 35
-
- hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
- >
- >On the one hand, computer people are stupidly insisting that the
- >compiler can do all, and that human attempts to improve what compilers
- >can do are futile. Now we hear the complaint that the compiler will
- >choke on the problem.
- >
- >On the one hand, we hear that there are lots of registers. On the
- >other hand, we hear that there are not enough for inlining.
- >
- >Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
-
- Well, it's all true.
-
- On a large program, a world-class compiler can do far better than even an
- experienced programmer at discovering optimizations. I would expect the
- compiler to win every time on non-toy problems.
-
- On some RISC processors, there are virtually unlimited registers; hundreds
- of them.
-
- On the other hand, there are constructs (like inlining) that can make it
- more difficult for some compilers to do a good job. Are these world class
- compilers? Maybe and maybe not, but it doesn't rob the truth from the first
- assertion. The best compilers on the best machines translating appropriate
- languages can do far better than a human.
-
- And there are machines with absolutely miserable register sets, and
- compilers with code generation strategies optimized for machines with many
- registers often suck big-time on machines with few or difficult-to-use
- registers.
-
- What this all means is that you have to pick the appropriate tool for the
- job, and even an excellent hammer is no good for sawing wood. Does this
- make computer science an oxymoron? Hardly.
-