Re: Stack Space & Ackermann

2017-01-06 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 05, 2017 at 08:11:58AM +, Era Scarecrow via Digitalmars-d-learn wrote: > 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 >

Re: Stack Space & Ackermann

2017-01-05 Thread Era Scarecrow via Digitalmars-d-learn
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 -- th

Re: Stack Space & Ackermann

2017-01-04 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 05, 2017 at 04:50:19AM +, Era Scarecrow via Digitalmars-d-learn wrote: > Well re-watched a video regarding the Ackermann function which is a > heavily recursive code which may or may not ever give a result in our > lifetimes. However relying on the power of memoize I quickly find

Re: Stack Space & Ackermann

2017-01-04 Thread Era Scarecrow via Digitalmars-d-learn
On Thursday, 5 January 2017 at 06:20:28 UTC, rikki cattermole wrote: foreach(i; 0 .. 6) No need for iota. I thought that particular slice/range was depreciated. Still the few k that are lost in the iota doesn't seem to make a difference when i run the code again.

Re: Stack Space & Ackermann

2017-01-04 Thread rikki cattermole via Digitalmars-d-learn
On 05/01/2017 7:03 PM, Era Scarecrow wrote: On Thursday, 5 January 2017 at 04:53:23 UTC, rikki cattermole wrote: Well, you could create a fiber[0]. Fibers allow you to set the stack size at runtime. [0] http://dlang.org/phobos/core_thread.html#.Fiber.this Well that certainly does seem to do

Re: Stack Space & Ackermann

2017-01-04 Thread Era Scarecrow via Digitalmars-d-learn
On Thursday, 5 January 2017 at 04:53:23 UTC, rikki cattermole wrote: Well, you could create a fiber[0]. Fibers allow you to set the stack size at runtime. [0] http://dlang.org/phobos/core_thread.html#.Fiber.this Well that certainly does seem to do the trick. Unfortunately I didn't get the n

Re: Stack Space & Ackermann

2017-01-04 Thread rikki cattermole via Digitalmars-d-learn
On 05/01/2017 5:50 PM, Era Scarecrow wrote: Well re-watched a video regarding the Ackermann function which is a heavily recursive code which may or may not ever give a result in our lifetimes. However relying on the power of memoize I quickly find that when the program dies (from 5 minutes or so

Stack Space & Ackermann

2017-01-04 Thread Era Scarecrow via Digitalmars-d-learn
Well re-watched a video regarding the Ackermann function which is a heavily recursive code which may or may not ever give a result in our lifetimes. However relying on the power of memoize I quickly find that when the program dies (from 5 minutes or so) nearly instantly (and only using 9Mb of