Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does chapel implement tail call optimisation?

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

like image 218
Russel Winder Avatar asked Jan 23 '26 20:01

Russel Winder


1 Answers

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]

like image 76
Brad Avatar answered Jan 25 '26 15:01

Brad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!