home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / arch / 9239 next >
Encoding:
Internet Message Format  |  1992-09-07  |  8.0 KB

  1. Xref: sparky comp.arch:9239 sci.math:11018 comp.lang.misc:2939 comp.lang.fortran:3436 comp.edu:1543
  2. Path: sparky!uunet!pmafire!news.dell.com!swrinde!elroy.jpl.nasa.gov!decwrl!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  3. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  4. Newsgroups: comp.arch,sci.math,comp.lang.misc,comp.lang.fortran,comp.edu
  5. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  6. Message-ID: <Bu2r42.5xr@mentor.cc.purdue.edu>
  7. Date: 4 Sep 92 22:14:25 GMT
  8. References: <Btx4vF.Jx6@mentor.cc.purdue.edu> <92Sep1.205116edt.669@neuron.ai.toronto.edu> <1992Sep4.162938.29237@dscomsf.desy.de>
  9. Sender: news@mentor.cc.purdue.edu (USENET News)
  10. Organization: Purdue University Statistics Department
  11. Lines: 138
  12.  
  13. In article <1992Sep4.162938.29237@dscomsf.desy.de> Hallam@zeus02.desy.de writes:
  14. >In article <92Sep1.205116edt.669@neuron.ai.toronto.edu>, radford@cs.toronto.edu
  15. >(Radford Neal) writes:
  16.  
  17. >|>In article <Btx4vF.Jx6@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu
  18. >|>(Herman Rubin) writes:
  19.  
  20.             .......................
  21.  
  22. >|>>If a procedure can use some of the machine instructions and the languages
  23. >|>>available to the programmer cause code to run considerably slower because
  24. >|>>the languages cannot use those instructions, the languages are inadequate. 
  25. >|>>No amount of software engineering, or compiler optimization, and get around
  26. >|>>this.  It is this feature which can make major differences in the relative
  27. >|>>speeds of computing on different machines.
  28.  
  29. >|>This is seldom true. In fact, machines and programing languages have
  30. >|>co-evolved in such a way as to practically ensure this.
  31.  
  32. >RISC machines are fast bercause they abolish support for assembly code. On a
  33. >RISC machine instructions are provided for the sole benefit of compilers.
  34.  
  35. The RISC machines still have many of these useful instructions.  I do not see
  36. how a machine can possibly be speeded up by abolishing support for assembly
  37. code, RISC or otherwise.  A compiler which has limited capabilities will
  38. be likely to run faster.  
  39.  
  40. Many RISC machines have double register shift capabilities, condition codes
  41. using overflow, and other such goodies.  These should be in HLLs, or easily
  42. added to them.  The use of them is portable, even though the implementation
  43. may not be.  The use of packing and unpacking floats is portable, and there
  44. are definitely cases for using these operations.  
  45.  
  46. There has been discussion on some of these groups about the lack of nxn -> 2n
  47. multiplication, where n is the integer word size; this is the case on some
  48. CISC machines, and also on some RISC machines, but others have the capability. 
  49. But I know of no HLL which allows writing this.  There is also the comparable
  50. division operation.  The use of these features is portable.
  51.  
  52. >|>More generally, there are languages that lack certain capabilities
  53. >|>that are available in any assembly language. Pascal does not allow a
  54. >|>variable to contain a pointer to a procedure, for example. While some
  55. >|>of the time this will just be an oversight, more typically, it results
  56. >|>from a particular vision of programming, which the language is trying
  57. >|>to support. Such visions are essential to progress, much more so than
  58. >|>a miscellaneous collection of "features".
  59.  
  60. >This is just the generic language war taken to root. Of course no language can
  61. >provide more capabilities than machine code. However this is irrelevant since
  62. >working at such a low level of abstraction is too error prone to be feasible for
  63. >anything like a large project.
  64.  
  65. None of the features I have mentioned are at "such a low level of abstraction."
  66. These are naturally occurring operations and conditions.  There are many more
  67. of them.  If the language does not permit these things, one has to work around
  68. them, and these workarounds are likely to be less portable than the constructs.
  69.  
  70. The constructs of the language do need translation into machine code, and of
  71. course this is non-portable.  But it should be possible to use these constructs
  72. without necessarily translating them clumsily into the machinery which the
  73. language designers decided was "adequate."  A major reason for the success
  74. of English is that there is no attempt to keep the language "pure."
  75.  
  76.  
  77. >|>>The CS curricula exascerbate the problem by indoctrinating the student in
  78. >|>>the attitude that the machine instruction set is not to be considered in
  79. >|>>normal programming. 
  80.  
  81. >The machine instruction set is of very little relevance since it is very rarely
  82. >the case that the target machine is known. I can predict the machines we will be
  83. >using for the next 18 months/2 years, no more. We will certainly have at least 3
  84. >major manufacturers involved. People who piddle about optimising their code to a
  85. >particular machine end up stuck with it. This is OK for embedded controllers
  86. >which we rarely change but not for general purpose stuff.
  87.  
  88. Again, there can be improvement by using machine-independent constructs, 
  89. implemented in a machine-dependent manner.  
  90.  
  91. >|>Other cases would be software that has time-critical interactions with
  92. >|>the real world, or software that runs on a machine with an unusual
  93. >|>architecture (some parallel machines, perhaps), etc. This is why
  94. >|>indoctrination is bad - you need to known when an exception comes up.
  95.  
  96. >We run massively parrallel machines and have a massive data rate to cope with.
  97. >Thats why we *have* to use high level languages, the complexity of the problem
  98. >is too great to allow use of machine code.
  99.  
  100. Wrong again!  Massively parallel machines require, for efficiency, the
  101. elimination of branches as much as possible.  This calls for really CISC
  102. architecture, and quite a few tricks not envisioned by the HLL designers.
  103. A switch operator is likely to end up taking every branch, so every
  104. processor spends the time for every branch.  It is more important that
  105. massively parallel machines find a way to reduce this than to avoid
  106. machine instructions, especially if the machine instructions can eliminate
  107. branches, as is often the case.
  108.  
  109. >|>>There can, and should, be interaction at compile time between the compiler
  110. >|>>and the programmer.  The compiler also should be able to suggest rearranging
  111. >|>>machine instructions, not just the output from HLLs.  
  112.  
  113. >|>This would occasionally be useful. I sometimes look at the output of
  114. >|>the compiler to see if it is generating reasonable code, and to find
  115. >|>out if there's any point in my doing certain optimizations at the
  116. >|>source level (e.g. loop unrolling). This is reasonable for me to do
  117. >|>because I have years of experience at this sort of thing. It probably
  118. >|>isn't reasonable for you to do it.
  119.  
  120. >If we needed that type of optimisation we would either buy a compiler which did
  121. >it or write our own.
  122.  
  123. Not all of us have this option.  Those of us who are in American universities
  124. rarely have either choice.  Also, I doubt if one could buy such a compiler at
  125. this time.
  126.  
  127. >|>>What we are teaching the CS students, and even the software engineers, is 
  128. >|>>essentially the mistake made in teaching methods without understanding in
  129. >|>>mathematics and statistics.  Someone who has only learned a particular
  130. >|>>collection of methods is extremely unlikely to consider anything not in
  131. >|>>that particular bag of tricks.  Training is not education.
  132.  
  133. >|>Yes. A CS graduate who intends to work as a software engineer should
  134. >|>BE ABLE to work at all levels, even more so for a computer scientist
  135. >|>designing a new programming language or operating system. They should
  136. >|>also know enough not to work at the machine level unless there is a
  137. >|>good reason, which isn't very often for application programming. Most
  138. >|>non-professional programmers would be well advised to think about
  139. >|>their problem more, rather than learn the assembly language of the
  140. >|>machine they are using this month.
  141.  
  142. >We shiould stop calling it Computer Science and call it engineering.
  143.  
  144. >Machine code is important, CS graduates should know how to build compilers and
  145. >processors.
  146. -- 
  147. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  148. Phone: (317)494-6054
  149. hrubin@pop.stat.purdue.edu (Internet, bitnet)  
  150. {purdue,pur-ee}!pop.stat!hrubin(UUCP)
  151.