3 ms·
Safari has tail-call optimisation. We don’t have it elsewhere mostly because Google: 1. Agreed to implement it [it’s in ES6] 2. Implemented and shipped it be
by systoll 4y ago
Safari has tail-call optimisation.
We don’t have it elsewhere mostly because Google:
1. Agreed to implement it [it’s in ES6]
2. Implemented and shipped it behind a flag
3. Unshipped it.
4. Proposed something else [ https://github.com/tc39/proposal-ptc-syntax https://github.com/tc39/proposal-ptc-syntax ]
Prior to that, Firefox had proposed a carve out for cross-realm calls, but then they didn’t bother implementing anything.
While apple is against Syntactic tail calls, they’re mainly just opposed to versions of it that would remove/unrequire the tail-call optimisation they already do: https://github.com/tc39/ecma262/issues/535 https://github.com/tc39/ecma262/issues/535
For the version of it that is backwards compatible, they wouldn’t need to do anything other than ignore the syntax. Their main concern is that it "could add confusion with very little benefit."