{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/1235","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/1235/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/1235/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/1235/events","html_url":"https://github.com/dotnet/roslyn/issues/1235","id":60916573,"number":1235,"title":"[Proposal] Support tail recursion","user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/1%20-%20Planning","name":"1 - Planning","color":"cccccc"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Feature%20Request","name":"Feature Request","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Tenet-Compatibility","name":"Tenet-Compatibility","color":"eb6420"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Tenet-Performance","name":"Tenet-Performance","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2015-03-12T22:02:38Z","updated_at":"2016-09-03T18:09:36Z","closed_at":null,"body":"For performance reasons, it would be very helpful if some method invocations were to generate tail calls, in which the caller's stack is discarded and replaced by the callee's stack. When the method is calling itself, the compiler can generate a jump to the start of the method.\r\n\r\nThere are a few ways one might designate that one desires tail calls in the generated code:\r\n\r\n1. The compiler could *always* generate tail calls when applicable.\r\n2. The compiler could generate tail calls when applicable in production builds but not debug builds. Equivalently, the compiler could recognize a command-line option (or project-wide option) that causes the generation of tail calls wherever possible.\r\n3. The language could provide a syntax for tail invocations.\r\n4. The compiler could recognize an attribute on the enclosing method and generate tail calls in the method's body wherever possible.\r\n\r\nThe advantages of a tail invocation is that it reduces the amount of stack used in a recursive call chain. That may improve performance due to improved memory locality. For some kinds of recursive code, it would allow the code to run with unbounded recursion; that makes it practical (without loss of performance) to replace loops with equivalent recursive code where the recursive code is more clear.\r\n\r\nThe disadvantages are that it makes debugging a bit harder, as stack frames with tail calls disappear from the call stack. Similarly they disappear from an exception stack trace. If the compiler does it automatically, this would be a behavioral change from previous releases, and would \"break\" any client that depends on the shape of the stack trace."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/244561489","html_url":"https://github.com/dotnet/roslyn/issues/1235#issuecomment-244561489","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/1235","id":244561489,"user":{"login":"orthoxerox","id":8640149,"avatar_url":"https://avatars.githubusercontent.com/u/8640149?v=3","gravatar_id":"","url":"https://api.github.com/users/orthoxerox","html_url":"https://github.com/orthoxerox","followers_url":"https://api.github.com/users/orthoxerox/followers","following_url":"https://api.github.com/users/orthoxerox/following{/other_user}","gists_url":"https://api.github.com/users/orthoxerox/gists{/gist_id}","starred_url":"https://api.github.com/users/orthoxerox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orthoxerox/subscriptions","organizations_url":"https://api.github.com/users/orthoxerox/orgs","repos_url":"https://api.github.com/users/orthoxerox/repos","events_url":"https://api.github.com/users/orthoxerox/events{/privacy}","received_events_url":"https://api.github.com/users/orthoxerox/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T18:09:36Z","updated_at":"2016-09-03T18:09:36Z","body":"@leppie No, these turned out to be extra opcodes that are there to break on the closing brace (https://blogs.msdn.microsoft.com/zelmalki/2008/12/11/why-are-these-nop-instructions-in-my-debug-build/)"}}
{"actor":{"display_login":"orthoxerox"}}