First crack at a Streams proposal

Sean Silva silvas at purdue.edu
Sat Apr 20 18:28:36 PDT 2013


On Sat, Apr 20, 2013 at 8:10 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:

> On Sat, Apr 20, 2013 at 4:13 PM, Sean Silva <silvas at purdue.edu> wrote:
> > On Sat, Apr 20, 2013 at 3:47 PM, Tab Atkins Jr. <jackalmage at gmail.com>
> > wrote:
> >> On Sat, Apr 20, 2013 at 9:19 AM, Isaac Schlueter <i at izs.me> wrote:
> >> > I'm not seeing what in this proposal can't be implemented in
> >> > JavaScript as it is today.  Is there an implementation of this
> >> > somewhere?  Are there any programs that use these streams?
> >>
> >> This is a fully-general counter-argument against literally everything
> >> that doesn't require new primitives, and so is useless as an actual
> >> argument.  It would damn Promises/Futures, Sets, Maps, and a number of
> >> other new things.
> >
> > I'm pretty sure there is no way to implement Maps with arbitrary keys in
> > current JS.
>
> It's possible, but lookup time is linear.  You need some variety of
> language support to get constant-time lookups.
>

For ADT's, the complexity of an operation needs to be considered as part of
the interface, since otherwise clients can't meaningfully use it. Every
line of code a programmer writes requires a (possibly subconscious)
evaluation of the complexity of the operation, and a factor of O(n)
difference in complexity is enough to invalidate most of that reasoning and
render the program broken. A linear lookup is equivalent to an incorrect
implementation of the interface of a Map.


> Now that I've got a handle on what I think a good design is, my plan
> is to retreat and spend some time studying and documenting existing
> stream patterns in libraries, to try and discover what I might be
> missing, or what areas I'm over/under-addressing.  When I'm done, I'll
> report back with my findings.
>
>
Cool. Please make sure to involve the primary developers of the most-used
FRP and event stream libraries in your initial prototyping and put your
work up on github.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130420/34221a1e/attachment-0001.html>


More information about the es-discuss mailing list