Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!bronze!copper!harlan From: harlan@copper.ucs.indiana.edu (Pete Harlan) Newsgroups: comp.lang.scheme Subject: Re: Tail-calling and garbage collection Message-ID: Date: 14 Feb 91 06:48:40 GMT References: <9102112032.AA03542@cymbal.reasoning.com.> Sender: news@bronze.ucs.indiana.edu (USENET News System) Organization: Indiana University Lines: 32 gyro@cymbal.reasoning.COM (Scott Layson Burson) writes: [tail-recursion isn't a property of a language, but an implementation concern] Certainly a compiler for any language may perform tail-call optimization, and in this respect it is a language-independent issue. However, when a *language*, rather than a compiler, guarantees an optimization, it opens the door for a programming style that might not be a portable program in the language if the optimization were not guaranteed. W.r.t. tail-call optimization, I can write a continuation-passing style program in Scheme and it is correct; if I transliterate it to Common Lisp, the correctness of the program depends on whether the CL compiler performs tail-call optimization. Thus the program can't be properly called a CL program. In other words, the Scheme language includes CPS programs, while Common Lisp does not. The difference is an 'optimization', but this only proves that when you guarantee an optimization for a language, rather than a compiler, you (might) expand the set of valid programs for that language. Peter "I Love Passing Continuations Around" Harlan Indiana University harlan@copper.ucs.indiana.edu [Perhaps the problem lies in language specifications ignoring the concept of finite computer memory? This makes it difficult to even define what tail-call optimization might mean. In any case, this is a bug, not a feature, in language specifications, since memory is indeed limited.]