home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4776 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  4.3 KB

  1. Path: sparky!uunet!stanford.edu!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!burley
  2. From: burley@apple-gunkies.gnu.ai.mit.edu (Craig Burley)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: SUMMARY: CHARACTER FUNCTION as dummy argument
  5. Date: 16 Dec 92 14:23:44
  6. Organization: Free Software Foundation 545 Tech Square Cambridge, MA 02139
  7. Lines: 68
  8. Message-ID: <BURLEY.92Dec16142344@apple-gunkies.gnu.ai.mit.edu>
  9. References: <BURLEY.92Dec15044825@apple-gunkies.gnu.ai.mit.edu>
  10.     <1992Dec15.111717.1@slacvx.slac.stanford.edu>
  11. NNTP-Posting-Host: apple-gunkies.gnu.ai.mit.edu
  12. In-reply-to: fairfield@slacvx.slac.stanford.edu's message of Tue, 15 Dec 1992 19:17:17 GMT
  13.  
  14. In article <1992Dec15.111717.1@slacvx.slac.stanford.edu> fairfield@slacvx.slac.stanford.edu writes:
  15.  
  16.        I won't comment on whether or not the VAX way of passing character
  17.    arguments (functions and/or variables) is efficient or not since someone
  18.    like Steve Lionel is in a _much_ better position to answer (although I
  19.    do suspect there's no performance hit on VMS because ALL character
  20.    entities are passed by [the address of a] descriptor).  However, while I do
  21.    appreciate issues of efficiency in Fortran code, CHARACTER manipulations
  22.    are one place I think we should "look the other way", so to speak.  These
  23.    manipulation most often occur in the user interface, and users are SLOW
  24.    DEVICES ;-)  Furthermore, if you DO need efficient character manipulation,
  25.    try recoding using the equivalent of Hollerith data: it's MUCH faster to
  26.    compare INTEGER variables, even in a loop, than to compare CHARACTER
  27.    variables.  (Well, I admit there is likely hardware dependency in this...).
  28.  
  29. Oh, I'm sure on the VAX it makes no difference.  I don't take issue
  30. with the assertion that we should "look the other way" when it comes to
  31. _implementation_ of CHARACTER -- heck, I've done three such implementations
  32. in my lifetime (an early one adding PL/1-like character support to a system
  33. software package written, essentially, in FORTRAN 66), and they've all
  34. been implemented at least initially in a "slow" way.  (I got to optimize
  35. the first one later, and it made a _visible_ difference at 9600 baud!)
  36.  
  37. My complaint is that language _extensions_ should not be added in a way
  38. that is likely to slow down, even a little bit, programs that don't use
  39. them, even on different machines.  That's what the VAX extension under
  40. discussion does.  Just as the VAX extension that makes CALL FOO different
  41. from CALL FOO() introduces nonportability to some software written on
  42. the VAX that could otherwise be portable to different architectures.
  43.  
  44. I admit that, in this case, the performance hit is small (perhaps
  45. immeasurable in most programs) and, if the feature is truly _needed_
  46. (which seems unlikely), there's no obvious alternative, so perhaps it's
  47. worth having been done to some people.  _But_, I can't do it in GNU
  48. Fortran, nor can it be done in f2c, or many other machines, because of
  49. the requirements it places on calling sequences -- a _better_ (nonobvious)
  50. alternative (which I won't bother suggesting, as it's too late now) wouldn't
  51. have had _any_ of these problems.
  52.  
  53. Language design is to compiler implementation as diamond-cutting
  54. is to pottery.  No matter how good you are at pottery, you do not
  55. necessarily have the skills for cutting a diamond, and if you are going
  56. to try to do so even a little bit, start on a diamond that nobody
  57. cares about (i.e. with very little value).
  58.  
  59. (I don't claim I'm any good at language design myself, btw, though I've
  60. proven some skill at it in the past.  But I know bad language design about
  61. as well as a potter might know a bad diamond cut.  Anyone can be a critic. :-)
  62.  
  63. BTW, the jury apparently is still out on whether
  64.  
  65.     CHARACTER*(*) CFUNC
  66.     EXTERNAL CFUNC
  67.     CALL FOO(CFUNC)
  68.     END
  69.  
  70. is standard-conforming.  VAX/VMS FORTRAN doesn't support it, neither does
  71. GNU Fortran (for the moment; it's much easier for me to fix g77 than for
  72. DEC to fix its compiler, since I have to worry only about the front-end
  73. support, while DEC has to be concerned with how their extension would
  74. interact with this possibly-standard feature), but perhaps some compilers
  75. do.  If I don't get a definitive answer referencing the standard
  76. within a day or so, I'll try and get other standards people involved in
  77. coming up with one.
  78. --
  79.  
  80. James Craig Burley, Software Craftsperson    burley@gnu.ai.mit.edu
  81. Member of the League for Programming Freedom (LPF) lpf@uunet.uu.net
  82.