How do JVM functional languages implement recursion?


#1

How do Clojure, Scala, Kotlin, and the late Frege do recursion using the JVM? I have read that the JVM does not optimize tail recursion, or allow multiple recursion. I understand that multiple recursion and recursion where two or more functions call each other are fundamental to the functional programming idiom. If not please explain. If so, what compiler/language implementation strategies do functional languages designed to run on the JVM use to cope?


#2

This question is not about kotlin, so it is mostly off-topic. But still, I will try to unswer. Tail recursion is really needed only in purely functional languages like Haskel since they do not have loops and therefore are forced to implement loop-like behavior via recursion. I have worked on Java for many years and now I am working with Kotlin and I never had any need in tail recursion.
Still, there are people coming from functional background, who think that tail recursion is a pinnacle of evolution. I believe that kotlin DOES have tail recursion. Internally it just transforms the code into loop so it could be used in JVM.


#3

Yes, but it is only semi-offtopic. And if I asked on a Clojure or Scala list it would still be off topic.