Comment
Comment by norir
It is simple to convert factorial to tail recursive form. In lua, which has tco:
You could replace impl with an imperative loop:
Personally, I find this ugly compared to the tail recursive solution. The loop version only seems more natural if you primarily think in loops. Tail recursion is strictly more powerful than looping since every imperative loop can trivially be converted to a tail recursive function, but the reverse is not true.