Find limit of recursion: Difference between revisions

→‎{{header|ALGOL 68}}: Not so silly a task. Think outside Algol68 or just reserve your judgement for the comment page and state as an opinion.
(→‎{{header|ALGOL 68}}: Not so silly a task. Think outside Algol68 or just reserve your judgement for the comment page and state as an opinion.)
Line 54:
 
=={{header|ALGOL 68}}==
This is a mind-bogglingly silly task. The depth of recursion in Algol 68 proper is unlimited. Particular implementations will reach a limit, if only through exhaustion of storage and/or address space and/or time before power failure. If not time limited, the depth reached depends very much on what the recursive routine needs to store on the stack, including local variables if any. The simplest recursive Algol68 program is:
<lang algol68>PROC recurse = VOID : recurse; recurse</lang>
For what it's worth this one-liner running under Algol68 Genie and 64-bit Linux reaches a depth of 3535 with the shell's default stack size of 8Mbytes and 28672 when set to 64Mbytes,
Anonymous user