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

  1. Path: sparky!uunet!math.fu-berlin.de!Germany.EU.net!mcsun!uknet!mucs!m1!bevan
  2. From: bevan@cs.man.ac.uk (Stephen J Bevan)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  5. Message-ID: <BEVAN.92Aug30182505@tiger.cs.man.ac.uk>
  6. Date: 30 Aug 92 17:25:05 GMT
  7. References: <17opl4INN5gb@roundup.crhc.uiuc.edu> <17ov89INNdls@network.ucsd.edu>
  8.     <ARI.HUTTUNEN.92Aug30182130@hulk.hut.fi>
  9. Sender: news@cs.man.ac.uk
  10. Organization: Department of Computer Science, University of Manchester
  11. Lines: 37
  12. In-reply-to: Ari.Huttunen@hut.fi's message of 30 Aug 92 16:21:30 GMT
  13.  
  14. In article <ARI.HUTTUNEN.92Aug30182130@hulk.hut.fi> Ari.Huttunen@hut.fi (Ari Juhani Huttunen) writes:
  15.    Yes, I would myself like to see these loop-constructs in Sather:
  16.  
  17.    loop       until <xxxx> loop   while <xxxx> loop  for <xxxx> to <yyyy> loop
  18.      <xxxx>     <yyyy>              <yyyy>             <zzzz>
  19.    end        end                 end                end
  20.  
  21. IMHO the above are quite poor syntax for expressing the kinds of loops
  22. that I see in numerical code.  Quite often it is possible to work in
  23. parallel, and all the above do is make it harder to extract the
  24. parallelism (of course so does the FORTRAN notation, but there is not
  25. reason to make the same mistake :-).  In the cases where it is not
  26. numerical, syntax like the above is often useless as it is usually
  27. restricted so that you can only iterate over integer indices (cf
  28. Oberon-2).  Note some languages get this right and let you iterate
  29. over whatever you want e.g. Eiffel and C (given Sather's parentage I
  30. guess it does to) 
  31.  
  32. Anyway, I think the following are "better" approaches :-
  33.  
  34. 1. use a language that achieves the same effect in a "better" way
  35.    e.g. Haskell with list comprehensions or Lisp + loop macros /
  36.    series package. 
  37.  
  38. 2. use a language that allows you to extend the syntax yourself e.g.
  39.    Scheme and Lisp so that you can do whatever you want.  There is
  40.    potential for getting this badly wrong, but as it takes someone
  41.    with a discerning taste to use Scheme/Lisp in the first place it
  42.    usually works out ok :-)
  43.  
  44. 3. Have a special notation for numerical iteration (that covers the
  45.    4th example), and leave everything else to a generic 1 1/2 loop
  46.    e.g. "loop ... exit when ... end".
  47.  
  48. Of course, it is all just concrete syntax so who cares anyway :-)
  49.  
  50. bevan
  51.