5 ms·
As ES6 is becoming more available, how do current browsers handle this now? Do they reuse the stack frame?
by Tistron 9y ago
As ES6 is becoming more available, how do current browsers handle this now? Do they reuse the stack frame?
- amichal 9y agohttps://www.chromestatus.com/feature/5516876633341952 https://www.chromestatus.com/feature/5516876633341952
- soegaard 9y agoChrome has removed support for tail recursion (it was briefly enabled). Does anybody know if there are plans to reenable it? Or are they still lobbying for an explicit keyword approach?
- baron816 9y agoNo. Last I heard, they were trying to remove proper tail calls from the spec completely. Safari, I believe, is the only browser where it is currently implemented.
- goatlover 9y agoWhy? I recall when ES6 first came out, Crockford gave a talk on the good and bad of it. He hated that classes were brought into the language, but was super bullish on tail calls, saying it was the most important new feature.
- baron816 9y agoYou’re going to have to ask the Chrome and Firefox teams about that. I’m guessing there’s performance issues—perhaps every function invocation needs to check if it’s a proper tail call?
- krzkaczor 9y agoI made a babel plugin to do TCO in JS https://github.com/krzkaczor/babel-plugin-tailcall-optimization https://github.com/krzkaczor/babel-plugin-tailcall-optimizat...
- ryanpetrich 9y agoThanks for writing it! Reading the source was an easy intro to babel for me when I was writing a trampoline-based TCO plugin.