-
Notifications
You must be signed in to change notification settings - Fork 8
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
Is it web-compatible to revisit proper tail calls? #3
Comments
in tc39/ecma262#535 (comment) , @msaboff mentioned that, if PTC were optional (and not prohibited), then some browsers may ship it, causing some users to depend on it, and therefore causing compatibility issues. My response would be that ES5 also had this problem; it also permits implicit proper tail calls. However, they were not shipped in any mainstream implementation, and no compatibility issue arose. There are all sorts of optimization-based potential incompatibilities which could arise (e.g., a website becomes too janky or uses too much memory to be usable in one browser, but not another), and it's not clear to me why this one should be a concern of TC39 and not others (beyond the programming model benefits that some sort of guaranteed proper tail calls brings). |
Using our typical heuristic of web compatibility (which is based on code currently being run by browsers today) a change here is certainly web compatible as web code does not depend on PTC to function. That may change in the future if implementations choose to ship PTC, however, but from what I've seen we do not make such assumptions when considering alternatives before us now. |
While I think "We think it should be a goal of the standard's evolution to avoid knowingly breaking existing standards-based code." in tc39/ecma262#535 (comment) would be nice to have - the ES spec has often knowingly broke existing standards-based code, as long as it didn't break actual code on the web. In other words, for better or worse, the metric has consistently been that breaking "web code" matters, not breaking "existing standards-based code".
|
I would prefer that we keep the discussion on one thread. Splitting this into multiple threads makes it difficult to track the arguments being made especially with cross thread links. |
The only benefit I see from PTC is better transpiration by using trampolines. The current spec already includes implicit tail calls. And I prefer that solution in almost all ways. |
@msaboff started a discussion at tc39/ecma262#535 of whether it would be too late and/or bad for compatibility to revisit implicit proper tail calls. As that pertains to the proposal in this repository, rather than anything in the main ecma262 repository, let's have the discussion here. See that thread for discussion so far, but to summarize the arguments:
Too late to revisit implicit proper tail calls
Not too late to revisit implicit proper tail calls
The text was updated successfully, but these errors were encountered: