Skip to content

Commit e187844

Browse files
authored
Merge pull request #3446 from Michael-S/no_tail_call_optimization_elimination
Add section on tail call optimization/elimination.
2 parents 9e8e24d + c700b4c commit e187844

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/Language/haskell-to-p6.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,20 @@ compare it to let/in and where constructs maybe?
537537
538538
TODO
539539
540+
=head1 Tail Call Optimization or Tail Call Elimination
541+
542+
Haskell and many other functional programming languages use tail call optimization, also
543+
sometimes called tail tall elimination, to remove the stack overhead of some types
544+
of recursive function calls.
545+
546+
There is nothing in the Raku language specification forbidding the implementation of this
547+
class of optimization, but no current implementation has it.
548+
549+
Please note that many Haskell looping constructs use recursive function calls. Haskell programs
550+
would encounter stack overflow errors more often without tail call optimization. The standard
551+
Raku looping constructs are not built on recursive function calls, which makes the feature
552+
less important.
553+
540554
=begin comment
541555
542556
### Guidelines for contributions:

0 commit comments

Comments
 (0)