About recursion depth

It’s tail call optimization. See this post for a nice breakdown: What is Mojo's approach to tail call optimization? · modular/modular · Discussion #519 · GitHub

In the case where you have two recursive functions tail calll optimization can’t happen on the first call since TCO requires that the fn call be the last op in a function.

2 Likes