chrisdunelm/DotNetAnywhere

What about tailcalls?

dsyme opened this issue · 4 comments

dsyme commented

The inevitable F# questions :)

  1. Are tailcalls supported?
  2. If not, is the tailcall prefix at least ignored? (The majority of F# code can still execute correctly when the tailcall prefix is ignored, though ideally it should be supported)

Thanks!

  1. Sadly not
  2. Probably not

This was all developed quite some time ago, so I can't exactly remember if I ever came across tailcalls.
But I only implemented exactly what was required to execute the things I tested it with, and I only ever used C# code during testing. I expect I never came across a tailcall at all, so I expect it's totally unhandled.

I don't anticipate developing this any further, so it will probably languish in this unloved tailcallless state forevermore...

dsyme commented

Ok, thanks for taking the time to close this out!

@dsyme Since closing this I've since discovered that this code lives on in Blazor, where there is a recent PR#7 to make tailcalls at least not crash the interpreter :)

ncave commented

@dsyme @chrisdunelm
I added some tail calls optimizations in a downstream repo, and also in the Blazor PR#7 that adds F# support. (Sorry for resurrecting this issue, I'll show myself out.)