home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / misc / 3760 < prev    next >
Encoding:
Text File  |  1992-11-18  |  3.6 KB  |  72 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!udel!pervert!louie!dori.cis.udel.edu!carroll
  3. From: carroll@dori.cis.udel.edu (Mark C. Carroll)
  4. Subject: Re: languages which allow the introduction of new operators
  5. Message-ID: <1992Nov18.154754.1848@udel.edu>
  6. Sender: usenet@udel.edu (USENET News Service)
  7. Nntp-Posting-Host: dori.cis.udel.edu
  8. Organization: University of Delaware, Newark
  9. References: <BxMCxA.3nM@mentor.cc.purdue.edu> <1992Nov15.032459.3069@udel.edu> <Bxr9vx.KBD@mentor.cc.purdue.edu>
  10. Date: Wed, 18 Nov 1992 15:47:54 GMT
  11. Lines: 59
  12.  
  13. In article <Bxr9vx.KBD@mentor.cc.purdue.edu> hrubin@mentor.cc.purdue.edu (Herman Rubin) writes:
  14. ]In article <1992Nov15.032459.3069@udel.edu> carroll@thorin.cis.udel.edu (Mark C. Carroll) writes:
  15. ]]In article <BxMCxA.3nM@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  16. ]
  17. ]            .........................
  18. ]
  19. ]]#2: The semantic model of a language does *not* inhibit the optimizer.
  20. ]]  Read that sentence again. Read it several times, if necessary, until
  21. ]]  you get it into your head. The fact that the language is conceptually
  22. ]]  stack based does *not* mean that it has *any* stack at runtime!
  23. ]]  (For example, the code generator may write continuation passing code,
  24. ]]  which completely replaces the stack with a special form of tail-calling.)
  25. ]
  26. ]This is the case if the considerations for the optimizer were put in by
  27. ]the compiler writer.  Computers are extremely fast sub-imbeciles.  If we
  28. ]had a group of compiler people who would do their best to incorporate
  29. ]considerations which users see in their optimizers, and produce their
  30. ]optimizers so that these improvements can be quickly inserted, we may
  31. ]get reasonable results.
  32.  
  33. Please try reading some compilers literature. One textbook on compiler
  34. optimizations would do wonders for you!
  35.  
  36. Optimization is a _very_ difficult business. Any optimization has
  37. interactions with other optimizations, in terribly complex (and not
  38. necessarily well-understood) ways. Making any change to the
  39. optimization process can have broad affects on the entire process.
  40. Changing one instruction in an inner loop that saves two cycles per
  41. iteration may completely disable a different optimization that would
  42. have saved 200 cycles per iteration.
  43.  
  44. Any optimization, particularly on modern architectures, has got to
  45. consider its affect on pipeline fills, branch predictions, register
  46. allocations, memory and cache uses, and dozens of other factors.  Do
  47. you think that you're qualified to judge what affect your two-cycle
  48. savings will have on the rest of your program? If so, you're in the
  49. wrong field - you should be designing compilers.
  50.  
  51. ]The semantic model of the language can, however, greatly inhibit the
  52. ]programmer.  Try communicating floating binary from one machine to
  53. ]another; the only semi-portable way I have seen are to convert to
  54. ]higher precision floating decimal, transmit that, and convert back.
  55. ]
  56.  
  57. What does that have to do with the semantic model of the language?
  58. That's a very hardware related issue. If I design a language that uses
  59. floating point numbers, I'm restricted to using whatever internal
  60. float format the hardware designer chose for the architecture I'm
  61. learning. That's got nothing to do with the semantic model of the
  62. language.
  63.  
  64. Just what do you think a semantic model is?
  65.  
  66.     <MC>
  67. -- 
  68. [ Mark Craig Carroll <MC> ] You say you know no tricks, have no talents -
  69. [ U of Delaware, CIS Dept ] Isn't everyone supposed to have their own?
  70. [ Grad Student/Lab Hacker ] Yes, but few are obvious. Few draw notice to those
  71. [ carroll@udel.edu        ] who posess them, like flags waving themselves.
  72.