home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / misc / 3077 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.7 KB

  1. Path: sparky!uunet!sun-barr!olivea!sgigate!odin!fido!iain
  2. From: iain@sgi.com (Iain McClatchie)
  3. Newsgroups: comp.lang.misc
  4. Subject: Iteration in single assignment languages
  5. Keywords: single assignment iteration
  6. Message-ID: <psathc8@fido.asd.sgi.com>
  7. Date: 15 Sep 92 07:29:38 GMT
  8. Sender: news@fido.asd.sgi.com (Usenet News Admin)
  9. Organization: Silicon Graphics
  10. Lines: 33
  11.  
  12.  
  13. I don't know and wonder how single assignment languages handle these three
  14. kinds of iteration, especially the last:
  15.  
  16. 1) Loops where you know over what you iterate at compile time.
  17.    for (i = 0; i < 20; i++) ...
  18.  
  19. 2) Loops where you know over what you iterate before you begin the loop.
  20.    for (i = a; i < b; i++) {expressions not involving a,b, or i}
  21.  
  22. 3) Loop where you discover over what you iterate as you iterate
  23.    for (i = 0; abs(z) < 2.; i = i + 1) z = z*z + c;
  24.  
  25. My examples are coded in something like C, in which an array which is
  26. iterated over by i is allocated by the programmer beforehand, and it is
  27. his responsibility to get the size right.
  28.  
  29. In a single assignment language, I would think that the values taken on
  30. by z must go into some array z, so that the individual values are
  31. seperately addressable.  Supposing the compiler cannot optimize away the
  32. array, how does it know what size it is?  Better yet, how is this third
  33. loop written in a single assignment language?
  34.  
  35. For that matter, how is iteration over something like a directed acyclic
  36. graph written in a single assignment language?  Is it necessary to embed
  37. the data structure in an array and then run around it there?
  38.  
  39. I have a queer feeling that SISAL addresses many of these questions.  Can
  40. someone give me a good suggestion for something from which to learn SISAL?
  41.  
  42. -Iain McClatchie
  43. iain@mti.sgi.com
  44. 415-390-4527
  45.