Coming from imperative languages like Python, Javascript and Java, I was very often reading about function overhead and why to avoid map from a performance perspective. Obviously these are no functional languages and foreign concepts usually tend to be less optimised and less idiomatic. I understand that calling functions is pushing values from the registers back to the stack which is expensive.
So with the recent buzz about FP concept and languages I'm really wondering how does Haskell solve this Problem? Is it just that the compilers are inlining a whole lot? In addition to that how do FP-Languages (Clojure/ Scala) on the JVM solve this Problem? Not even having a decent Tail-Call optimisation tells quite a bit about JVMs capabilities in terms of optimising FP Code.
Thank you!