-
Notifications
You must be signed in to change notification settings - Fork 945
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
ES6 tail calls controversy #819
Comments
Let me correct your anonymous sources a bit:
At the moment, the feature is in the spec. Everyone quite simply will be building it, although there's the possibility that one or two implementors won't be able to performantly or quickly build to 100% compliance. There are indeed open questions about whether PTC will remain required by the spec, whether STC will be added, or both or neither. Until those questions are resolved, or until an implementor publicly declares that they're refusing to implement PTC, "the spec" is the arbiter of truth, and I believe there should be no differentiation on this feature from any other in the spec. |
^ GitHub won't let me heart @ljharb's comment so I'll just ❤️ it here. |
Cross-linking Node discussion about this nodejs/CTC#3 |
I've been corrected on a few parts of my post, so I wanted to qualify some points
To sum up, I'm saying that the compat table's goal should be to represent both the spec, and defacto web standards, but not to represent current controversy or debate. The table gets updated after every TC39 meeting with the results, and I think that should continue to be the case - there's no point in marking "people are arguing about this". |
For V8's part, although we've implemented tail calls, we're not shipping them at the moment. We've heard significant concerns from users about disruptions to development/debugging flows, but we have not heard strong demand from users for the feature. We are currently trying to gather more information about the size of the impact on users which we can use to determine whether we will ship PTC. I don't think any other major browser has a PTC implementation ready to ship at this moment, so I think @ljharb's prediction is a bit premature. At the last TC39, my impression was that there was very broad support for simply removing the PTC feature, though it did not achieve consensus at that meeting. PTC is one of the few parts of the spec represented in the Kangax table that seems like it could possibly change. ("no assignments allowed in for-in head" is another, see tc39/ecma262#260.) I don't know whether this compat table should represent things under discussion with an asterisk; a compat suite that I spend more time with, test262, does not bring active discussions into scope until they are at least at Stage 3 at TC39. I don't have an opinion about whether it should be in scope for Kangax to represent. |
@littledan I think the reason you're not seeing any demand from users is self-fulling. If they feel passionate about PTC they already use a different language to compile to JS (or a native platform). That's the people we want to join us. The only people currently affected are people that already use JS so you'll only hear from that group's minor inconvenience. |
I wonder why is issue wasn't raised while choosing features for the spec. |
@YurySolovyov the process for changes to the language for > ES6 is quite different than <= ES6. |
I also get a bit frustrated that discussion is on how to remove it from spec (or refuse to implement it in some other way), rather than how to actually implement it. |
|
That's roughly 1.99/4, if you count WebKit Nightlies as shipped. |
@kangax - are the direct and mutual recursion tooltips the official benchmark for whether a platform supports PTC? I've been looking forward to this for some time now to improve my FP code but AFAICT Safari 10 is still falling over on these, some manual tests I've done and this old post. Am I missing something? |
I think we shouldn't change anything in the table. PTC is in the spec and it's a significant feature of ES6. |
By my opinion, we should remove it only if and when it will be removed from the next versions of ES. |
@chicoxyzzy I see. I mean we should remove it from the table if it will be removed from the spec, otherwise - leave it as is without any comments. It's not decided and now it can confuse someone. |
So I think we can close this because most of us agreed on keeping things unchanged. All other discussions such as removing PTC from spec, STC and difficulties of implementation are out of scope of this repo. |
link for apple's response was broken, here's the correct link: |
@finetype thank you. Updated my comment |
In past half year it seems still no consensus of PTC vs STC, and only webkit/safari implement PTC. I suggest to reopen this issue. And I think we can just add a flag comment refer to this issue. |
It would be fine to add a note, but I'm not sure I see the value in it. |
If users rely on this table to guide web development, understanding that it references what they will eventually be able to use and what browsers are converging on, a note could help clarify that we see no particular movement towards other browsers supporting PTC. OTOH maybe that's already apparent from the table's contents. |
The arguments against implementing proper tails calls are astoundingly weak. I have to rely on Node 6 to run the asynchronous arrow code I write. This is plainly pathetic. The compat-table is doing the right thing: showing vendors who refuse to follow spec. |
It's very disappointing that a group of ppl brought up a spec (ES6) everyone was happy with but some of them are "having no plan" to implement it (silently). |
@gynet that should tell you that everyone wasn’t happy with it. The pre-es6 process left a lot to be desired, I’m afraid. |
It seems like it is implementable, but it may have a slightly worse DX in case of tail call, but I think someone form Apple did some statistics and not that many read-world calls are in tail position so DX damage is probably overrated. |
If that’s the case (that it’s rare), then implicit tail calls might not have been sufficiently motivated. |
On the contrary, logically, it could be possible because es6 PTC does not get implemented by v8, ppl are not able to add code have too much TCs. |
|
Certain anonymous sources tell me that basically all web browsers except Safari hate es6 tail calls because they slow the rest of JS down and that folks on TC39 also absolutely hate tail calls as well.
Apparently, Chrome engineers also feel that one of the things keeping the pressure on implementing tail calls is our compatibility table.
In light of all of this, I'm asked to consider to modify the tail call entry in a table to have an asterisk saying that there isn’t a lot of support for the feature or that it's controversial or something along those lines.
I'm bringing it up here to see what ya'll think and if we can come to some kind of consensus.
/cc @ljharb @sebmarkbage
The text was updated successfully, but these errors were encountered: