Say I got a recursive function that is tail recursive. I wonder if this function will be implemented as recursion, growing on the stack, or will it be changed to a loop (since it is a tail-recursive function)?
I have just read that Scala detects such calls and optimizes it but is this a Scala-only thing or JVM in general?