Find limit of recursion: Difference between revisions

Added Quackery.
m (fix)
(Added Quackery.)
Line 2,471:
<lang python>1045
Fatal Python error: Cannot recover from stack overflow.</lang>
 
 
=={{header|Quackery}}==
 
When the direct approach
<lang Quackery>0 [ 1+ dup echo cr recurse ]</lang>
was still churning out digits after 13,000,000 (Quackery does not optimise tail end recursion) I decided on an indirect approach, by asking the equivalent question, "What is the largest nest that Quackery can create?" as each item on the Quackery return stack occupies two items in a nest (i.e. dynamic array).
<lang Quackery>' [ 1 ] [ dup size echo cr dup join again ]</lang>
On the first trial the process died with a segmentation error after reaching 2^30 items, and on the second trial the computer became very unresponsive at the same point, but made it to 2^31 items before I force-quit it.
 
In conclusion, the answer to the question "What depth of recursion does Quackery support?", at least in the case of Quackery running under Python 3.8.1 on a mid 2011 iMac with a 2.5 GHz Intel Core i5 and 12 GB of RAM and MacOS 10.13.6, is "sufficient".
 
I would anticipate at least equivalent results running under PyPy3, as it has much better garbage collection. (Also, it runs Quackery 20 to 30 times faster than the default version of Python 3, so would crash significantly sooner.)
 
 
 
=={{header|R}}==
1,462

edits