3
votes

Chapel supports recursive function calls, but does it support tail call optimisation so that tail recursion does not use an extra stack frame?

1
There is an issue tracking this feature request here: github.com/chapel-lang/chapel/issues/10821 - ben-albrecht

1 Answers

4
votes

I'm reasonably certain that the Chapel compiler does not implement tail recursion optimizations itself. Depending on the complexity of the function, it may be that the back-end compiler (C compiler or LLVM) would perform such optimizations on the generated code.

[Edit: This characterization is for versions 1.14 and earlier of the Chapel compiler]