2. Any 2% of the market doesn't matter.
3. …
It was more that it forced the implementation to elide stack frames whenever calls occurred in tail position.
That’s a semantic change to program behaviour. And one that messed with the expectations of developers.
I would have been fine with some explicit syntax for invoking that behaviour, but it seems the standards process that got it approved never really consulted developers or implementors.
Do you know why the standard committee rejected adding explicit syntax for tail returns and instead went the route of declaring that all calls in tail position must lead to stack elision? I never really bothered to find out.
Also is spidermonkey now adding TCO to JS because of wasm, or are they adding TCO to wasm?
The only FP languages that require explicit syntax, target the JVM, which lacks the support.
Common tooling for production error tracking (e.g. Sentry) would be greatly affected by such a behavioural change.
Functional languages "just work" with those semantics because those expectations were set up ahead of time, and tooling and developer expectations were molded around them. But JS isn't one of those languages. The tooling and developer expectations, and gargantuan amounts of existing code, has been written with the expectation that calls create stack frames.
> The only FP languages that require explicit syntax, target the JVM, which lacks the support.
Support could be added to the JVM just the same as the JSVM though - via a spec change. And just as with the JSVMs, it would be a semantic change that would alter the behaviour of existing programs in ways that would break existing tooling and make developers lives worse. It's why both of them resist it.
The percentage of sites affected by automated stack tools is far less than the number of other sites that would benefit from tail calls.
More importantly, this breakage already happened 8 YEARS ago in Safari and 20% of all web users already break those expectations, so companies should have already adjusted. At this point, it only serves to split the web.
Now it is too late to save Firefox.
And apparently, the best way to reverse that situation is to ignore Mozilla (or any other player with single digit market share) at the W3C?
And do what instead? Side with Apple/Microsoft as long it hurts Google?
My impression is that this is less an issue with any particular implementor, and more with the feature not being fully thought through at the beginning. A lot of the browsers (including the Edge team at the time) ended up running into issues, on top of the UX/explanatory problems. That's why there was the alternative proposal for explicit tail calls, but those didn't go anywhere.