Stack Space & Ackermann

Era Scarecrow via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 5 00:11:58 PST 2017


On Thursday, 5 January 2017 at 07:30:02 UTC, H. S. Teoh wrote:
> Nonetheless, even if you optimize said code paths, you still 
> won't be able to get any sane results for m>4 or anything 
> beyond the first few values for m=4. The Ackermann function is 
> *supposed* to be computationally intractible -- that's what it 
> was designed for. :-P

  Yeah I know. The function as written is as it was shown on the 
video and explained, and is badly formed. Memoize did give me 
real quick results up to 4,1; But it's obvious getting anything 
better is impossible as things stand.

  Still it did bring up how to handle needing larger stack spaces, 
which I've wondered about with wanting to make large structures 
on the stack so I wouldn't have to rely on actually allocating 
anything and not having to clean it up afterwards. Simpler, 
cleaner & faster memory management in my mind.


More information about the Digitalmars-d-learn mailing list