4 ms·
People interested in how tail call elimination is performed by the compilers of other languages may be interested in a post I wrote on the F# team blog some tim
by kvb 14y ago
People interested in how tail call elimination is performed by the compilers of other languages may be interested in a post I wrote on the F# team blog some time ago: http://blogs.msdn.com/b/fsharpteam/archive/2011/07/08/tail-calls-in-fsharp.aspx http://blogs.msdn.com/b/fsharpteam/archive/2011/07/08/tail-c....
- sdevlin 14y agoNice article. This makes me wonder if Visual Studio's F# mode could help detect common errors, e.g. highlight recursive calls not made in tail position. On the other hand, this could get annoying as such calls are often not a real problem in practice.
- kvb 14y agoIt would be possible to do this, but as you note it would potentially be annoying in practice. "tailcall" is a reserved (but unused) word in F#, so the compiler could be extended to issue an error if the user prefixed a non-tail call with that word. This "opt in" approach would presumably be less invasive while allowing people to indicate cases where the semantics are actually important to them. Having said that, as far as I'm aware there are no current plans to implement such a feature (and I haven't seen users clamoring for it, either).