[Mono-list] Mono does not have tail calls?
kumpera at gmail.com
Fri Jan 30 22:38:47 EST 2009
Mono support tail calls just like .NET does. And as such, have a peculiar
set of constraints
where it doesn't work.
F# is a particularly bad case as we don't have implemented tail calls under
Try running with -O=-gshared, it should fix your issue.
But please fill a bug report on that, I'm sure Mark will be glad to take a
look at it. He's our tailcall fan ;)
On Fri, Jan 30, 2009 at 10:38 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> I had long since held the belief that Mono supports tail calls but when I
> recently came to actually test that I discovered that Mono does not, in
> have tail calls.
> Specifically, I ran the following simple test code:
> let even odd n = odd(n+1)
> let odd even n =
> printf "%d\n" n
> let (_: int) =
> let rec f n = even g n
> and g n = odd f n in
> f 0
> That runs fine in OCaml and F# on .NET but it leaks stack space until it
> on Mono because the tail calls are not handled properly.
> Dr Jon Harrop, Flying Frog Consultancy Ltd.
> Mono-list maillist - Mono-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list