# Recursion and while loops: pros and cons

**URL:** <https://discourse.julialang.org/t/recursion-and-while-loops-pros-and-cons/106559>\
**Category:** General Usage\
**Tags:** loops, recursion\
**Created:** [November 22, 2023, 7:14am UTC](https://discourse.julialang.org/t/recursion-and-while-loops-pros-and-cons/106559 "2023-11-22T07:14:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [November 22, 2023, 7:56am UTC](https://discourse.julialang.org/t/recursion-and-while-loops-pros-and-cons/106559/2 "2023-11-22T07:56:53Z")

</div>

What you are looking for is _tail call elimination_ (also called as tail call optimization or tail recursion optimization). There have been a number of threads on the subject here, e.g. [this one](https://discourse.julialang.org/t/tail-call-recursion/87847). According to this discussion, “Julia doesn’t have tco currently, and is fairly unlikely to add it.” That being said, a macro is being considered [on Github](https://github.com/JuliaLang/julia/issues/4964#issuecomment-961932928).

---

_[View the full topic](https://discourse.julialang.org/t/recursion-and-while-loops-pros-and-cons/106559)._
