I heard this somewhere: “You’re in an IVF clinic. It’s on fire and you enter a burning room. On a table is a large cooler with 5 thousand fertilized eggs, and there’s also a crying, injured five-year-old girl in the room. Which one do you save? You can only save one.” The answer for most people is obviously the 5 year old and it’s not a hard choice.
I thought Tail recursion just gets turned into an iterative loop by the compiler? Hence why you won’t get a stack overflow. And since in procedural languages you can just use a loop in place of a tail recursive function you would never run into this problem, right? At least this is how it was taught to me when I was learning about it in lisp.