On Oct 19, 2011, at 10:11 AM, Kris Zyp wrote:
> The topic of single-frame continuations has been discussed here before, with
> the current state of ES.next moving towards generators that are based on and
> similar to Mozilla's JS1.7 implementation. Generators are a powerful addition
> to the language and welcome (at least by me). However, I believe that this
> still leaves a distinct gap in functionality that forces the majority use
> case for single-frame continuations to be handled by libraries. A language
> feature that OOTB must rely on libraries to fulfill the most wanted use cases
> seems like than ideal.
Yeah, batteries included languages such as Python win. We aspire to that.
But apart from your (or anyone else's) proposal, JS is not Python in particular
ways that make it hard to rush OOTB built-ins to do promises or deferred
functions on top.
First, Python has a protocol for breaking compatibility, and since
traditionally CPython was provisioned in single systems or server machine rooms
by sysadmins (built from source, even), sysadmins could update when ready. This
results in some versionitis pain for sure, but at least within an
administrative domain of authority, you could suit yourself.
On the web, there's no such firewalling at DNS source of authority boundaries.
You want your web content loaded by as many browsers as possible. So we don't
get many bites at the compatibility break apple. Browser vendors do not gain
market share by being first to break compatibility, they lose. The game theory
is perverse and merciless.
Second, TC39 sucks at library design. There, I said it. The right place to
solve complex, higher-level, better-batteries-included-with-solar-charger
problems is github.com. TC39 will make mistakes, and rushing will enshrine them
in standards we cannot back away from easily or at all (first point).
> I believe one could separate these single-frame continuations (or coroutines,
> looking at it from the perspective of the behavior of the function) into two
> categories.
Suggest avoiding "coroutines", as Simula or Lua coroutines that capture deep
continuations are not the same as generators. See my previous post.
Don't get me wrong: carry on, here and (better, because of user testing) on
github. But do not expect rushed standardization or "TC39 picks the winner up
front".
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss