Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] "Go Considered Harmful"
- Date: Fri, 4 Sep 2020 17:34:58 +0900
- From: "Stephen J. Turnbull" <turnbull.stephen.fw@example.com>
- Subject: Re: [tlug] "Go Considered Harmful"
- References: <24400.24945.605926.15911@turnbull.sk.tsukuba.ac.jp> <24400.24150.236422.455217@turnbull.sk.tsukuba.ac.jp> <20200903052509.xmijwpo2f5jbmjqs@iambic.cynic.net> <24400.57077.881966.886236@turnbull.sk.tsukuba.ac.jp> <20200904013221.th5wjpe2azohm6ga@iambic.cynic.net>
Curt J. Sampson writes: > how to convert non-tail-call recursive functions into tail call > form[?] It's not difficult to do, ... but is it really essential > complexity? Or is dealing with that something that the language > system should do? Of course it depends. Language implementers need to know how to do that. Application implementers would be fine with "recursive calls are optimized and compiled efficiently enough that you should rarely if ever need to convert them to another form". But it's not obvious to me that that's true. > But still, aside from that, at least anybody can look at simple recursive > functions even in a language they don't know and understand exactly the > iteration conditions. Sure. And people do arithmetic with the Peano postulates too! ... wait. Note that "simple" is carrying a heavy load here. In a language with side effects recursion suffers from the I = PLAY(0) problem. > I happened to be reformatting some BASIC code the other day (don't > ask) and realized that it's not obvious how FOR loops really work. So BASIC sucks. Python (for one, I pick Python because I know it well) doesn't have that problem. (Of course it has the I = PLAY(0) problem.) Here's an hypothesis for you: Humans need ambiguity and therefore prefer 'for'. ;-) More seriously, I think that at least in the old days iteration made it easy to estimate big O complexity. You have to think a lot harder with multiply recursive functions or mutual recursive sets of functions. I'm not sure whether that's important to newbies. Steve
- Follow-Ups:
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
- References:
- Re: [tlug] "Go Considered Harmful"
- From: Stephen J. Turnbull
- Re: [tlug] "Go Considered Harmful"
- From: Stephen J. Turnbull
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
- Re: [tlug] "Go Considered Harmful"
- From: Stephen J. Turnbull
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Fishing for USB linux suggestions
- Next by Date: [tlug] Cloudflare and deplatforming
- Previous by thread: Re: [tlug] "Go Considered Harmful"
- Next by thread: Re: [tlug] "Go Considered Harmful"
- Index(es):