Hacker News new | past | comments | ask | show | jobs | submit login

Automatic TCO affects stack traces, which programs might rely on at runtime, requiring that browsers agree on what the right behavior should be; on the flip side, manual TCO (with annotations) would need to be a language feature.



This is the correct answer per the linked article.

In particular this is runtime inspectable via func.caller so it really is a behavioral language change to allow the elision of stack frames.


Safari supports proper tail calls per the ES6 spec. If your code relies on the non-elimination of tail calls it will not work in Safari, and thus not be Web compatible.


One could argue, that writing programs, which rely on the stack trace is a bad practice. Handling of exceptions should take care of unexpected situations. I don't know of any scenario, where a program needs its own stack trace, which could not be solved by making use of exception handling properly. Perhaps anyone can give an example?


> Automatic TCO affects stack traces, which programs might rely on at runtime, requiring that browsers agree on what the right behavior should be;

Browsers don't have a say in this. They're making the decision to not be compliant with the specification, so they effectively don't support ES6.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: