Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] "Go Considered Harmful"



On 2020-09-04 17:34 +0900 (Fri), Stephen J. Turnbull wrote:

> 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.

No, it's not obvious to me either. What's also not obvious is whether or
not it _could_ be true and, if so, whether or it there's something else in
the process of learning about accumulators and suchlike that developers
should learn early anyway.

> Note that "simple" is carrying a heavy load here.  In a language with
> side effects recursion suffers from the I = PLAY(0) problem.

Can you give an example?

> Here's an hypothesis for you: Humans need ambiguity and therefore
> prefer 'for'. ;-)

Well, yes, I do understand that. My hypothesis is that ambiguity is
desirable to many people because it makes it easier to pretend that their
code says and does what they hope it says and days, especially when they
don't have a very clear idea of what that is.

cjs
-- 
Curt J. Sampson      <cjs@example.com>      +81 90 7737 2974

To iterate is human, to recurse divine.
    - L Peter Deutsch


Home | Main Index | Thread Index