ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

Allow cross-realm tail calls to consume linear resources.

Open efaust opened this issue 8 years ago • 6 comments

efaust avatar Mar 30 '16 17:03 efaust

LGTM; it seems like we reached consensus on this at the March 2016 TC39 meeting on Tuesday.

littledan avatar Mar 30 '16 20:03 littledan

In more discussion within the TC39 meeting, we decided that this patch should be reworded to explicitly allow (and, non-normatively, prefer) proper tail calls. @allenwb

littledan avatar Apr 01 '16 15:04 littledan

I believe the current patch meets the requirements from TC39 that the wording should aim towards explicitly allowing (and phrasing as the default) proper tail calls.

In https://github.com/tc39/ecma262/issues/535 , @msaboff raised concerns about the web compatibility of making proper tail calls optional for the cross-realm case. Let's continue discussion of that on this thread.

littledan avatar Apr 13 '16 18:04 littledan

@littledan / @efaust I don't believe this text matches consensus because it is default-no-TCO-cross-realm. I think it would be preferable to have the default case be that cross-realm tail calls happen as this text reads like it's somehow desirable to not do tail calls. That said, I'm not entirely sure how to accomplish this without allowing an implementation to decide for any reason they can't do a tail call which kind of defeats the purpose here. Thoughts?

bterlson avatar Apr 18 '16 19:04 bterlson

We could make it like SetValueInBuffer, where the implementation decides whether it's a tail-calling or non-tail-calling cross-realm thing.

littledan avatar Apr 22 '16 02:04 littledan

At the TC39 meeting in May 2016, @msaboff clarified that he has no objection to this change. The PR seems to have changed the default.

littledan avatar May 24 '16 10:05 littledan