home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / misc / 4027 < prev    next >
Encoding:
Text File  |  1992-12-14  |  5.7 KB  |  121 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  3. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  4. Subject: Re: Safety.  Was: Re: Pointers
  5. Message-ID: <Bz9FL2.9rp@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University Statistics Department
  8. References: <Bz0Iy5.A9K@mentor.cc.purdue.edu> <724312516@sheol.UUCP>
  9. Date: Mon, 14 Dec 1992 17:36:37 GMT
  10. Lines: 109
  11.  
  12. In article <724312516@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
  13.  
  14.             .................
  15.  
  16. >I have not seen any posting in which Herman explains *why* he does not
  17. >consider unions an adequate way to specify type punning, despite having
  18. >seen the claim that they *aren't* adequate several times.  (Type coercions
  19. >are something else, in standard usage.)
  20.  
  21. ANYTHING which suggests to the compiler that something is to be stored when
  22. it does not have to be is not adequate.  Also, there are problems if one
  23. type of object is, say, 32 bits, and another 64 bits.
  24.  
  25. >In particular, I'll quote an example from message
  26. ><723522717@sheol.UUCP>, and I would appreciate it if somebody would
  27. >explain what's so horrible or "inadequate" about the use of unions in
  28. >the example.  I'd especially appreciate comments on the last usage
  29. >below, involving inline functions. 
  30.  
  31. >-- begin excerpt from <723522717@sheol.UUCP> --
  32. > : Telling the compiler that that number which you used as an integer before
  33. > : is now to be considered a float is not ambiguous, except that most of the
  34. > : current languages will object strongly.
  35.  
  36. > "Most of the current languages" object strongly because THEY HAVE
  37. > NO SUCH OPERATION.  Herman is simply using an operation that is
  38. > MEANINGLESS IN THE LANGUAGE.
  39.  
  40. If a hardware operation, or even a "natural" operation which is somewhat
  41. more complicated, is not in the language, the language is excessively 
  42. weak if it cannot be adjoined so as to take into account hardware 
  43. capability.  The only language I know which has this operation explicitly
  44. is Galaxy. 
  45.  
  46. There was an attempt in the 1930's to introduce a language called
  47. "Basic English" which eliminated most of the verbs in English, as well
  48. as other features.  It never caught on.  Languages should be arbitrarily
  49. extensible.  If humans can conceive of an operation, it should be
  50. possible to add that operation to the language with little problem.
  51. The same holds for types; the C++ classes are really types, and the
  52. C typedef should have been called typealias.  Even prior to C, there
  53. were implementations of Fortran which allowed additional types.
  54.  
  55.     [Various excerpts from C, C++, etc. code deletedl]
  56.  
  57. > This notation at the use point is not much more clumsy than what Herman
  58. > probably wanted, and is at least meaningful in the language, since care
  59. > was taken to explain to the compiler what was going on.
  60.  
  61. The notation is more clumsy, and definitely does not convey the intention.
  62. The intention is that any moving of the object whose type is being changed
  63. only occurs if its location does not allow the subsequent actions to be
  64. taken on the collection of bits.
  65.  
  66. >-- end excerpt from <723522717@sheol.UUCP> -- 
  67.  
  68. >While I'm at it, I'd appreciate any explanation for Herman's
  69. >position on "first course" exposure:
  70.  
  71. >-- begin additional excerpt --
  72. > : Possibly the situation would eventually improve if CS students, in their
  73. > : FIRST course, would be placed in situations where their code would crawl
  74. > : unless they did such things.
  75.  
  76. > Why should their FIRST course introduce them to situations
  77. > that are strikingly atypical of most software development?
  78.  
  79. This is a chicken-and-egg phenomenon.  Most software development does
  80. not do certain things because the languages, compilers, and the training
  81. of the programmers does not mention them.  Political correctness is bad
  82. even in political situations.  What proportion of current programmers,
  83. even those who have had "advanced" courses, are aware of the important
  84. mathematical types of fixed point (NOT integer) and rational?  How many
  85. of them would think of including them?  There are many situations in
  86. which floating point is a guaranteed way to have problems, and the 
  87. person who starts out thinking that the type list of languages such
  88. as C are adequate will have a lot of unlearning to do to be able to
  89. do a good job in those numerous cases where C is inadequate.  Unlearning
  90. provides major obstacles for students in mathematics and statistics, and
  91. I see no good reason why CS and programming languages should be any
  92. different in this matter.
  93.  
  94. The student who takes a typical cookbook mathematics course seems to
  95. be farther away from eventually understanding than the one who starts
  96. out with the concepts and theory.
  97.  
  98. > Well, Herman's hope is:
  99.  
  100. > : This might cause more language producers and hardware designers to
  101. > : realize that there can be large costs with separate integer and floating
  102. > : registers, and that Boolean operations on floating numbers do make sense. 
  103.  
  104. > It is possible that the cause (ie: early introduction of atypical
  105. > application-specific difficulties) would have this effect (having
  106. > undue attention payed to niche requirements).  It is not clear
  107. > that this is a good thing, however.
  108. >-- end additional excerpt --
  109.  
  110. Political correctness, again.  There is the standing joke about the
  111. mathematician and the physicist producing hot water.  In the second
  112. case, the mathematician turns things off to reduce to the previous
  113. case.  The CS student, or programmer, who can only think in terms
  114. of the C types, and strict typing, is in this rut.  While mathematicians
  115. do not in fact act this way, these guys are really stuck.
  116. -- 
  117. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  118. Phone: (317)494-6054
  119. hrubin@snap.stat.purdue.edu (Internet, bitnet)  
  120. {purdue,pur-ee}!snap.stat!hrubin(UUCP)
  121.