Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.misc Subject: Re: Basics of Program Design Message-ID: <12298@mimsy.UUCP> Date: 3 Jul 88 06:41:08 GMT References: <901@td2cad.intel.com> <3061@rpp386.UUCP> <395@proxftl.UUCP> Distribution: na Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 31 In article <395@proxftl.UUCP> bill@proxftl.UUCP (T. William Wells) answers Bob Webber with: [tail-recursive strlen deleted] >... Merely asserting that "any decent compiler would..." is not relevant. >This just asserts that YOU think that a compiler that does not deal with >tail recursion is not decent. In the real world, most compilers do NOT >deal with tail recursion, it not often being very useful to do this for >C programs. Actually, there are (only) two reasons `real world' C compilers do nothing about tail recursion: Hysterical Raisins, and debugging. top: since C compilers do not eliminate tail recursion, programmers avoided it; since programmers avoided it, it does not occur often; since it does not occur often, compilers that eliminate it do work that rarely pays off; since the work rarely pays off, those compilers are not as fast as others; since the compilers are not as fast, they are not considered as good; since they are not considered as good, they are not used; since they are not used, C compilers do not eliminate tail recursion; goto top. :-) Debugging programs in which tail recursion has been optimised away is often a confusing experience. Combined with the Raisins, this may make enough of an argument to keep compiler writers from doing more work. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris