home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2060 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.1 KB

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