Re: Promises vs Streams

2015-03-28 Thread Brendan Eich
Domenic Denicola wrote: Seeing as how I just produced a completely redundant message by failing to read the other responses before firing off my own, let me try to redeem myself with some more-original content. (Nice post!) It’s also important to realize that streams are not the only

Promises vs Streams

2015-03-28 Thread Boopathi Rajaa
I feel this must have already been discussed but couldn't find any discussion threads, just trying to understand them better. The basic doubt is that I feel promises are more like streams, and that streams are much more powerful than promises. With a promise you have a value or an exception, and

RE: Promises vs Streams

2015-03-28 Thread Domenic Denicola
28, 2015 08:15 To: es-discuss@mozilla.org Subject: Promises vs Streams I feel this must have already been discussed but couldn't find any discussion threads, just trying to understand them better. The basic doubt is that I feel promises are more like streams, and that streams are much more

RE: Promises vs Streams

2015-03-28 Thread Domenic Denicola
Seeing as how I just produced a completely redundant message by failing to read the other responses before firing off my own, let me try to redeem myself with some more-original content. It’s also important to realize that streams are not the only asynchronous-plural primitive out there. My

Re: Promises vs Streams

2015-03-28 Thread Anne van Kesteren
On Sat, Mar 28, 2015 at 1:14 PM, Boopathi Rajaa legend.r...@gmail.com wrote: Why do we have both? Why do we have both values and arrays, not just the latter? -- https://annevankesteren.nl/ ___ es-discuss mailing list es-discuss@mozilla.org

Re: Promises vs Streams

2015-03-28 Thread Axel Rauschmayer
Synchronously, we have both normal (synchronous) function calls and iteration over a sequence of values (via `for-of` and iterators). It makes sense that we also should have two abstractions for asynchronous interaction. On 28 Mar 2015, at 13:14, Boopathi Rajaa legend.r...@gmail.com wrote:

Re: Promises vs Streams

2015-03-28 Thread joe
Maybe the confusion stems from how Promises were used in ES5? ES5 doesn't support generators, so people ended up adding a sort of psuedo-generator API to their promise APIs, but in reality the concepts solve different problems? FYI, python seems to use promises and event streams together in its