>>>> "Glynn" == Glynn Clements
<glynn(a)sensei.co.uk> writes:
Glynn> Raymond Toy wrote:
> One question, though, on the tail-recursive feature. It's
nice to
> have but is it really, really important? Elisp isn't (right?), and
> we've been doing fine without proper tail recursion.
Glynn> We've been *surviving* without tail recursion optimisation.
Glynn> Ultimately, tail recursion can always be converted to explicit
Glynn> iteration, which is what you need to do in elisp if you don't want to
Glynn> take a performance hit.
Of course. I'm just curious how bad it really is. I assume that the
performance hit is not the lack of tail-recursivion, but the
exceedingly slow funcall's in elisp.
Some discussions in comp.lang.lisp (or scheme?) mentioned that even
though tail-recursion is equivalent to iteration, it still takes a
toll on speed. 20% maybe or more? I don't remember the numbers from
the tests that were done.
Glynn> However, it's effectively a bug (IMHO) which we've had to work
around.
Glynn> It would be nice if algorithms which would naturally be implemented
Glynn> using tail recursion could be written in their natural form.
I guess my question is, if things were written recursively, how a big
a stack would we use and would that be big enough to matter?
Not theoretical questions, but real world numbers for xemacs. (No,
I'm not asking anyone to actually do this with xemacs. I wouldn't do
it. :-) )
Ray