Did you know that you can change the stack (recursion) limit?

In the implementation, it was (is) a useful fiction to assume
that memory is unlimited, because then the (implementation)
code can be a lot simpler.  Similarly, it was (is) a useful
fiction that there is no stack limit.  If F and G are c functions 
that implement the J verbs f and g, then to implement the 
monad f...@g then I can simply write F(G(y)) .  To do otherwise
requires extra mechanism, and to do otherwise is what is
required if you are talking about "unlimited" recursion.
I do not find tail recursion palatable because it does not
solve the problem of unlimited recursion.  I implemented Memo 
http://www.jsoftware.com/jwiki/Essays/Memo instead 
because it offered a more immediate and dramatic benefit.



----- Original Message -----
From: Dan Bron <[email protected]>
Date: Friday, December 18, 2009 13:02
Subject: Re: [Jprogramming] Tacit exercise
To: 'Programming forum' <[email protected]>

> Roger wrote:
> >  So do you stop using vectors in J because there is a
> >  limitation on the vector size?
> 
> The analogy does not hold water.
> 
> According to [1], the limit on vectors is imposed by my physical 
> hardware.  That is a fine and practical limit.   
> I have never hit
> it, and do not foresee hitting it.  Neither does it inhibit 
> my use of the language qua notation (e.g. [2]).
> 
> The limit on recursion is imposed by the language in which J is 
> implemented.  That is an artificial and arbitrary 
> limit.  I have hit
> it on several occasions, and I can foresee hitting it again 
> (indeed, it is this anxiety that we are discussing).  
> Furthermore, it
> inhibits my use of the language as a notation, simply because I 
> have hit it enough in practice to learn to exclude  
> $:  from my
> thought processes.
> 
> I am not unreasonable.  For example,  I do not avoid 
> trains simply because impractically long trains crash J 
> [3].  But I've been
> burned often enough by recursion that not only do I avoid it, 
> but I offer warnings about it.  
> 
> Now, it is possible that the changes in [3] have rendered this a 
> practical limit, and that my Pavlovian response was acquired before
> that improvement.  It would be nice to learn the question 
> is now academic; but I would need to be convinced.  
> Certainly I've seen
> recursion-related problems since then [4],  and not all of 
> them were mine [5,6].  
> 
> -Dan
> 
> [1]  http://www.jsoftware.com/help/dictionary/dx003.htm#1
> [2]  http://www.jsoftware.com/pipermail/chat/2009-
> December/002662.html 
> [3]  
> http://www.jsoftware.com/jwiki/System/Interpreter/Bugs#longtraincrash 
> [4]  
> http://www.jsoftware.com/jwiki/System/Interpreter/Bugs#tallstackcrash[5]  
> http://www.jsoftware.com/jwiki/System/Interpreter/Bugs06#head-421860e3461b80ec027da0587b858392bd462b26
> [6]  http://www.jsoftware.com/pipermail/general/2008-
> January/031400.html
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to