On Sep 29, 2014, at 1:13 PM, Mark S. Miller wrote:
> The issue is the asymptotic space consumption almost-contract. The reason I
> say "almost" is that conformance of an implementation is not testable.
> Currently, the spec says nothing about when an implementation might run out
> of storage.
>
> So we (at least I) mean normative only in the following sense: When someone
> writes an algorithm in ES6 using, say, bound functions in a loop, what claims
> may they validly make about the space complexity of their program? The
> specification should help answer such questions, sometimes.
>
> Note that I distinguish here between "the space complexity of their program"
> and the space usage growth when their program is run on an actual
> implementation. Again, conformance with any requirement on the latter is not
> testable.
>
So what would you like it to say that it doesn't already say?
Here is what it currently says:
14.6.3 Runtime Semantics: PrepareForTailCall ( )
The abstract operation PrepareForTailCall performs the following steps:
1 Let leafContext be the running execution context.
2 Suspend leafContext.
3 Pop leafContext from the execution context context stack. The
execution context now on the top of the stack becomes the running execution
context.
4 Assert: leafContext has no further use. It will never be activated as
the running execution context.
A tail position call must either release any transient internal resources
associated with the currently executing function execution context before
invoking the target function or reuse those resources in support of the
target function.
NOTE For example, a tail position call should only grow an implementation’s
activation record stack by the amount that the size of the target function’s
activation record exceeds the size of the calling function’s activation record.
If the target function’s activation record is smaller, then the total size of
the stack should decrease.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss