Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: no tail call optimisation #15304

Closed
ghost opened this issue Apr 14, 2016 · 1 comment
Closed

cmd/compile: no tail call optimisation #15304

ghost opened this issue Apr 14, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 14, 2016

http://play.golang.org/p/CPSqcLkE5K

This wouldn't crash if gc had tail call optimisation.

@ghost ghost changed the title gc no tail call optimisation gc: no tail call optimisation Apr 14, 2016
@ghost ghost changed the title gc: no tail call optimisation cmd/compile: no tail call optimisation Apr 14, 2016
@bradfitz
Copy link
Contributor

Correct. Go does not do tail call optimization. It has been discussed in the past. It would hide stack frames useful in debugging. One early proposal was to make it explicit and make users call tail called functions with a keyword like "become". Somebody else in a different language once proposed "goto" as the keyword.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants