[Haskell-cafe] Haskell on JVM

John Meacham john at repetae.net
Fri Jun 26 18:20:39 EDT 2009


On Fri, Jun 26, 2009 at 03:26:34PM +0200, Maarten Hazewinkel wrote:
>
> On 26 Jun 2009, at 14:09, Timo B. Hübel wrote:
>
>> And here comes my question: If there is anybody with proper knowledge 
>> about
>> this issue, I would really like to know what are those things that are
>> missing? For example, Clojure lacks proper tail recrusion optimization 
>> due to
>> some missing functionality in the JVM. But does anybody know the  
>> details?
>
> Basically, the JVM lacks a native ability to do tail calls. It does not 
> have an
> instruction to remove/replace a stack frame without executing an actual 
> return
> to the calling method/function.
>
> With the heavy use of recursion in functional programs, this is an  
> important
> feature in a language implementation to avoid stack overflows.

This is part of the reason I think jhc might be a good haskell compiler
for the jvm, it requires no special tail call support of its back end.
It translates all recursion into explicit code flow operations. (even
complex things, like co-recursive functions and join points)

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the Haskell-Cafe mailing list