Please see this article for a detailed explanation on tail-recursion and the support in ATS for turning tail-recursive calls into local jumps.