Re: Why do lisps have stack limits?
From: Kent M Pitman (pitman_at_nhplace.com)
Date: 11/24/03
- Next message: Kent M Pitman: "Re: Why (eql #c(1 0) 1) but (not (eql #c(1.0 0.0) 1.0))?"
- Previous message: Kaz Kylheku: "Re: Another algorithmic complexity question"
- In reply to: Duane Rettig: "Re: Why do lisps have stack limits?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Nov 2003 15:20:18 -0500
Duane Rettig <duane@franz.com> writes:
> But who's to say what is bad programming style and what is simply
> a large (deeply recursive, in this case) problem to solve?
Well, indeed. My real point here was that the original post seemed to
have as its implication that stack limits were bad, and I wanted to
point out that whether they are is subjective. There are indeed some
reasons for wanting deep recursion, and for this one can just write a
handler that extends the stack (in implementations that allow it), or
pre-allocate lots of stack (for other implementations). But infinitely
deep stacks are no substitute for tail call elimination if the calls are
supposed to be getting cleaned up and are not. And calling functions
recursively when the language or implementation doesn't assure you that
tail call elimination will occur is no substitute for writing a loop.
So I wasn't meaning to take a political stance here other than to say
that whether there was even a problem in the first place is already
subjective.
> The moral? The appropriateness of a program's resource usage is not
> necessarily proportional to the program's well-written-ness.
Yes. But to this I'll add: well-written-ness is not an absolute. It
is relative to a context. The implementation and/or language spec
generally precedes the program, and the program is written in the
context of resource limitations. In a small address space, these
things were of concern and well-written programs _for that context_
did not do that, _even if_ the context did not promote the kinds of
programs we hoped to be writing in the long run...
- Next message: Kent M Pitman: "Re: Why (eql #c(1 0) 1) but (not (eql #c(1.0 0.0) 1.0))?"
- Previous message: Kaz Kylheku: "Re: Another algorithmic complexity question"
- In reply to: Duane Rettig: "Re: Why do lisps have stack limits?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|