Java's newest JVM compatible language -- Scala -- is known for its functional style language approach, often leading to the heavy use of recursive algorithms. However, as the following post points out, the recursive algorithm nature of Scala does not bode well with the underlying run-time in the form of Java's Virtual Machie.
The Java Virtual Machine does not have support for tail-recursive algorithm optimizations. What does that mean? Basically the JVM cannot spot when to optimize calls stacks for recursive algorithms. Well who cares right? If you’re writing in Java this issue doesn’t usually come up since most of us simply write our loops and are happy with the performance the JVM offers us. However, when you are writing a lot of recursive algorithms you quickly start to see how tail-recursive algorithms help makes your code more efficient.
Read the complete post on 'Tail Recursive Algorithms in Scala' http://www.kungfuice.com/index.php/2008/09/18/tail-recursive-algorithms-in-scala/