home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / acorn / tech / 48 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  1.6 KB

  1. Path: sparky!uunet!mcsun!uknet!acorn!armltd!hmeekings
  2. From: hmeekings@armltd.co.uk (Harry Meekings)
  3. Newsgroups: comp.sys.acorn.tech
  4. Subject: Re: New Language/Compiler (ideas wanted)
  5. Message-ID: <5322@armltd.uucp>
  6. Date: 14 Aug 92 15:46:11 GMT
  7. References: <1992Aug13.130618.18871@odin.diku.dk>
  8. Sender: hmeeking@armltd.uucp
  9. Distribution: comp
  10. Organization: A.R.M. Ltd, Swaffham Bulbeck, Cambs, UK
  11. Lines: 25
  12.  
  13. In article <1992Aug13.130618.18871@odin.diku.dk> torbenm@diku.dk
  14. (Torben AEgidius Mogensen) writes:
  15.  
  16. >Afeature I have sorely missed in compilers for C etc. is a cheap
  17. >tail-call: if the last thing you do in a procedure or function is to
  18. >call a procedure or function, this can be implemented as a goto rather
  19. >than a general procedure/function call. Also, the local variables of
  20. >the calling procedure need not be saved before the call, as they will
  21. >never be used again. Note that this is not a laguage feature, but a
  22. >compiler feature. This requires a callee-saves-registers strategy, but
  23. >that is often the simplest anyway.
  24. >
  25.  
  26. It's curious that this should be posted in an Acorn newgroup, since the Acorn
  27. C compiler does indeed do (indeed, has always done) conversion of tail-calls
  28. branches, except when
  29.    the calling function contains a call to setjmp
  30. or the calling function takes the address of an argument
  31. or when compilation is using the -g flag (to avoid confusing the poor user).
  32.  
  33. It's true that lots of compilers don't do this but, bearing in mind the
  34. background of the compiler's original authors in functional programming, it's
  35. unsurprising that the Aconr compiler does.
  36.  
  37. Harry Meekings
  38.