Add tail call elimination to the C# compiler
Sometimes algorithms can be expressed far more elegantly in a tail-recursive form. The problem with that is the memory footprint, and possibly overflowing the stack. Though the 64bit JIT'er may sometimes decide to optimise the tail call, there are no guarantees, leaving you with no choice than to re-write the algorithm, avoiding tail calls. Having the compiler eliminate tail calls would let developers express algorithms in different ways, which may be more suited for the problem, while also helping developers who are not aware that their tail recursive algorithms may be problematic.
Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.
- The Visual Studio Team