chrisdunelm / DotNetAnywhere

Small .NET interpreter
MIT License
549 stars 77 forks source link

What about tailcalls? #8

Closed dsyme closed 7 years ago

dsyme commented 8 years ago

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!

chrisdunelm commented 8 years ago
  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 7 years ago

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

chrisdunelm commented 7 years ago

@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 6 years ago

@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.)