00:29:01  * shesekquit (Ping timeout: 264 seconds)
00:29:05  * execut3joined
01:04:57  * execut3changed nick to shesek
01:14:35  * kazuponjoined
01:37:36  * kazuponquit (Remote host closed the connection)
01:38:39  <jongleberry>if you want to use bluebird, go for it
01:38:41  * joshonthewebquit (Quit: Computer has gone to sleep.)
01:38:45  <jongleberry>but for me, not using promises is a feature
01:38:48  * kazupon_joined
01:38:54  <jongleberry>i hate promises and don't want to do anything except `yield` them
01:42:58  <jongleberry>the only thing promises can do that co can't is cancel
02:05:28  * jblzjoined
02:36:13  * Rudegjoined
02:40:29  * Rudegquit (Ping timeout: 240 seconds)
03:09:23  * jblzquit (Quit: leaving)
03:16:11  * joshonthewebjoined
03:19:23  * jblzjoined
03:22:06  * wilmoorejoined
03:24:09  * jblzquit (Client Quit)
03:39:30  * kazupon_quit (Remote host closed the connection)
03:41:34  * wilmoorequit (Ping timeout: 244 seconds)
03:54:40  * bmacquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:56:02  * wilmoorejoined
04:11:54  * kazuponjoined
04:54:41  * bmacjoined
04:59:15  * bmacquit (Client Quit)
05:04:26  * feelfinejoined
05:09:44  * bmacjoined
05:10:32  * bmacquit (Client Quit)
05:15:49  * bmacjoined
05:16:19  * bmacquit (Client Quit)
05:57:30  * feelfine_joined
06:00:46  * feelfinequit (Ping timeout: 265 seconds)
07:00:21  * rewm_joined
07:00:33  * rewm_quit (Client Quit)
07:03:13  * rewmquit (Ping timeout: 264 seconds)
07:13:23  * kazuponquit (Remote host closed the connection)
07:14:31  * kazuponjoined
07:22:39  * Rudegjoined
07:28:29  * Rudegquit (Ping timeout: 240 seconds)
07:41:43  * joshonthewebquit (Quit: Computer has gone to sleep.)
08:04:32  * feelfine_quit (Remote host closed the connection)
08:09:41  <EvanCarroll>jongleberry: how is that different though from just Promise.spawn().. I'm confused.. it's just a loop for the generator.
08:09:46  <EvanCarroll>Just don't use the other stuff if you don't want it.
08:10:16  <jongleberry>the problem is that you have to download the entire bluebird repo just to use it
08:10:20  * joshonthewebjoined
08:10:27  <jongleberry>and i don't know if it supports arrays, objects, thunks, etc.
08:10:45  <jongleberry>looking at the source code, it uses promises under the hood, which makes it even more confusing
08:11:56  <EvanCarroll>well, even if it didn't use the entirety of the bluebird code base, it would make explaining Koa easier if another library (Co) was not introduced into the equation.
08:12:05  * feelfinejoined
08:12:07  <EvanCarroll>It seems like everyone is/will be using bluebird.
08:12:13  <jongleberry>easier for you
08:12:18  <jongleberry>i'm not willing to use bluebird
08:12:37  <EvanCarroll>why would it matter if Promise.spawn did the same thing that co() does?
08:12:52  <jongleberry>as far as i know, promise.spawn does less than co()
08:13:15  <jongleberry>so no, it doesn't do the same thing
08:13:21  <jongleberry>unless bluebird writes better docs
08:13:57  <EvanCarroll>ah, so that's the answer to my question.. what does Promise.spawn not do...
08:14:00  <EvanCarroll>http://stackoverflow.com/q/22134167/124486
08:14:06  <jongleberry>i don't know
08:14:23  <jongleberry>i looked at the docs, all it says it does is support promises and arrays
08:14:37  <jongleberry>don't know about contexts, thunks, objects, or other generators
08:15:35  <EvanCarroll>ah. so that's the question then
08:15:40  <EvanCarroll>thanks. I'll look into it
08:16:40  <jongleberry>bluebird is going away though since promises are natively coming to v8 (though probably slower at first)
08:16:55  <jongleberry>and you don't need promises with generators
08:18:44  * kazupon_joined
08:19:43  <EvanCarroll>I don't see that happening. I imagine there will be think vineer that detects ES6 and extends on that functionality.
08:20:00  <EvanCarroll>Unless the promise spec is the entirety of bluebird.
08:20:07  <jongleberry>oh i have no idea
08:20:23  <jongleberry>promises are useless to me, though i wish lib authors started using promises now so i can yield them
08:20:25  * kazuponquit (Ping timeout: 240 seconds)
08:20:47  <EvanCarroll>why are they useless?
08:21:02  <jongleberry>because generators are better
08:21:49  <EvanCarroll>is there any docs that compare the two?
08:22:01  <jongleberry>i would if i knew anything about promises
08:22:11  <EvanCarroll>right, that's the position I'm in
08:22:12  <jongleberry>all those function initiations hurt my eyes
08:22:18  <EvanCarroll>so how do you know they're useless with generators
08:23:05  <jongleberry>there's no advantage of promises over generators except for cancelling
08:23:20  <jongleberry>though adding cancelling to generators wouldn't be very difficult
08:23:40  <jongleberry>but with promises, you have that terrible syntax
08:23:54  <jongleberry>and you have to require('bluebird') everywhere
08:33:41  * Rudegjoined
08:53:48  <EvanCarroll>what would this syntax do in co.. return [ yield a(yield b), yield c(yield d) ]
08:54:28  <EvanCarroll>I'm assuming it would run b and d in parallel and then a(b) and c(d) in parallel and return the results when both are complete.
08:54:40  <jongleberry>it would run none of them in parallel
08:56:24  <EvanCarroll>Why?
08:57:04  <jongleberry>to execute in parallel, you have to yield a [] or {}
08:57:11  * feelfinequit (Remote host closed the connection)
08:57:46  * feelfinejoined
08:58:04  <EvanCarroll>If a thunk is written to execute immediately you may acheive parallelism by simply yield-ing after the call. The following are equivalent since each call kicks off execution immediately:
08:58:08  <EvanCarroll>co(function *(){ var a = size('package.json'); var b = size('Readme.md'); var c = size('Makefile');
08:58:11  <EvanCarroll>return [yield a, yield b, yield c];
08:58:14  <EvanCarroll>})()
08:58:16  <EvanCarroll>Or:
08:58:19  <EvanCarroll>co(function *(){ var a = size('package.json'); var b = size('Readme.md'); var c = size('Makefile');
08:58:22  <EvanCarroll>return yield [a, b, c];
08:58:51  <jongleberry>that's because the underlying has already been executed when you do size()
08:59:02  <jongleberry>but that doc needs to be changed because that code creates race conditions
08:59:07  <jongleberry>underlying fn*
08:59:42  <EvanCarroll>I don't get this at all.
08:59:44  <EvanCarroll>I try so hard =(
09:00:15  <jongleberry>yeah generators are confusing
09:00:23  <jongleberry>and tehre's no good guide yet
09:00:25  <jongleberry>that i know of
09:00:28  <EvanCarroll>the docs clearly say return yield [a,b,c], is the same as return [yield a, yield b, yield c].. Why is that not possible? What am I missing?
09:00:40  <jongleberry>ignore the [yield a, yield b, yield c]
09:00:45  <jongleberry>just do yield [a, b, c]
09:00:50  <EvanCarroll>why, I don't understand what it would do
09:00:52  <EvanCarroll>and that's bothering me
09:01:03  <jongleberry>it doesn't work correctly
09:01:15  <jongleberry>that's what it does :D
09:01:45  <EvanCarroll>is that a bug in Co?
09:02:10  <jongleberry>bug in docs
09:02:12  <jongleberry>shouldn't be in there
09:02:37  * feelfinequit (Ping timeout: 264 seconds)
09:02:55  <jongleberry>or rather, it's incomplete
09:02:58  <jongleberry>https://github.com/visionmedia/co/blob/master/examples/parallel.js
09:03:04  <jongleberry>this is closer to what it's supposed to be
09:03:16  <EvanCarroll>so lets say you want to execute two complex functions in parallell and both of their arguments were themselves the results of complex functions? how would you do that, yielding two generators?
09:03:33  <jongleberry>[res1, res2] = yield [fn1, fn2]
09:03:54  <jongleberry>wait what
09:04:00  <EvanCarroll>here..
09:04:01  <EvanCarroll>http://pag.forbeslindesay.co.uk/#/26
09:04:02  <jongleberry>var res = yield fn1
09:04:09  <EvanCarroll>click the rarr a few times so you can read it.
09:04:23  <EvanCarroll>I don't think that slide author knew what he was talking about
09:04:30  <EvanCarroll>(go figre 99% of the shit I read is wrong, I don't know why I bother)
09:04:36  <EvanCarroll>how would you correct his wrongness.
09:04:39  <jongleberry>lol
09:04:45  <jongleberry>1. it can do parallel operation
09:04:57  <jongleberry>2. wtf does sharing and caching async operations have to do with anything
09:05:21  <EvanCarroll>bro, I'm just trying my ass off to figure these things out.
09:05:34  <EvanCarroll>That's the #1 google result for "promise and generators"
09:05:40  <EvanCarroll>lol
09:05:44  <jongleberry>sigh
09:05:57  <jongleberry>i know he doesn't like co because it doesn't return promises
09:05:59  <EvanCarroll>So how would we right that as an excercise in education, I'll write the author in a sec if you help me out
09:06:01  <jongleberry>but then i'm like... why does it need to
09:06:22  <EvanCarroll>you two should get in a room and fight it out, and then record it. And, then I'll learn from the debate.
09:06:31  <jongleberry>don't think i care enough
09:06:35  <EvanCarroll>Between the two of you, you can check the others bull shit and make my life easier!! =P
09:06:39  <jongleberry>it's more like he doesn't know enough about co
09:06:44  <jongleberry>and i don't care at all about promises
09:06:47  <jongleberry>so it won't go anywhere haha
09:06:47  <EvanCarroll>lol
09:06:52  * Rudegquit (Ping timeout: 265 seconds)
09:07:45  <EvanCarroll>so how do we fix his stuff.
09:08:04  <EvanCarroll>how would you run two JSON.parse(yield readFile(filename, 'utf8'))
09:08:30  <EvanCarroll>just move the yield readFile(filename, 'utf8') outside?
09:08:57  <EvanCarroll>var CACHE_THIS_FFS = yield readFile(filename, 'utf8'); yield [ JSON.parse(CACHE_THIS_FFS), JSON.parse(CACHE_THIS_FFS) ];
09:09:01  <EvanCarroll>Does that look win-ish?
09:09:23  <jongleberry>that won't work
09:09:40  <EvanCarroll>why?
09:09:45  <jongleberry>var files = yield [readFile(file1, 'utf8'), readFiel(file2, 'utf8')]
09:09:57  <jongleberry>files = files.map((x) -> JSON.parse(x))
09:09:58  <EvanCarroll>ah, assuming there are two files.
09:09:59  <EvanCarroll>sure.
09:10:12  <jongleberry>actually
09:10:48  <jongleberry>yield files.map((x)* -> return JSON.parse(yield readFile(x, 'utf8')))
09:10:52  <jongleberry>if you get my es6 notation
09:11:04  <jongleberry>oops no
09:11:04  <EvanCarroll>so if there are two files what do you do? You do a parallel read into a 'files' array, and then just yield [ JSON.parse(files[0]), JSON.parse(files[1]) ]; ?
09:11:25  <EvanCarroll>I'd rather see what --harmony can do now
09:11:30  <jongleberry>yield files.map( (filename) -> function* () {return JSON.parse(yield readFile(filename, 'utf8'))})
09:11:31  <jongleberry>lol
09:11:41  <jongleberry>nevermind stick to the first example i gave
09:11:51  <jongleberry>there are obviously a lot of ways to do it
09:12:08  <jongleberry>yeah i generally make each statement with a `yield` command as simple as possible
09:12:12  * feelfinejoined
09:12:31  <jongleberry>so `files = yield [readFile(file1), readFile(file2)]; files = files.map(...)`
09:12:52  <EvanCarroll>why files.map() and not another yield [] ?
09:13:02  <jongleberry>JSON.parse() is synchronous
09:13:18  <jongleberry>JSON.parse() is going on in that map
09:13:34  <EvanCarroll>right, but why won't that work in yield [] ?
09:13:50  <jongleberry>it's not a yieldable
09:14:48  <EvanCarroll>so only functions that take a cb(err,res) are yieldable?
09:15:06  <jongleberry>and then-promises, other co-generators
09:15:14  <jongleberry>and arrays/objects of those
09:15:53  <EvanCarroll>hrm.
09:16:30  <EvanCarroll>is there any ES6 syntax shortcuts in v8 nightly yet?
09:16:35  <EvanCarroll>or rather, node nightly.
09:16:39  <jongleberry>dunno
09:16:57  <EvanCarroll>so you were just trying to think of what the spec says
09:17:08  <jongleberry>what you mean?
09:17:13  <EvanCarroll>03:10 < jongleberry> if you get my es6 notation
09:17:17  <jongleberry>oh
09:17:20  <jongleberry>the (x) -> stuff
09:17:28  <jongleberry>well i guess that's coffeescript too...
09:18:24  <EvanCarroll>that's not yet in node --harmony, right?
09:18:32  <jongleberry>don't think so
09:18:52  <EvanCarroll>ok. my new years resolution was not to learn things not in existance.
09:19:15  <EvanCarroll>I blame Perl 6.
09:19:18  <jongleberry>lol
09:20:29  <EvanCarroll>So this is what you want... http://pastebin.com/nyrjBQZ8
09:20:34  <EvanCarroll>that's how it is supposed to look
09:20:49  <jongleberry>well return JSON.parse(x)
09:20:54  <jongleberry>files = files.map
09:21:05  <jongleberry>wait why is that in an array
09:21:39  <EvanCarroll>added explicit return, what else did i butcher
09:25:08  <EvanCarroll>?
09:25:32  <jongleberry>should be wrapped in a fn or something
09:25:33  <jongleberry>not an array
09:25:36  <jongleberry>going to sleep
09:25:36  <jongleberry>peace
09:25:49  <EvanCarroll>you've rapped everything yourself in an array....
09:25:53  <EvanCarroll>03:09 < jongleberry> var files = yield [readFile(file1, 'utf8'), readFiel(file2, 'utf8')]
09:26:05  <EvanCarroll>gah, see you tomorrow
09:42:33  * daviddiasjoined
10:05:07  * feelfinequit (Remote host closed the connection)
10:05:41  * feelfinejoined
10:10:14  * feelfinequit (Ping timeout: 252 seconds)
10:16:01  * navarujoined
10:18:35  * feelfinejoined
10:28:24  * wilmoorequit (Ping timeout: 252 seconds)
10:35:49  * kazupon_quit (Remote host closed the connection)
11:03:43  * Rudegjoined
11:42:12  * daviddiasquit (Ping timeout: 264 seconds)
12:03:17  * Rudegquit (Ping timeout: 265 seconds)
12:48:12  * daviddiasjoined
12:52:07  * feelfinequit (Remote host closed the connection)
12:52:36  * bmacjoined
13:11:01  * ramitosjoined
13:18:49  * navaruquit (Read error: Connection reset by peer)
13:18:55  * navarujoined
13:25:19  * bmacquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:36:32  * kazuponjoined
13:51:49  * katana_quit (Ping timeout: 245 seconds)
13:52:33  * katana_joined
13:56:13  * feelfinejoined
13:57:42  * calvinmetcalfjoined
13:59:13  * Rudegjoined
14:01:37  * b3tamaxjoined
14:05:51  * kazuponquit (Remote host closed the connection)
14:08:01  * bmacjoined
14:27:39  * kazuponjoined
14:29:56  * basicdaysjoined
14:38:59  * ramitosquit (Read error: Connection reset by peer)
14:41:07  * ramitosjoined
14:45:26  * jblzjoined
14:45:59  * whitbyjoined
14:47:36  * Rudegquit (Ping timeout: 264 seconds)
15:23:53  * Rudegjoined
15:24:01  * ramitosquit (Quit: Computer has gone to sleep.)
15:34:34  * Rudegquit (Ping timeout: 244 seconds)
16:35:58  * b3tamaxquit (Ping timeout: 240 seconds)
16:39:42  * kazuponquit (Remote host closed the connection)
16:43:19  * bmacquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
16:55:21  * wjb_joined
17:16:44  * bmacjoined
17:16:58  * ramitosjoined
17:34:03  <EvanCarroll>jongleberry: HALLO
17:38:44  * daviddia_joined
17:39:18  * daviddiasquit (Ping timeout: 240 seconds)
17:39:43  * daviddiasjoined
17:43:12  * daviddia_quit (Ping timeout: 240 seconds)
17:45:43  <EvanCarroll>jongleberry: I'd still like some clairification on the pastebin from last night
17:45:50  <EvanCarroll>http://pastebin.com/nyrjBQZ8
17:47:50  * joshonthewebquit (Quit: Computer has gone to sleep.)
17:56:10  * feelfinequit (Remote host closed the connection)
17:56:44  * feelfinejoined
17:57:33  * navaru_joined
17:58:24  * navaruquit (Ping timeout: 264 seconds)
18:00:58  * feelfinequit (Ping timeout: 240 seconds)
18:04:24  * subbyyyjoined
18:09:43  * ramitosquit (Quit: Textual IRC Client: www.textualapp.com)
18:10:21  <dlau>you can just return the map result ... the readFiles are parallel and the map is serial
18:10:27  <dlau>http://pastebin.com/FW8QsWm3
18:11:48  * navarujoined
18:11:59  * navaru_quit (Ping timeout: 240 seconds)
18:13:18  * navaru_joined
18:16:02  * navaruquit (Ping timeout: 252 seconds)
18:20:24  * daviddiasquit (Remote host closed the connection)
18:20:54  * daviddiasjoined
18:23:22  <EvanCarroll>haaha
18:23:26  <EvanCarroll>duh.
18:23:27  <EvanCarroll>thanks
18:23:33  <EvanCarroll>i did this last night at 3:25
18:23:47  <EvanCarroll>that's just me being stupid I thought I was still misunderstanding something about generators
18:24:13  <EvanCarroll>one other question dlau, is there any need to learn promises if yo're writing ES6 code? do generators do everything, and better?
18:25:17  <dlau>I dont thin kso
18:25:19  <dlau>w/ co
18:25:23  <dlau>you can use promises
18:25:25  <dlau>even thunks
18:25:26  <dlau>and yield them
18:25:58  <dlau>https://github.com/visionmedia/co look under 'yieldables'
18:27:33  <EvanCarroll>right, but I'm saying is there any advantage to ever writing my own promise?
18:28:09  <dlau>i dont think so, maybe if you need to break out of execution
18:36:44  * b3tamaxjoined
18:49:52  <EvanCarroll>does co-fs work with streams?
18:50:10  <EvanCarroll>ie, can you readFile().pipe()?
19:02:06  * whitbyquit (Quit: I go.)
19:37:11  * jongleberryquit (Remote host closed the connection)
19:37:21  * jongleberryjoined
20:05:55  * daviddia_joined
20:06:51  * daviddiasquit (Read error: Connection reset by peer)
20:22:59  * subbyyyquit (Ping timeout: 240 seconds)
20:46:19  * navaru_quit
20:46:47  * subbyyyjoined
20:52:36  * subbyyyquit (Quit: none 0.4.2)
20:55:47  * EvanCarrollquit (Read error: Operation timed out)
21:21:19  * wilmoorejoined
21:49:19  * wilmoorequit (Ping timeout: 245 seconds)
21:49:36  * whitbyjoined
21:51:24  * wilmoorejoined
22:02:39  * wilmoorequit (Ping timeout: 245 seconds)
22:06:51  * wilmoorejoined
22:22:40  * basicdaysquit (Quit: I'm out)
22:37:43  * b3tamaxquit (Ping timeout: 244 seconds)
22:52:14  * b3tamaxjoined
22:55:04  * joshonthewebjoined
23:14:39  * jblzquit (Quit: leaving)
23:20:28  * whitbyquit (Quit: I go.)
23:27:38  * wilmoorequit (Quit: wilmoore)
23:36:03  * calvinmetcalfquit (Quit: Connection closed for inactivity)
23:45:47  * joshonthewebquit (Quit: Computer has gone to sleep.)
23:47:52  * wilmoorejoined
23:49:16  * joshonthewebjoined
23:50:34  * b3tamaxquit (Ping timeout: 244 seconds)
23:56:50  * wjb_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:57:14  * daviddia_quit (Ping timeout: 245 seconds)