home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / misc / 2841 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  5.1 KB

  1. Path: sparky!uunet!sun-barr!ames!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  2. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  5. Message-ID: <BtwIqK.78M@mentor.cc.purdue.edu>
  6. Date: 1 Sep 92 13:27:54 GMT
  7. References: <17mcr4INN4qq@network.ucsd.edu> <BttB9z.IAy@mentor.cc.purdue.edu> <BEVAN.92Aug31101447@tiger.cs.man.ac.uk>
  8. Sender: news@mentor.cc.purdue.edu (USENET News)
  9. Organization: Purdue University Statistics Department
  10. Lines: 85
  11.  
  12. In article <BEVAN.92Aug31101447@tiger.cs.man.ac.uk> bevan@cs.man.ac.uk (Stephen J Bevan) writes:
  13. >In article <BttB9z.IAy@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  14.  
  15.             ...................
  16.  
  17. >   Also, mathematicians especially use lots of operators.
  18.  
  19. >They also use lots of Greek letters (at least in the sort of maths I
  20. >read).  It is reasonably easy to replace them with something else, and
  21. >IMHO you can do the same thing with the operators.  Of course I expect
  22. >that most mathematicians lament the loss of Greek characters when
  23. >writing programs, so I don't expect them to give up operators.
  24.  
  25. This is totally different.  The name of a variable is purely arbitrary,
  26. and any other string of symbols recognized as one is just as good.  But
  27. an operator is a constant, and cannot just be renamed.
  28.  
  29. Now one can attempt to define an operator in terms of "system primitives,"
  30. but this cannot always be done reasonably, and an attempt to do so may be
  31. highly machine dependent.  Try defining the Boolean operators or shift
  32. operators in terms of the other operators.  It is somewhat easier to
  33. define a test for overflow in terms of the others.  In all of these
  34. cases, the resulting code would be obviously inefficient.
  35.  
  36. >   Despite what the CS gurus say, allowing the introduction of
  37. >   additional functions is not the same thing.
  38.  
  39. >Semantically it is, and that is what really counts.
  40. >Some languages do allow you to define infix operators (Haskell and ML),
  41. >but there are very few that allow you to define distfix syntax.
  42. >Of those that do they are either quite old or designed for completely
  43. >different purposes than numerical work.  Also a problem with distix is
  44. >that it is very easy to get ambiguities and unless you are going to
  45. >introduce some user defined precedence (which I'm not even sure would
  46. >solve the problem), the only solution is to put parentheses around
  47. >phrases.  Once you do this, you might as well be using a prefix or
  48. >posfix only language.
  49.  
  50. I believe that most mathematicians would not worry too much about the
  51. need to put parentheses, although they would probably want a more efficient
  52. way of doing it, and definitely one easier to read.  Counting parentheses
  53. is slow and fraught with error.  But the precedence among the operators in
  54. the HLLs is quite arbitrary, and except for the "standard" arithmetic
  55. operators, and the general, but not universal, rule that unary is done
  56. first, is likely to be messed up.  I suggest the language people come up
  57. with better ways to handle parentheses and at least greatly reduce the
  58. application of precedence rules.  
  59.  
  60. >   Also, mathematicians and scientists are accustomed to using
  61. >   whatever syntax they like, as long as it does not lead to confusion.
  62.  
  63. >Confusion for whom?  I get very confused when I read books that use
  64. >|A| to mean three different things depending on the context (which
  65. >isn't always immediately obvious).  With all due respect to
  66. >mathematicians and scientists, just because they are accustomed to
  67. >creating syntax on the fly, it doesn't meant that they are any good at
  68. >it (where "good" is totally subjective, but I'll take it to mean that
  69. >other people find it readable and better (another subjective term)
  70. >than anything else).  For example, I'm sure Frege thought he had a
  71. >great notation for his logical formulae, but IMHO (and with plenty of
  72. >hindsight :-) it was needlessly complicated. 
  73.  
  74. Do we not have overloaded operators now?  The operations of + - *
  75. are defined for various types, and in common mathematical use they
  76. extent to many other types, such as vector and matrix.  In some cases
  77. the extension is even non-unique; is A*B, for A and B matrices, is it
  78. the element-by-element product, or the matrix product?  I have used both.
  79.  
  80. And when mathematicians do not like notation, they change it.  There are
  81. no committees to go through, and in the meantime, communication is not
  82. so badly affected.   Sometimes, even if it is bad, it is not considered
  83. worth changing.
  84.  
  85. The CS people should not be telling users that the hardware/software
  86. combination is "smart."  Rather, they should emphasize that it is very
  87. unintelligent, but very fast--a super-fast sub-imbecile.  They do only
  88. what they are told, no matter how stupid.  For a computer, there would
  89. have to be very careful translations.  These could be local or global;
  90. the .h files are such, and are in common use now.  But they, and the
  91. current methods of incorporating user-defined macros, are inadequate.
  92. -- 
  93. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  94. Phone: (317)494-6054
  95. hrubin@pop.stat.purdue.edu (Internet, bitnet)  
  96. {purdue,pur-ee}!pop.stat!hrubin(UUCP)
  97.