and I don't know about .NET 4.5, but .NET 4 was not
optimizing tail-calls on 64-bits Windows.
Actually there's a .tail CLI Opcode in .NET for tail call optimization which is not usually emitted, but the JIT does tail call optimization on 64 bits (not on 32 bits though). You can witness this when you have a C# getter calling itself. On 32 bits, you get a StackOverflowException, on 64 bits it keeps running happily forever. For the specifics: http://blogs.msdn.com/b/clrcodegeneration/archive/2009/05/11...
It's lower level and more limited than full blown FP aware TCO and it may not catch every call pattern, but it's been there for a while.
It's lower level and more limited than full blown FP aware TCO and it may not catch every call pattern, but it's been there for a while.