r/ProgrammingLanguages • Futhark • Jan 20 '26

Why not tail recursion?

https://futhark-lang.org/blog/2026-01-20-why-not-tail-recursion.html
62 Upvotes

34 comments sorted by

View all comments

Show parent comment

2

u/jsshapiro Jan 22 '26

Because there's no need. The compiler can identify function calls in tail position with 100% accuracy, and can apply the tail recursion optimization (from an optimization perspective: stack frame reuse) in a lot more cases than you might think.