Hacker News new | ask | show | jobs
by QuadrupleA 1081 days ago
It's kind of silly IMHO. Recursion has plenty of "state", it's added on the stack before each function call. So under the hood it's all stateful. But instead of e.g. a nice simple counter variable, you've got an ever growing pile of stack frames - with hopefully some compiler shenanigans to eliminate them and convert it to a counter internally.
1 comments

Just as stateful language can perform tail call optimization, so can functional languages.