[00:08] emyller has joined the channel [00:44] Connorhd has joined the channel [00:45] hassox_ has joined the channel [00:50] alan1 has joined the channel [01:02] Biscuits: Hmmm, yay, playing with Parser combinators is nice :D [01:06] inimino: :) [01:10] isaacs_ has joined the channel [01:26] sudoer has joined the channel [01:34] Biscuits: Yay, simple parser combinators that are interriptible on any character :p [01:34] Biscuits: You can even feed it data in pieces [01:40] jed has joined the channel [01:45] LordMetroid: Anyone who had experience using Node.js with CouchDB? [01:53] aguynamedben has joined the channel [01:54] inimino: Biscuits: got some code to show? :-) [01:55] Biscuits: What's a nice pastebin ? [01:56] Biscuits: nvm [01:56] Biscuits: http://pastebin.com/m686ad498 [01:56] Biscuits: It's work in progress though [01:56] Biscuits: but seems to do a pretty nice job [01:57] Biscuits: I'm concerned about the memory usage though [01:57] inimino: in a meeting right now but will read it after [01:57] Biscuits: Let me know what you think :) [02:03] elliottcable: ARGH [02:03] elliottcable: ARGHGHGHGHG [02:03] elliottcable: http://gist.github.com/245217 [02:04] elliottcable: I wonder if I could convince ryah_away to move away from asciidoc [02:04] Biscuits: asciidoc ? [02:04] ashb: thats more a problem with docbook than asciidoc isn't it? [02:04] inimino: what's asciidoc? [02:05] inimino: I guess I should have looked at the paste before asking [02:05] elliottcable: the node documentation is generated with it [02:05] inimino: looks like a docbook problem to me [02:06] elliottcable: ACTION shrugs [02:06] elliottcable: I have no idea what either is, beyond that ‘they make the Node.js documentatiuon’ [02:06] Biscuits: Don't suppose there's a quick way to array comparison in JS ? [02:06] Biscuits: Trying to keep my parser library thing compatible with both arrays and strings [02:06] elliottcable: so I suppose I meant, drop ‘wahtever bit isn’t working consistently’ [02:06] Biscuits: but == only works on string [02:06] elliottcable: shouldn’t need internet access to build Node /-: [02:07] ashb: ["a"] == "a" [02:07] ashb: true [02:07] ashb: == will stringify (or call valueOf) in some cases [02:07] elliottcable: hence why I studiously avoid it [02:07] elliottcable: lol [02:08] elliottcable: why the poop is this requiring an external network object [02:08] elliottcable: v.v [02:08] ashb: tweak the build scripts to not run the doc commands [02:09] elliottcable: uh [02:09] elliottcable: I could build node without the documentation [02:09] elliottcable: that’s my point, I want the documentation [02:09] ashb: tough :) [02:09] ashb: read the plain text version [02:09] elliottcable: I *have* node, I *want* the documentation. [02:09] elliottcable: your response is unsatisfactory. [02:10] ashb: the fix it. thems the choices [02:10] elliottcable: would if I could [02:11] inimino: Biscuits: function arrEq(a,b){if(a.length!=b.length) return false; etc} [02:13] Biscuits: Hmm, manual way it is then [02:22] kriskowal has joined the channel [02:37] inimino: ACTION looks [02:37] elliottcable: wat [02:38] inimino: at Biscuits' code [02:39] Biscuits: Probably not very efficient [02:39] Biscuits: but it seems to get the job done on small things [02:39] sudocarl: Biscuits, what exactly does it do? [02:40] Biscuits: sudocarl: Parser combinators library :) [02:40] Biscuits: Parses data [02:40] sudocarl: ah [02:40] Biscuits: e.g. to parse a list of words into an array [02:40] Biscuits: var parseDigit=new SatisfyParser(function(chr) { return (chr>='0' && chr<='9') }).f(function(c) { return c-'0'; }); [02:40] Biscuits: var parseAlpha=new SatisfyParser(function(chr) { return ((chr>='a' && chr<='z')||(chr>='A' && chr<='Z')); }); [02:40] Biscuits: var parseAlNum=parseDigit.or(parseAlpha); [02:40] Biscuits: var parseWord=parseAlNum.some().f(function(l) { return l.reduce(function(a,b) { return a+b; },""); }); [02:40] Biscuits: var parseWhitespace=new SatisfyParser(function(chr) { return (chr==' ' || chr=='\n' || chr=='\r' || chr=='\t'); }).some().f(function(x) { return x.length; }); [02:40] Biscuits: var parseListOfWords=parseWord.list(parseWhitespace).eof(); [02:40] sudocarl: ohhh sweet [02:40] Biscuits: err [02:41] inimino: Biscuits: your arrayFlatten can be made more efficient [02:41] Biscuits: That code was a bit more than I expected [02:41] Biscuits: inimino: Exactly why I made it a function, I had a suspicion it could be ;) [02:41] inimino: return Array.prototype.concat.apply([],a) [02:41] inimino: or something to that effect [02:42] elliottcable: hahah inimino [02:42] inimino: elliottcable: yes? [02:43] Biscuits: inimino: So any other suggestions ? [02:44] inimino: haven't read further yet :) [02:44] inimino: what's line 8 about? [02:45] elliottcable: var probe = require('probe').probe; probe(acquire, ‘acquire’); probe(acquire.absolute, 'acquire.absolute'); [02:45] elliottcable: woo [02:45] Biscuits: Just my general Class definition [02:45] elliottcable: works great [02:45] elliottcable: github.com/elliottcable/probe [02:45] elliottcable: a bit more verbose alternative to sys.puts(sys.inspect()) [02:45] elliottcable: for anybody who wants it [02:45] malkomalko has joined the channel [02:45] inimino: Biscuits: if it's intended to be called with 'new', the return value is not used [02:45] inimino: (and *ahem* JavaScript has no classes) [02:45] Biscuits: I always return this; from any class constructor, so I know it's a class constructor :) [02:45] inimino: (which it's not ;-) [02:46] inimino: elliottcable: probe? [02:46] sudocarl: Biscuits, do you have a bit of a more outlined use of your library? [02:46] elliottcable: inimino: yep [02:46] sudocarl: like a demo file? [02:46] inimino: oh, I see [02:46] inimino: ACTION will look at that too [02:47] Biscuits: inimino: function f() { return {toString:function() { return "should never see this";}}; }; sys.debug(new f()); [02:47] Biscuits: inimino: try that, in my v8 console it actually returns that object returned by return :p [02:48] Biscuits: sudocarl: It's for creating quick parsers for strings [02:49] inimino: Biscuits: actually, if you return something, it seems to be used [02:50] inimino: (but that doesn't mean you should do that) [02:51] Biscuits: Hmmm, well, I don't see a downside to it, and it safely implies how the function should be used :/ [02:52] inimino: well, I don't think it's intuitive to JavaScript programmers [02:52] inimino: I don't recall ever seeing it anyway [02:53] Biscuits: hmmm fss, just trying it on some larger strings [02:53] Biscuits: takes ages to complete :( [02:53] sudocarl: Biscuits, did you consider doing a recursive-descent parser instead? [02:53] sudocarl: or maybe that wouldn't work... [02:53] sudocarl: hmm [02:53] inimino: 'new' does its own thing, it's not really the same as a normal function call [02:53] inimino: but the spec does say that if the function returns a value of type object, it should be used [02:53] sudocarl: wonder what the python parse library does [02:54] Biscuits: sudocarl: Might do once we hit that subject in the course I'm currently following on languages & compilers ;) [02:54] sudocarl: huh interesting I am in a similar course right now :) [02:54] inimino: this looks pretty recursive-descent-ish to me so far [02:55] inimino: is it not? [02:55] sudocarl: hmm I dunno [02:55] sudocarl: I think of recursive descent as a more structured system formed of mutally-recursive procedures [02:55] sudocarl: these each work alone [02:56] inimino: true [02:58] Biscuits: bah, on 2000+ characters it gets really slow :( [02:58] sudocarl: :( [02:58] inimino: Biscuits: anyway, looks interesting [02:58] inimino: yes, it's never going to be fast [02:59] Biscuits: Wish JavaScript was lazily evaluated like Haskell, bet that would speed it up some [02:59] sudocarl: Biscuits, you might want to look how "http://pyparsing.wikispaces.com/" is implemented... its a very very fast parser implemented in python which uses BNF as its declaration syntax [02:59] sudocarl: something like that would be amazing in JS [02:59] Biscuits: sudocarl: I believe someone already showed me a BNF->JS converter somewhere [02:59] sudocarl: really? I would like to see that [03:00] Biscuits: Look around in the logfiles [03:01] sudocarl: kk [03:01] inimino: probably me [03:01] inimino: though it was PEG not BNF [03:01] inimino: http://boshi.inimino.org/3box/PEG/build/demo.html [03:01] Biscuits: Ah, yeah, that one :) [03:02] Biscuits: Looks a whole lot like BNF though :/ [03:02] sudocarl: inimino, is that dynamic? [03:02] inimino: Biscuits: what would really speed it up is if JavaScript was compiled, and had a type system like Haskell, and a very smart compiler [03:02] inimino: the semantics are different from BNF but the syntax is similar [03:03] inimino: PEG is a more flexible and convenient formalism IMO [03:03] inimino: sudocarl: in what sense? [03:04] sudocarl: like can I change the grammer on the page and get it to recompile? [03:04] sudocarl: and reparse? [03:04] Biscuits: inimino: Is that code yours? if so, what kind of license is it ? [03:04] inimino: Biscuits: yes it's mine, as for the license I don't know, maybe MIT? [03:05] inimino: sudocarl: oh, no, sorry haven't added that yet [03:05] Biscuits: And did you run build_output to some kind of JS minimizer? or do you just code really dense ? [03:06] inimino: Biscuits: most of that code is the way I write it, and some of it is generated code [03:06] Biscuits: Ah, k [03:07] inimino: (you can tell the generated code because it has more whitespace ;-) [03:07] Biscuits: heh :p [03:07] sudoer has joined the channel [03:07] sudocarl: inimino, no worries :) [03:07] inimino: (actually the generated code is mostly the wall-of-text and the wall-of-numbers about halfway down) [03:08] inimino: also it has full Unicode support which that demo doesn't really demonstrate [03:08] inimino: (including characters outside the BMP) [03:09] Biscuits: Hmmm, downside to this is that it's not streaming like Node.js [03:10] Biscuits: hmm btw [03:10] Biscuits: LALR ECMAscript on google gives me: [03:10] Biscuits: http://jscc.jmksf.com/ [03:10] Biscuits: Seems rather promising [03:11] inimino: js/cc is more mature [03:12] inimino: and it's LALR(1) which is of course an entirely different kettle of fish [03:44] inimino: sudocarl: I made the input editable (but not the grammar) http://boshi.inimino.org/3box/PEG/build/demo.html [04:00] cloudhead has joined the channel [04:05] jed has joined the channel [04:13] aguynamedben has joined the channel [04:22] kriskowal_ has joined the channel [04:39] alan1 has joined the channel [04:55] sudoer has joined the channel [05:13] jtoy has joined the channel [05:18] hassox has joined the channel [05:19] atmos has joined the channel [05:26] isaacs has joined the channel [05:43] jtoy has joined the channel [05:46] voodootikigod has joined the channel [05:46] voodootikigod: !log [05:49] softdrink1 has joined the channel [05:57] jtoy has joined the channel [06:16] sprsquish has joined the channel [06:57] jed has joined the channel [07:25] isaacs has joined the channel [07:58] the_undefined has joined the channel [08:16] johan-s has joined the channel [08:39] sixtus42 has joined the channel [09:17] the_undefined has joined the channel [09:52] cmlenz has joined the channel [10:08] saikko has joined the channel [10:32] hassox has joined the channel [10:40] sixtus42_ has joined the channel [11:13] Biscuits has joined the channel [11:18] webben has joined the channel [11:29] rolfb has joined the channel [11:36] webben has joined the channel [11:51] sixtus42_ has joined the channel [11:55] sixtus42 has joined the channel [12:01] malkomalko has joined the channel [12:07] rakeshpai has joined the channel [12:32] olivvv has joined the channel [12:44] soveran has joined the channel [12:46] kendes has joined the channel [13:46] webben has joined the channel [13:50] mdg has joined the channel [14:07] voodootikigod_ has joined the channel [14:08] voodootikigod_: morning [14:20] jan____: mr tikigod [14:21] voodootikigod_: anyone know why the window.btoa function is not available in v8? [14:21] voodootikigod_: jan____: how goes it [14:23] jan____: voodootikigod_: trying to find a good coffee maker. [14:23] jan____: think I settled on the gaggia calssic [14:23] voodootikigod_: i see [14:23] jan____: classic [14:23] jan____: coworking needs coffee [14:23] voodootikigod_: tough decisions in life eh? [14:25] jan____: Don't get me started :) [14:26] voodootikigod_: hehe [14:26] voodootikigod_: i got basic auth support for http client working [14:26] voodootikigod_: and added a bunch of crypto to node [14:26] voodootikigod_: going to extrapolate out to a node_ext package [14:30] sudoer has joined the channel [14:33] ashb: voodootikigod_: the whole window object isn't available is why :) [14:33] voodootikigod_: but normally things like atob would be available in v8 [14:33] voodootikigod_: IE not normally a dom engine thing, more of a js thing [14:34] ashb: sure - its on the window object which means it comes from the browser, not the JS engine tho [14:45] jan____: voodootikigod_: cools [14:45] jan____: ashb: window is the global object in the browser [14:45] voodootikigod_: ashb: cool will just continue to use the javascript version [14:45] jan____: so window.foo could be a JS global or a browser global [14:46] ashb: jan____: yes. but odds are anything on it apart from Date, Array etc are from the browser not the JS engine [14:47] frodenius: every js coder should know the difference between js primordials and host objects [14:47] voodootikigod_: its all good [14:47] voodootikigod_: frodenius: but which lies where is a a case by case basis [14:47] voodootikigod_: frodenius: spidermonkey has atob [14:48] frodenius: well, not really, the things you can 100% rely on are the objects outlined in the language spec [14:49] dims has joined the channel [14:49] voodootikigod_: true, but then again the things outlined in the spec 1) arent fully implemented in v8 and 2) are in v8 but not in the spec ;) [14:49] frodenius: heh [14:50] voodootikigod_: anyways [14:50] voodootikigod_: for now i will just use my javascript crypto lib [14:50] voodootikigod_: and eventually move it down into the c level [14:50] voodootikigod_: where it properly belongs [14:51] sixtus42: voodootikigod: are you aware of http://github.com/waveto/node-crypto ? [14:51] voodootikigod_: was not [14:52] sixtus42: voodootikigod: same guy bringing tls to node [14:52] mediacoder: voodootikigod_: check out github...there is already a c node crypto lib [14:52] mediacoder: exactly [14:52] voodootikigod_: yea [14:52] voodootikigod_: excellent [14:52] mediacoder: he will add some more ciphers soon [14:53] voodootikigod_: any reason why base 64 was left out [14:53] voodootikigod_: not crypto [14:53] voodootikigod_: (at least not worht anything) [14:53] voodootikigod_: but necessary for basic auth [14:53] mediacoder: hmmm [14:53] mediacoder: should be there [14:54] mediacoder: atleast you can b64 encode encryptions [14:54] mediacoder: so guess "plain basse64" should be also there [14:57] voodootikigod_: hmmm [14:58] adam___ has joined the channel [14:58] voodootikigod_: can't seem to get the module to load [14:58] voodootikigod_: will play with it later [14:58] voodootikigod_: thanks for the pointer though [14:59] cloudhead has joined the channel [15:04] kendes has joined the channel [15:05] sixtus42_ has joined the channel [15:06] emyller has joined the channel [15:13] ryah: morning [15:15] Nailor: Evening :p [15:18] JoePeck has joined the channel [15:24] ryah: JoePeck: you're from rochester - cool [15:25] ryah: my favorite american city [15:28] Biscuits: ryah: Quick question, if your aim was to support multiple OSs, why did you make the IO stuff such a direct POSIX map ? I'm pretty sure Win32 has poor POSIX support :/ [15:29] ashb: it has equivalent functionality [15:30] ashb: in most cases [15:30] ashb: infact windows has working natvie overlapped (i.e. async) IO by all accounts [15:30] Biscuits: Hmm, CreateFile has that as far as I know [15:30] Biscuits: But I've also read that there's no real stat equivalent in win32 :/ [15:31] ryah: all of the posix stuff works on windows afaik [15:31] ashb: do do what? get file size or the other stuff? [15:31] ashb: file size there most certainly is [15:31] ryah: "posix" is not the best name though [15:31] ryah: maybe "fs" or "sys" or something would be better [15:32] ryah: i hate having all these modules. [15:32] ashb: fs is what commonJS went with [15:32] ryah: yeah? maybe i should hcange to that [15:33] ashb: well right now there is a fs-base which is low level non pretty api cos we couldn't decide on a nicer DWIMy form [15:33] Biscuits: Anyway, let's see if anything from Node.js wants to compile on win32 :p [15:33] ashb: Biscuits: good luck :) [15:33] ashb: i know for a fact it wont without some changes [15:33] ashb: dlopen etc at the very least [15:34] ryah: yeah, its going to take some work [15:34] ashb: also msvc or gcc (mingw)? [15:34] ryah: would like to do msvc [15:34] Biscuits: I'd prefer MSVC :/ [15:34] ashb: tho i guess node itself doesn't use any/much template stuff [15:35] ryah: since i guess thats what windows people use [15:35] ashb: depends who you are aiming at [15:35] ashb: if its just 'getting it running on Win for JS devs' then most wouldn't even want to compile it themeselves [15:35] ryah: Biscuits: getting it to compile in cygwin (is that what it's called?) probably will be easy [15:35] Biscuits: I'm pretty sure V8 on Windows compiles with MSVC [15:36] ryah: it does [15:36] ashb: cywgin/msys always feels like a bit of a cop-out to me. [15:37] ryah: yeah, need to compile for real at some point [15:37] ryah: but as a stop-gap it will work [15:43] Biscuits: hmm, udns seems to have a win32 port too [15:43] ryah: yeah - going to remove udns real soon [15:43] Biscuits: ? [15:44] ryah: well in the next two weeks [15:45] Biscuits: Why? and what's going to be the replacement ? [15:45] ashb: replacing it with? [15:46] ryah: replacing it with c-ares [15:46] ryah: because it doesn't do /etc/hosts resolutions [15:46] Biscuits: udns doesn't do hosts ? [15:47] ashb: does c-ares support windows hosts file (yes there is one somewhere)? [15:47] ryah: probably - it's a pretty heavy library [15:48] ryah: udns is a lot more elegant - but i really need /etc/hosts resolution [15:48] Biscuits: well, c-ares has proper win32 support, so that seems to be fine :) [15:50] CIA-28: node: 03jed 07master * ra9ea21f 10/ lib/http.js : fixed check on header type, to check member instead of object. - http://bit.ly/4JW04D [15:50] CIA-28: node: 03Rhys Jones 07master * r5b1a535 10/ (4 files in 3 dirs): Add HTTP client TLS support - http://bit.ly/5tcxBl [15:51] ryah: i can't wait to get back to germany and have some time to hack [15:52] JoePeck: ryah: you know Rochester? Did you go to school here? [15:53] JoePeck: ryah: also, nice presentation as jsconf. I'm a fan of the evented IO approach, and the presentation is a great resource I can use to show other people its advantages [15:53] ryah: JoePeck: i lived there for a long time. its great. where do you live? [15:54] JoePeck: ryah: Rochester New York. I actually live in East Rochester [15:54] ryah: JoePeck: do you know rocwiki? or ant hill cooperative? [15:54] JoePeck: ryah: I know rocwiki =) [15:54] ryah: i started that with some friends :) [15:55] JoePeck: haha, very cool =) [15:55] ryah: http://rocwiki.org/Wiki_Community/History :) [15:56] Biscuits: ryah: Just a quick question on the porting, why did you opt to put the dns module directly in Node.js ? why not just make it a seperate module ? [15:57] rakeshpai: How easy is to talk to say something written in C from JS in node? [15:57] voodootikigod_: !log [15:57] JoePeck: ryah: neat! [15:57] Biscuits: rakeshpai: If it's a console application: really easy [15:57] Wes-: holy smokes [15:58] ryah: Biscuits: i'm going to use it for, like, resolving hosts for tcp clients [15:58] rakeshpai: Biscuits: by using the available apis for stdin and stdout, you mean? [15:58] Wes-: Rochester is just across the lake and down the road 60 miles from here [15:58] Biscuits: rakeshpai: process.createChildProcess should do the trick. Just launches another application and pipes output and error to your own functions, and allows you to write stuff to it. [15:59] rakeshpai: Biscuits: cool... will investigate [15:59] Wes-: ryah: does c-ares do the whole nsswitch.conf thing? [15:59] ryah: Wes-: i don't know [16:00] Wes-: ryah: FWIW, that's pretty key around here, 'cause we also use ldap, nis+ and nis besides dns and files. But we're unusual. [16:00] Wes-: does it do resolution from primitives, or does it somehow wrap libresolv? [16:01] ryah: it reimplements the resolver [16:05] sztanpet has joined the channel [16:06] kendes has joined the channel [16:08] Biscuits: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#WIN32_PLATFORM_LIMITATIONS_AND_WORKA [16:08] Biscuits: Hmmm [16:10] ryah: i think libev support on windows is pretty good. [16:10] Biscuits: I'm beginning to wonder if it wouldn't be easier just to re-implement parts of Node.js for Win32 instead of porting it :/ [16:10] Biscuits: That's the libev doc that states otherwise :/ [16:10] Biscuits: directly from their CVS repos [16:10] ryah: no, it states that windows sucks [16:11] Biscuits: ah, ok [16:11] Biscuits: Yeah, sorry, think I slightly misread that :/ [16:12] ryah: marc lehmann hates windows but tries very hard to support it as much as possible [16:12] ryah: i think libeio is similar [16:12] Biscuits: I still wonder if a simple standard Win32 event/message loop, together with a simple message window and the Winsock built-in asynchronous, and the event-message-to-window stuff would be better on windows :/ [16:13] ryah: node is heavily tied to libev [16:13] Biscuits: I mean the whole map file descriptors to sockets so select can take em seems like a case of trying to get a certain model working on a totally different model... [16:14] ashb: libeio is files or sockets too? [16:14] Biscuits: I think libeio is for the files [16:14] ryah: yeah [16:14] ashb: windows has its own builtin async file IO calls [16:15] mikekelly: ryah: was that twitter message earlier a deliberate bright eyes reference? [16:15] ryah: mikekelly: embarrassingly, yes [16:15] mikekelly: haha, cool album :) [16:15] ryah: ashb: yeah - it would be cool if libeio compiled to aio on linux and windows aio on windows.. [16:16] ashb: yeah [16:16] ryah: and GCD (or whatever) on mac [16:16] ashb: GCD isn't for aio [16:16] ashb: its just a thread pool i thought? [16:17] ryah: well, maybe it's a better thread pool than libeio's? [16:18] ashb: probably yeah [16:31] nefD has joined the channel [16:32] emyller has joined the channel [16:42] Wes-: I don't know squat about libeio, but if you're going to do libaio on linux, you should do libaio everywhere that is POSIX / SUSv3 [16:42] Wes-: (which pretty much means everywhere but windows) [16:43] ryah: does mac support libaio? [16:43] ryah: afaik it doesn't [16:44] Wes-: ryah: Really? I didn't think you could get a SUSv3 stamp without aio.h [16:44] Wes-: Lemme dig [16:47] Wes-: Hmm, my Leopard box as an aio man page, says it scooped aio from FreeBSD3. Has aio_cancel, _error, _read, _return, _suspend, _write and lio_listio [16:47] Wes-: I'm not sure if that's enough for the POSIX AIO tag or not [16:50] Wes-: Yeah, aio_fsync man page is missing, but other than that, seems to be okay against my POSIX realtime extensions list for AIO. There *is* an aio_fsync in /usr/include/sys/aio.h, though. [16:52] Wes-: So, ryah, I'm pretty sure you can count on aio.h virtually everywhere meaningful but Windows. You might need to throw appropriate #defines to request appropriate levels of POSIX, though. [16:53] bentomas has joined the channel [16:54] Wes-: *educated guessing* - _POSIX_SOURCE and _POSIX_C_SOURCE=200112L [16:54] Wes-: May also want _XOPEN_SOURCE definitions for SVR4-derived unices, e.g. Solaris [16:55] Wes-: Latest _XOPEN_SOURCE=600, but 600 implies C99, which will generate compiler warnings or errors (depending on compiler and pedantry) with C++ source code [16:55] Wes-: 500 is probably enough for AIO [16:55] Wes-: alternatively you can sequester AIO code in C modules and build then as C99 with extern C linkage from your V8-using code [17:05] RayMorgan has joined the channel [17:05] johan-s has joined the channel [17:10] ryah: Wes-: ah, good to know [17:10] ryah: i wonder if aio just uses pthreads internally or if it has lower level hooks [17:11] Wes-: ryah: That's probably implementation-specific, however, I am fairly confident that at least on SVR4-descendents (e.g. Solaris) it is much lower level [17:11] Wes-: IIRC Oracle as of version 8 uses aio for low-level access when the backing store is a file system [17:12] Wes-: historically they have not been shy of poking deep into kernel, esp on primary platforms like sun [17:18] ryah: Wes-: http://lists.schmorp.de/pipermail/libev/2008q2/000335.html [17:20] Wes-: ryah: Wow, thanks for that! -- FWIW threads on Solaris would be solaris-threads, not posix-threads, so slightly cheaper, but they are still LWPs [17:21] emyller has joined the channel [17:29] aguynamedben has joined the channel [17:34] richtaur has joined the channel [18:11] isaacs has joined the channel [18:40] erikg has joined the channel [18:50] cruxst has joined the channel [18:50] isaacs: ryah: i'm curious, do you have a job? [19:03] orlandov: what's the difference between libeio and libev? [19:04] kriskowal has joined the channel [19:05] ashb: libev is generaly event framework (sockets, timeouts etc,) libeio is evented local file IO [19:05] ashb: at least thats my understanding [19:08] orlandov: ashb: that's what i thought, but aren't they both just file descriptors? [19:08] orlandov: or is there some more subtlety there [19:09] ashb: orlandov: you can't select on files typically [19:09] orlandov: o rly [19:09] orlandov: fair enough :) [19:09] ashb: or select doesn't return sensible values (yes you can always read or some sucgh) [19:09] orlandov: right, i always assumed it was the same but that figures [19:23] the_undefined_ has joined the channel [19:24] the_undefined_: wow 64 people [19:24] the_undefined_: is there a party tonight? [19:24] the_undefined_: I should get a beer, just in case :) [19:25] jan____: or a case of beer. [19:27] inimino: ryah: about setting HTTP headers, how about just having a response.headers object that you can modify at will until the first sendBody() call? [19:27] ashb: what does node do if you get an exception thrown after you've sent status/headers? [19:29] inimino: it just dies [19:29] ashb: any indication in the output stream? stderr? [19:29] ashb: (we'just just wondering what to spec for async for JSGI in this case) [19:29] inimino: ashb: if you don't catch it [19:29] inimino: yes, you should get a stack trace on stderr from v8 [19:30] ashb: anything sent to client? [19:30] inimino: nothing special, the server just gets killed [19:31] inimino: (so the client would see that the connection was closed but that's it) [19:32] ashb: k [19:32] nefD: hmm.. from everything i've seen so far, node would likely be pretty well suited for browser based games.. ..! [19:32] inimino: of course if somebody was writing JSGI support for node they could always wrap the request handler in try/catch and send a nice 500 page [19:32] inimino: nefD: sure! [19:33] ashb: inimino: not for the async promise version :) [19:33] nefD: I especially like that the client side code isn't really having to do anything special to interface with it.. standard jQ/proto/dojo ajax calls appear to be sufficient [19:33] inimino: ashb: oh [19:34] inimino: ACTION shifts perspective [19:34] deric_skibotn has joined the channel [19:35] inimino: ashb: well, s/wrap in try\/catch/install some global error handler of last resort, which probably isn't implemented yet/ [19:36] n8o has joined the channel [19:36] inimino: ashb: is the async JSGI stuff written up anywhere yet? [19:36] ashb: commonJS mailing list [19:37] ashb: there's an example, but it doesn't show a streaming case [19:37] inimino: ok, yeah I skimmed those emails [19:37] ashb: (yet, kriszyp is going to post a new example that does) [19:38] orlandov: ashb: are you talking about the jfgi draft proposal thread? [19:39] orlandov: oops.. jsgi [19:39] ashb: orlandov: yes and a chat we're having in another irc channel [19:39] orlandov: for this scgi server i hacked together i'm targetting a jsgi interface, and it'd be cool to see how that stuff should be handled (async input etc) [19:39] inimino: "JSGI Level 0/A Draft 2 Proposal on the wiki..." thread [19:40] orlandov: ya [19:49] Connorhd has joined the channel [19:53] rakeshpai has joined the channel [19:58] deric_skibotn has left the channel [20:00] Connorhd_ has joined the channel [20:02] sixtus42 has joined the channel [20:06] rakeshpai_ has joined the channel [20:06] path[l] has joined the channel [20:12] jed has joined the channel [20:15] sudocarl has joined the channel [20:15] sudocarl: morning everyone :) [20:16] path[l]: hello :), just watching the js conf video [20:17] sudocarl: cool :) [20:28] orlandov: is there a magic incantation to building the node_postgres c++ project? node-waf configure build [20:28] orlandov: throws up a bunch of errors [20:28] sudocarl: can you put your errors up? [20:28] sudocarl: make a gist or pastie? [20:28] orlandov: sudocarl: it's not finding the includes [20:28] orlandov: sec [20:28] sudocarl: did node install fine? [20:29] sudocarl: and are you using the latest version? [20:30] orlandov: newest as of friday i guess [20:30] sudocarl: kk [20:30] orlandov: from github [20:30] orlandov: http://pastebin.com/d6b370453 [20:31] sudocarl: huh weird [20:31] sudocarl: and your node installed fine? [20:31] sudocarl: can you run node? [20:31] orlandov: yep [20:31] orlandov: i am running waf-build like: ../node/tools/waf-light configure build [20:31] orlandov: not sure if that's correct [20:32] sudocarl: did you try to just run "node-waf configure build"? [20:32] orlandov: and i see a node dir in /usr/local/include [20:32] sudocarl: node-waf should be installed in your bin [20:32] orlandov: oh shit, it is too [20:32] orlandov: i'm retarded :P [20:32] sudocarl: :) [20:33] sudocarl: no worries hope it fixes the problem [20:33] orlandov: thanks man... [20:33] orlandov: yeah it compiles now [20:33] sudocarl: :D [20:33] voodootikigod_ has joined the channel [20:33] orlandov: yay id10t error :) [20:33] path[l]: lol [20:35] the_undefined_: got video file uploading from iPhone to node.js working, good stuff :) [20:39] quirkey has joined the channel [20:40] sudocarl: orlandov, just to let you know I had to make some minor changes to that module to get it to work: [20:40] sudocarl: http://github.com/carlsverre/node_postgres [20:40] sudocarl: incase your's doesn't work feel free to use mine [20:40] sudocarl: yours* [20:40] orlandov: sudocarl: cool, i was actually just using it to figure out how C++ extensions are structured [20:40] sudocarl: I will be putting a bunch of work into it hopefully later today [20:40] sudocarl: ohh :D sounds good [20:41] orlandov: rad! there could definately be better rdbms support in node :) [20:44] sudocarl: indeed [20:44] sudocarl: :) [20:44] okito has joined the channel [20:44] sudocarl: I am an idiot because I decided that since I love node so much I want to do a project which requires an rdbms on it... [20:44] sudocarl: oh well :) [20:44] sudocarl: gotta flex my c++ skillz sometime [20:44] sudocarl: (they are lacking) [20:44] orlandov: sudocarl: hah i totally hear ya [20:45] orlandov: why must i love things i can't have [20:45] sudocarl: haha [20:45] sudocarl: so far I have spent more time working on other node modules which my project needs than actually working on the project.... :( [20:45] orlandov: i'm trying to learn how reuse the node_net stuff do implement wire protocols in C++ [20:45] sudocarl: oh well :) [20:45] sudocarl: oh nifty [20:45] orlandov: but yeah, C++ is kind of a headfuck after 10 years of disuse [20:46] sudocarl: no kidding [20:46] sudocarl: I can't stand it [20:46] sudocarl: I script too much :) [20:46] ashb: could be worse - it could make heavy use of templates :) [20:46] sudocarl: haha [20:46] orlandov: yeah, same [20:46] orlandov: oh god [20:46] sudocarl: templates make me cry [20:46] sudocarl: I prefer brainfuck to c++ [20:46] sudocarl: http://en.wikipedia.org/wiki/Brainfuck [20:46] orlandov: see, i like my sanity [20:46] sudocarl: haha [20:48] the_undefined_: sudocarl: My approach with node has been to run a persistent pool of php/ruby/whatever processes and communicate with them over stdio for stuff node does not support yet [20:48] sudocarl: http://99-bottles-of-beer.net/language-c++-108.html versus: http://99-bottles-of-beer.net/language-brainfuck-101.html [20:48] sudocarl: its almost as bad :D [20:48] sudocarl: the_undefined_, thats not a bad idea :) [20:49] the_undefined_: it's not pretty, but it lets me write the APIs I want, make them look async and replace them with better stuff as it is being developed [20:49] the_undefined_: I think I should make that a general module [20:49] sudocarl: the_undefined_, but considering that node needs developers contributing to the core modules I don't mind spending my time working on the [20:49] sudocarl: them [20:49] sudocarl: the_undefined_, a module like that would be very nice though [20:50] the_undefined_: sudocarl: oh, I contribute lots of stuff too. But some things like writing a mysql connector is outside my abilities and time available so I work on stuff I can finish in reasonable amounts of time instead [20:50] the_undefined_: I really admire people like rhys who contributed the SSL stuff [20:50] sudocarl: the_undefined_, fair enough : [20:50] the_undefined_: tons of work [20:50] sudocarl: :) [20:50] sudocarl: no kidding [20:50] sudocarl: luckily ry has already put together a pretty good postgre connector [20:50] sudocarl: otherwise I would probably do what your doing [20:51] the_undefined_: hehe [20:51] the_undefined_: well I use MySql, so no love for me : ) [20:51] the_undefined_: MySql sucks, but postgres sucks harder [20:51] the_undefined_: ;) [20:51] orlandov: oh no you didn't! [20:52] the_undefined_: orlandov: AFAIK it has no support for full text search [20:52] sudocarl: really? [20:52] the_undefined_: which, yes, your RDBM shouldn't do - but man is it useful to not add something new to your stack when you need it [20:52] sudocarl: haha fair enough [20:52] the_undefined_: I could be wrong [20:52] ashb: the_undefined_: mysql isn't a database :P [20:52] path[l]: I have a question. Im watching the node.js video and Im confused about something. If I've built up a heavy session worth of data and then Im going to get stuff from a database and I want a callback, I have to send all my data to the callback to it can resume functioning with all that data. How does node perform when stuff like this happens [20:52] sudocarl: haha ashb [20:52] sudocarl: lulz [20:52] the_undefined_: I just talked to some people who use postgres in big enterprise stuff [20:53] ashb: sudocarl: its a nice fast key-value store, but it aint a database [20:53] the_undefined_: and they told me they were longing for mysql after a while even so its worse on paper :) [20:53] ashb: the_undefined_: did you tell them they are doing it wrong? [20:53] ashb: cos they really must be [20:53] sudocarl: path[l], so basically when you make a callback it can access any variables in the defining scope... [20:53] the_undefined_: well, doing it wrong can be tons of fun and exactly what you want in the beginning of building a system ... [20:53] cmlenz has joined the channel [20:53] sudocarl: so there is no copying it just continues execution as if it was executing directly in the scope [20:53] sudocarl: atleast I think thats what happens [20:54] path[l]: so where does all this get persisted? [20:54] path[l]: when the process exits [20:54] sudocarl: the process doesn't exit [20:54] sudocarl: node.js runs constantly [20:54] sudocarl: so data is persisted across requests [20:55] the_undefined_: ashb: anyway, they might have been idiots for all I know - so I'm not going to argue against postgres if smarter people are having a good time with it :) [20:55] ashb: the_undefined_: it certinaly works when it comes to things like VIEW etc. [20:55] sudocarl: the_undefined_, the thing I love about postgres is stored procedures... my company essentially has an entire game running in stored procedures which makes it insanely fast [20:55] ashb: and it has a non-brain dead query optimizier [20:55] sudocarl: we only ever transfer about 1 line of code to the DB [20:55] the_undefined_: sudocarl: I guess I hate stored procedures [20:56] sudocarl: and our php just acts like a middleman [20:56] sudocarl: the_undefined_, now thats a fair thing... half the people I talk to love them and the other half hate them [20:56] path[l]: hmm ok Im looking at the webserver example. I can service multiple requests, each of them might hit the db and it has a callback for each. Until the callback is called, all the data for each request gets persisted in memory then? [20:56] the_undefined_: I love the idea, but hate working with it [20:56] sudocarl: but if you want some serious DB speed I havn't seen anything like it [20:56] sudocarl: path[l], yes [20:56] sudocarl: the_undefined_, :D [20:57] the_undefined_: sudocarl: fair enough, but I see it as a way to optimize - not to design your apps upon [20:57] path[l]: so then I assume if you want to build a webserver with a loadbalancer you need some sticky sessions like thing? [20:57] the_undefined_: I will go crazy if I need to join a team working with a db full of stored procedures [20:57] the_undefined_: :) [20:57] path[l]: or no I guess not [20:57] path[l]: only the callback has to be on the same machine [20:57] sudocarl: path[l], yea... [20:58] sudocarl: path[l], I assume that it gets more complex as the app gets bigger but since node can act like a local cache and the callbacks will maintain the data i think it should be fine under a load balancer [20:58] orlandov: anyone know of other pedagogical explamples of writing Node extensions in C++? the postgres example ain't doing it for me [20:58] path[l]: hmm ok [20:58] sudocarl: the_undefined_, I think I would too... I am a flash guy not a sql guy :D [20:59] the_undefined_: sudocarl: flash, huh : ). What type of stuff do you work on / use node for? [20:59] sudocarl: games :) [20:59] the_undefined_: sudocarl: LINK :) [20:59] sudocarl: I work for a video game company called relevant games [20:59] sudocarl: http://www.saveourfrogs.com [20:59] the_undefined_: sudocarl: "We donate 100% of the money earned from advertising to charity" -> how do they pay you? [21:00] sudocarl: its not that great [21:00] sudocarl: :D [21:00] sudocarl: haha 1 sec [21:00] path[l]: hmm there's a node.js irc server too? [21:00] sudocarl: so basically we donate 100% of ADVERTISING profits [21:00] sudocarl: which comes out to be about... 10% of our profits [21:00] sudocarl: we do micropayments [21:01] sudocarl: I wasn't supposed to say that [21:01] sudocarl: but your not my target demographic [21:01] sudocarl: :D [21:01] mediacoder: say what? ;-) [21:01] sudocarl: nuttin :) [21:01] sudocarl: haha [21:01] sudocarl: eh its still better than what most companies do [21:01] path[l]: lol [21:02] sudocarl: funny enough our partner for our game savethefrogs (the savethefrogs foundation) has found that his donations have gone up by over 100% since we partnered with him [21:02] sudocarl: so it is working out :) [21:02] mediacoder: path[l]: yea, there is a proof-of-concept irc server in node, which ry used to demo node [21:02] the_undefined_: sudocarl: nice [21:03] sudocarl: but savethefrogs was sorta a test project for our company [21:03] sudocarl: our next game I am hoping will be alot more fun [21:03] sudocarl: :) [21:03] sudocarl: but its underwraps for now :) [21:03] the_undefined_: sudocarl: any plans on using node? [21:04] mediacoder: sudocarl: and already running productive on node? [21:04] sudocarl: I would love to :) [21:04] sudocarl: not yet [21:04] mediacoder: ah :-) [21:04] sudocarl: I am getting into node as of last week [21:04] sudocarl: its alot of fun but I need to ensure that its super stable [21:04] sudocarl: right now were running on nginx + postgres [21:04] sudocarl: php middleman + stored procedures backend [21:04] sudocarl: also a apache server to serve alot of our misc stuff [21:05] ashb: why bother with the apache? [21:05] sudocarl: 99% of our page load time is querying FB [21:05] sudocarl: I think its cause we started with apache and our svn server is linked to it [21:05] sudocarl: I dunno I didn't handle that side of things [21:05] pdelgallego has joined the channel [21:05] sudocarl: its not serving very much so we could probably switch it [21:05] sudocarl: we just don't care lol [21:05] mediacoder: sudocarl: thats a socket-server based game on php-sockets? [21:05] sudocarl: no [21:06] rtomayko has joined the channel [21:06] sudocarl: its currently post request based [21:06] sudocarl: our next game/games will all be socket based [21:06] mediacoder: just started a simple socket-server and policy server for flash :-D [21:06] sudocarl: :) fun eh [21:06] mediacoder: yea..especially with node [21:07] sudocarl: I am writing a pretty fully-featured game framework for flash which has a powerful socket client in it [21:07] sudocarl: it will power all of relevant game's games [21:07] sudocarl: and one of the other developers is writing a low level socket server in c [21:07] mediacoder: you goind to release it at some point? or just internal project? [21:07] sudocarl: for now its internal [21:07] sudocarl: but I want to push for release [21:07] path[l]: hmm the video was good, now I wanna try to build something [21:08] sudocarl: path[l], hello world!! [21:08] sudocarl: :) [21:08] path[l]: lol maybe [21:08] mediacoder: SPDY implementation would be great [21:08] path[l]: gtg to bed now, gonna install tomorrow [21:08] mediacoder: :-) [21:08] sudocarl: path[l], night :) [21:08] sudocarl: brb [21:08] path[l]: night [21:09] sudocarl: fuck!! I just downloaded a iso for windows 7 and its in hebrew [21:09] sudocarl: V_VV [21:09] ashb: serves you right ;) [21:09] sudocarl: its a non-cracked iso [21:09] sudocarl: I have a key for it [21:09] sudocarl: legal [21:09] sudocarl: I just need a iso [21:09] sudocarl: for vmware [21:10] ashb: dont think that makes it any more legal mind [21:10] sudocarl: haha I think it does? [21:10] sudocarl: I bought the key [21:10] sudocarl: I just don't have the cd [21:10] sudocarl: whats not legal about that? [21:10] malkomalko has joined the channel [21:10] the_undefined_: sudocarl: paying for windows is like buying stocks in oil companies ... except YOU will not become rich :) [21:11] ashb: if you care read the EULA i guess [21:11] sudocarl: hahaha sounds good [21:11] sudocarl: the_undefined_, I totally agree :) [21:11] sudocarl: I run 99% linux [21:11] sudocarl: just need windows for a couple things [21:11] sudocarl: like adobe [21:11] sudocarl: <3 adobe [21:15] Atmoz: ACTION runs photoshop in virtualbox, but must reboot to play games :/ Windows dies the day gaming companies make games work on linux. [21:15] sudocarl: :) so true! [21:17] sztanpet has joined the channel [21:22] rakeshpai has joined the channel [21:27] rakeshpai has joined the channel [21:29] LordMetroid has joined the channel [21:29] LordMetroid: Wow, node.js is really easy [21:30] mediacoder: and awesome [21:31] inimino: and fun! [21:31] LordMetroid: I only compiled and copy pasted the hello world example but I don't think I have been up and running a webserver in such a short amount of time before [21:32] LordMetroid: Now I just need to start writing something useful [21:32] coolguy_: ... [21:32] coolguy_: PROFIT!! [21:33] LordMetroid: :) [21:33] LordMetroid: Is it feasible to write a whole e-commerce site using node.js? [21:33] sudocarl: LordMetroid, yes! [21:34] sudocarl: LordMetroid, do it! [21:34] LordMetroid: I will [21:34] sudocarl: LordMetroid, good. [21:34] sudocarl: [+] Made someone do something. done. [21:34] LordMetroid: lol [21:34] sudocarl: time for a nap [21:34] sudocarl: lol [21:35] orlandov: i see there's another outliner user :) [21:36] sudocarl: actually I don't but I am intrigued :) [21:36] sudocarl: I use that format for my personal time tracking application [21:36] inimino: ACTION uses ✓ [21:36] sudocarl: inimino, yay old school! [21:37] sudocarl: er I am assuming you mean pen and paper [21:37] sudocarl: but I could be wrong [21:37] sudocarl: lots of systems use unicode names nowadays [21:37] inimino: no, I mean Unicode text files [21:37] inimino: in a browser window, as it so happens [21:37] sudocarl: nice :) [21:38] sudocarl: using your nifty revision system? [21:38] inimino: yeah [21:38] sudocarl: wow its multipurpose [21:38] sudocarl: is it running on node? [21:38] sudocarl: I just assumed it did I never asked lol [21:38] inimino: it's like my filesystem :) [21:38] inimino: it is now! [21:38] sudocarl: sweet :) [21:38] sudocarl: have you noticed a speedup/slowdown? [21:38] inimino: the previous version was prototyped in Apache with bash CGI :-) [21:39] sudocarl: ouch [21:39] skampler: hohoho [21:39] skampler: now that's an improvement [21:39] inimino: it only had one user, so I never noticed the speed one way or the other [21:39] inimino: everything is just instant when you have one user per VPS, no matter how inefficient the code [21:40] sudocarl: haha lol [21:40] sudocarl: so true [21:40] sudocarl: where are you running it? [21:40] inimino: old one is running on slicehost, new one on linode [21:41] okito has left the channel [21:41] sudocarl: oo how are you liking linode? [21:41] sudocarl: thats in cali right? [21:41] inimino: it's very nice so far [21:41] mediacoder: ACTION wishes eiterone accepted paypal :-/ [21:41] inimino: they have a few datacenters, I think mine might be in Dallas [21:41] sudocarl: oh cool [21:45] sudocarl: inimino, do all linode instances have the same amount of ram/cpu? [21:45] inimino: I think they have different plans [21:45] inimino: I think mine is whatever they offer for $20/mo [21:46] sudocarl: ah I see [21:46] sudocarl: so you have 360mb of rab [21:46] sudocarl: ram [21:46] inimino: I'm using 32bit Arch [21:46] sudocarl: thats pretty impressive actually [21:46] sudocarl: for only 20$ [21:47] coolguy_: linode is fantastic [21:47] coolguy_: great customer service and cheap [21:47] sudocarl: has anyone hosted with webfaction? [21:51] nefD: i used to use linode.. i highly recommend them [21:51] nefD: slicehost is another, similar provider, but I haven't tried them [21:53] inimino: both are good in my experience [21:53] inimino: linode has a nicer control UI IMO [21:56] binary42 has joined the channel [21:58] sudocarl: and a ping of 58 ms isn't too bad... [21:59] sudocarl: in comparison I have a shared server also hosted in dallas and I am gettign 103 ms on it [21:59] sudocarl: V_V [21:59] sudocarl: silly shared [21:59] sudocarl: need to upgrade sometime [21:59] nefD: when I went from shared hosting to vps hosting, I got supremely spoiled by having root level ssh access to it.. I can't imagine going back to shared, now [22:00] sudocarl: sounds about right [22:01] sudocarl: well I have a homeserver which I use for 99% of my stuff [22:01] sudocarl: only my website is hosted in dallas [22:01] sudocarl: so its not too bad [22:01] nefD: *nod* [22:01] sudocarl: but I totally understand cause whenever I have to login to it and mess with something its a headache [22:01] nefD: i'd do the same, but the lack of a dedicated ip and my wife wanting to be in windows all the time makes a hosted solution more suited to my needs :P [22:01] inimino: I went from dedicated to VPS for development [22:02] sudocarl: inimino, interesting [22:02] sudocarl: do you develop on your vps? [22:02] sudocarl: or locally? [22:02] inimino: VPS is quite a bit better fit for me [22:02] sudocarl: I would kill if there was any lag in keystrokes [22:02] sudocarl: even 50ms response is too much [22:02] sudocarl: my homeserver is much nicer with a .037ms response time :) [22:02] inimino: sudocarl: I always do everything remotely [22:03] sudocarl: preferred editor? [22:03] nefD: personally, I prefer either vim'ing from an ssh (its really not too bad) or mounting my server locally over ssh and editing on my own box [22:03] inimino: vim [22:03] sudocarl: nice me too [22:03] sudocarl: hail to zee vim [22:03] nefD: oh yea, vim pwns [22:03] sudocarl: I am running windows right now with 3 xming windows running terminal sshed into my homeserver [22:03] sudocarl: :) its my way of getting linux on windows [22:04] nefD: get taglist+ctags and nerdtree, plus some tinkering with the mouse and tabbed interface, you get a suweet lightweight editor [22:04] sudocarl: yuppers [22:04] sudocarl: my vimrc file has grown disgustingly large though [22:04] nefD: i've been on this neverending quest to find *something* i can tolerate editing with in windows.. suffice to say, I haven't found it yet [22:04] sudocarl: I like putting in f5/f6 commands for every language haha [22:04] sudocarl: notepad++ is all I can find [22:04] nefD: haha yea [22:04] sudocarl: and even then it has its quirks [22:05] sudocarl: although the one area where windows shines is in as3 development [22:05] sudocarl: I really love flashdevelop [22:05] nefD: i can remember when ultraedit wasn't so ginormous and served the purpose pretty well [22:05] nefD: ahh yea [22:05] nefD: ive done a bit of as3, but i spent most of my time messing with haxe [22:05] sudocarl: haha haxe is pretty fun [22:05] nefD: indeed! [22:06] sudocarl: but once you get to know (and love) as3 there is really no comparison [22:06] sudocarl: my three fav languages right now are... python, as3 and probably js [22:06] sudocarl: either js or sml [22:06] sudocarl: sml because I am sadistic [22:06] nefD: honestly though, it was my only real option for developing flash in linux [22:06] sudocarl: thats true [22:06] mediacoder: that has atleast changed much [22:06] sudocarl: flash linux support sorta sucks [22:06] sudocarl: which is sad [22:07] nefD: the client isn't too bad, just a little laggy, especially with sound [22:07] sudocarl: mediacoder, is there a new alternative? [22:07] mediacoder: well, flexbuilder for linux works [22:07] sudocarl: yea [22:07] skampler: who needs flash when you've got javascript?! [22:07] sudocarl: skampler, amen! [22:07] mediacoder: sudocarl: well, not for fancy WYSIWYG [22:07] sudocarl: haha [22:07] nefD: actually, i'd save JS is better for fancy ui and wysiwyg, especially if you go with something like dojo [22:07] nefD: but for games (my main area of interest), flash is hard to beat when it comes to graphics and responsiveness [22:08] mediacoder: yea.. i think flash will have its hard times now with html5 and highperformance js engines [22:08] sudocarl: who needs objective c when you have cs5? :D Sorry I dunno if you guys have heard but cs5 will be able to build flash apps directly for the iphone [22:08] nefD: indeed [22:08] sudocarl: thats what I am looking forward to [22:08] sudocarl: cause obj c is retarded [22:08] inimino: I look forward to the death of Flash with great anticipation [22:08] nefD: iphone development seems like a precarious thing to hang your hat on, what with the seemingly opaque app review process I keep hearing about [22:08] mediacoder: hehe [22:09] sudocarl: nefD, no kidding... but my company wants iphone apps [22:09] nefD: >__< [22:09] sudocarl: so I would prefer to develop in as3 [22:09] sudocarl: cause it makes sense [22:09] sudocarl: :D [22:09] nefD: indeed [22:09] sudocarl: I think that silverlight has a small chance of doing well.. [22:09] sudocarl: but I think it wasn't launched correctly [22:09] sudocarl: I like the fact that it supports threading [22:10] sudocarl: which flash sadly does not [22:10] mediacoder: sudocarl: yea..i think that is one future of the flash IDE.. building native mobile apps for platform X [22:10] sudocarl: mediacoder, bingo [22:10] nefD: as3 is based on ecma3, yea? [22:10] sudocarl: web systems will turn to other things [22:10] sudocarl: yea [22:10] sudocarl: thats another reason why its great :D [22:10] sudocarl: its just like js [22:10] nefD: explains why the syntax is like js [22:10] nefD: yea [22:10] sudocarl: inimino, whats your beef against flash? [22:10] inimino: sudocarl: it's proprietary [22:10] cmlenz: as3 is based on the dead ecma4 [22:11] sudocarl: lol :) [22:11] sudocarl: cmlenz, thanks for clarifying [22:11] nefD: hrm, i had read somewhere it was based on ecma3 + parts of the ecma4 specs [22:11] sudocarl: cmlenz, I wasn't sure which ecma* it was based on [22:11] inimino: (with all that entails) [22:11] sudocarl: inimino, well thats fair [22:12] cmlenz: adobe is probably pretty unhappy about how the ecma4 process turned around [22:12] sudocarl: adobe is unhappy about alot of stuff [22:12] sudocarl: like applle [22:12] sudocarl: apple* [22:12] inimino: ES4 was far too big a change, I'm rather glad it died [22:13] sudocarl: and as for js taking over the flash world I am totally behind it, but browsers need to get better before that will happen [22:13] inimino: but I'm glad the process got moving again and I hope Harmony will be ... better [22:13] inimino: sudocarl: they are getting much better, and standards are moving again [22:14] inimino: Flash's days are numbered :-) [22:14] sudocarl: harmony? [22:15] sudocarl: ohh the new version of ecmascript [22:15] sudocarl: cool [22:15] inimino: Harmony is a set of proposals and ideas that represent the next, or maybe next again, ES standard [22:15] inimino: (after ed. 5) [22:15] inimino: I hope they get some of their process issues straightened out too [22:19] sudocarl: anyone want to share screenshots of their monitors? [22:19] sudocarl: I am interested to see how people work [22:20] orlandov: sudocarl: dual lcd's mounted to the wall... FTW! [22:21] sudocarl: luls [22:21] sudocarl: s/s/z [22:21] sudocarl: http://imgur.com/hZ2nR.jpg [22:22] orlandov: sudocarl: typically i have a maximized terminal on my first monitor and firefox maximized on my second [22:22] sudocarl: haha I split up alot more :) [22:22] sudocarl: maximized terminal == alot of wasted space [22:22] orlandov: nah [22:22] sudocarl: most of my lines are less than 80 chars [22:22] orlandov: i use screen [22:22] inimino: ACTION uses xmonad [22:22] sudocarl: ohhh [22:22] sudocarl: well that works :) [22:23] orlandov: i <3 that screen has vertical split now [22:23] orlandov: on ubuntu at least [22:23] sudocarl: yea screen is pretty nifty [22:23] sudocarl: but its broken on my home-server [22:23] sudocarl: ever since I updated V_V [22:23] sudocarl: I need to reformat+reinstall [22:23] sudocarl: cause something is fucked on it [22:24] orlandov: i_i [22:24] sudocarl: what? [22:24] orlandov: cryingface [22:29] the_undefined_: ryah: CommonJS testing is ready :) [22:29] the_undefined_: ryah: see mailing list [22:30] sudocarl: the_undefined_, whats that? [22:31] LordMetroid: Hmm, so node.js is just a server, if I want to add functionality of a web server I will have to code it myself? [22:31] the_undefined_: sudocarl: http://wiki.commonjs.org/wiki/Unit_Testing/1.0 [22:31] the_undefined_: sudocarl: http://github.com/felixge/node/commit/a7f5f51c45e7358c545afec052da845f9ba52ed0 [22:31] the_undefined_: and http://github.com/felixge/node/commit/de78e7a917c891f3fc0404ecd380dcd1b55e7ec2 [22:31] sudocarl: LordMetroid, http://nodejs.org/api.html#_http [22:31] sudocarl: the_undefined_, lol :D thanks [22:32] the_undefined_: basically its a cleaner & nicer assertation suite than mjsunit [22:32] the_undefined_: which was ratified as a standard [22:32] the_undefined_: by commonjs [22:32] sudocarl: uh nifty [22:33] the_undefined_: lets see how well this went, its kinda a massive patch :D [22:33] sudocarl: no kidding lol [22:34] sudocarl: atleast alot of the basic changes are just find+replace [22:34] sudocarl: :) [22:34] the_undefined_: sudocarl: pretty much everything I did is, yes [22:34] sudocarl: yay its the ping pong test [22:34] sudocarl: my fav [22:34] the_undefined_: karl rewrote assert.js which is hard [22:35] the_undefined_: the CommonJS reference implementation was highly dependent on their util.js class [22:35] sudocarl: well nicely done job :) [22:35] sudocarl: LordMetroid, did you get my link? [22:35] LordMetroid: sudocarl, yes, I've read that [22:35] sudocarl: LordMetroid, there are also a couple frameworks to help you out. my personal fav right now is node-router [22:35] sudocarl: http://wiki.github.com/ry/node [22:35] LordMetroid: If I want to create easily configurable virtual hosts... I would need something more than this, right? [22:35] sudocarl: there is a list of frameworks [22:35] sudocarl: uhhhh [22:35] the_undefined_: sudocarl: node router does look nice [22:35] sudocarl: i am going with a yes [22:36] orlandov: LordMetroid: what are you looking to do? [22:36] sudocarl: the_undefined_, http://github.com/carlsverre/node-router [22:36] sudocarl: the_undefined_, my changes :) [22:36] sudocarl: the_undefined_, more coming down the pipeline [22:36] the_undefined_: sudocarl: cool [22:36] the_undefined_: love to see this stuff :) [22:36] the_undefined_: I'm contemplating to rewrite my companies blog in node.js over christmas [22:36] the_undefined_: http://debuggable.com/ [22:36] sudocarl: DO IT [22:36] sudocarl: :) [22:37] LordMetroid: orlandov, I want to create an e-commerce toolset and reach different tools through different virtual hosts [22:37] the_undefined_: its pretty simple, and it would probably be insanely fast afterwards :) [22:37] orlandov: LordMetroid: did you want node.js to do all of that? or were you just going to like reverse proxy to node.js for some stuff? [22:37] the_undefined_: ok going to bed now [22:37] LordMetroid: I don't know [22:37] the_undefined_: cya guys [22:37] orlandov: l8 [22:38] LordMetroid: orlandov, can I do it with node.js? [22:39] LordMetroid: I suppose it should be a matter of simply parse some config files and setup the docroots for different incomming requests [22:40] orlandov: i would personally use something like nginx to serve most stuff, and then delegate some requests to node.js [22:40] mediacoder: yea, thats also how im using node [22:41] orlandov: yeah, like static files i'd let a frontend web server dole out [22:41] mediacoder: behind a proxy and let the dumb webserver do the dirty serving work [22:41] orlandov: ya [22:41] LordMetroid: So how would I do that? [22:42] LordMetroid: ACTION goes and downloads nginx [22:42] mediacoder: install nginx [22:42] binary42_ has joined the channel [22:42] mediacoder: and proxy the requests to node running on localhost [22:42] orlandov: yeah, you'll have to do a "man nginx" or some googling [22:42] orlandov: i personally use Cherokee for httpd [22:43] orlandov: but any front end server would do [22:43] orlandov: woot, successfully cargo culted a c++ extension [22:44] mediacoder: orlandov: what is it about? i was also going to dive into the c extension world at some point :-) [22:45] orlandov: mediacoder: one sec [22:45] mediacoder: (would love to see some wrapper around some image manipulation lib :-) [22:46] inimino: ooh [22:47] inimino: the GIMP library would be nice [22:48] Biscuits: Hmmm [22:48] inimino: then maybe the Web-based photoshop killer will be backed by node.js [22:48] Biscuits: You wouldn't want to run that in your main thread though :/ [22:48] sudocarl: inimino, that would be sweet [22:48] inimino: sure, definitely needs to be async [22:48] sudocarl: er mediacoder :) [22:49] sudocarl: you could write a tcp wrapper to gimp [22:49] sudocarl: heck there probably already is one [22:49] sudocarl: then just dispatch jobs to it [22:49] wil_ has joined the channel [22:49] inimino: probably [22:49] inimino: yes [22:50] mediacoder: well, that wouldnt need a c-wrapper, wouldnt it? (i wish i wasnt that noobish here :-D) [22:50] sudocarl: nope that could be done in js [22:50] inimino: then build a Web UI, for client-side preview, GIMP library on the backend for heavy-duty image processing :) [22:50] mediacoder: hehe [22:50] sudocarl: see: http://github.com/creationix/postgres-js [22:50] sudocarl: for a similar example [22:51] mediacoder: well, i was more thinking about captchas..but that also sounds great :-) [22:51] sudocarl: mediacoder, hahaha [22:51] sudocarl: you don't need gimp for that [22:51] sudocarl: http://www.google.ca/search?q=imagemagick+captcha&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a [22:52] sudocarl: node's child-process support would be fine for that [22:53] mediacoder: yea.. i was also looking into this..but thaught a lower-level interface like for example gd for php (or also imagemagick) for nodejs would be also kool [22:53] sudocarl: :) [22:53] ashb: mediacoder: gd sucks [22:53] sudocarl: but just remember that things like this exist and work: http://caca.zoy.org/wiki/PWNtcha [22:53] mediacoder: yea..that was just an example :-P [22:54] ashb: cairo or imlib2 are better [22:54] ashb: ah k [22:55] inimino: CAPTCHA sucks [22:55] inimino: broken idea [22:55] sudocarl: yea [22:56] sudocarl: there are too many easy ways around it [22:57] orlandov: mediacoder: i would use a job queue, rather than try to do it fro mnode [22:57] orlandov: use something like gearman or TheSchwartz [22:58] ashb: dont use theschwartz if order of jobs is important [22:58] pjb3 has joined the channel [22:58] orlandov: ashb: ah yeah... i actually hacked it to do that :) [22:59] ashb: ditto :) [23:00] ashb: there are better options now than TheSchwartz [23:01] sudocarl: here is my favorite way of breaking captchas: http://www.bluehatseo.com/creating-an-army-of-free-captcha-typers/ [23:01] sudocarl: :) [23:01] ashb: mech turk? [23:02] sudocarl: nope this method is free [23:02] sudocarl: you make a web-proxy [23:02] ashb: ah [23:02] sudocarl: and then write a script which grabs a captcha off a reg form and gets the next person who wants to use the proxy to typoe it in [23:02] sudocarl: type* [23:02] orlandov: ah the old switcheroo [23:02] sudocarl: :-0 [23:02] sudocarl: indeed [23:13] sixtus42_ has joined the channel [23:13] isaacs_ has joined the channel [23:16] fictorial has joined the channel [23:16] fictorial: hey guys [23:17] fictorial: so I had an instance wherein I needed a sequence of functions that return Promise objects called one after another... so I created PromiseChain [23:17] fictorial: but it got me wondering if anyone has any sort of "Promise utils" [23:18] isaacs_: fictorial: I did something like that here: http://github.com/isaacs/npm/blob/master/src/queue.js [23:19] fictorial: isaacs_: ok I'll look thanks [23:19] isaacs_: although, in that case, you provide it with a list of things, and a function [23:19] fictorial: btw, were you from Yahoo? [23:19] isaacs_: the function returns a promise, and the invocation returns a promise that emits success when all the items are successfl [23:19] isaacs_: ACTION is indeed from Yahoo [23:19] fictorial: I quit Yahoo 2 weeks ago to focus on Fictorial full time [23:20] isaacs_: oh, neat [23:20] fictorial: scary but exciting [23:20] fictorial: ACTION checks out Queue [23:20] orlandov: fictorial: good for you :) [23:20] isaacs_: i'm saving a nest egg to do the same thing next year some time [23:20] isaacs_: s/Fictorial/sisterTrain/ [23:20] fictorial: yeah, that's what I did - ads in iPhone games pay handsomely enough for me to do it [23:21] fictorial: well, that and consulting [23:21] fictorial: so, we'll see [23:21] isaacs_: nice [23:21] isaacs_: i tend to tread carefully where my rent is concerned. [23:21] isaacs_: i like living indoors and alone [23:21] fictorial: hehe [23:21] fictorial: Yeah, I "ran the numbers" and it worked out for about 6-8 months so that was enough for me to dive in and try it [23:22] isaacs_: so, when i've got a year or so in the bank, i'll be more comfortable ditching the regular direct deposit gig. [23:22] isaacs_: nice [23:22] orlandov: fictorial: what's your venture (if you can say)? [23:22] fictorial: I'm in "stealth mode" :) [23:22] isaacs_: that seems like the way to do it. if you're self-funded you can play a bit more, try things, fail a little, etc. [23:22] pjb3 has joined the channel [23:22] fictorial: it has to do with iPhone gaming [23:22] fictorial: I'll either rule the world or fail spectacularly [23:22] orlandov: fictorial: nice! well,best of luck to ya [23:23] isaacs_: fictorial: failing educationally is better. [23:23] fictorial: thanks! [23:23] fictorial: indeed :) [23:23] isaacs_: though less entertaining ;) [23:23] orlandov: it's only a failure if you dont' learn [23:23] sudocarl: fictorial, when your ready to release more information my company relevantgames.com would love to hear about what your doing :) [23:23] isaacs_: orlandov: no, sometimes it's still a failure. [23:23] fictorial: sudocarl: awesome [23:23] orlandov: isaacs_: sshh i'm being supportive! [23:23] sudocarl: lulz isaacs [23:23] isaacs_: ACTION has been a part of some very educational failures that hurt just the same. [23:24] isaacs_: no pain, no gain! [23:26] sudocarl: the best part about crud is being able to say that you write code about crud [23:26] sudocarl: tehee [23:32] isaacs: fictorial: getting back to what you were saying... a "promise utils" lib would be killer, imo. [23:33] fictorial: yeah [23:33] fictorial: you're Queue idea is very similar to my PromiseChain [23:33] fictorial: I also have a half-ass PromiseGroup [23:33] isaacs: especially for cases when you have like 15 things to do, but they can be in any order. [23:33] isaacs: and you want to fire a listener for when they're all done [23:34] fictorial: PromiseGroup takes a bunch of Promises and waits until they're all done (pass or fail) then emits results (n failed, m passed, etc.) [23:34] isaacs: right [23:34] ashb: sounds perfect for a test runner [23:34] pjb3: I have a question based on something I saw in Ryan's JSConf.eu presentation [23:34] fictorial: ashb: heh, yeah [23:34] isaacs: whereas Queue waits for item n before running item n+1 [23:34] pjb3: When he demoed stat [23:34] pjb3: first it does [23:35] pjb3: var promise = stat("/etc/passwd") [23:35] isaacs: fictorial: so... got a github link you feel like sharing with the class? [23:35] pjb3: then it adds the success callback to promise [23:35] pjb3: so, when does it actually make the call out to the OS? [23:35] ashb: in a thread in the pool [23:36] pjb3: Will the success handler be on promise before the stat finishes? [23:36] isaacs: pjb3: yes [23:36] isaacs: pjb3: if you're familiar with browser js, it's very similar to setTimeout(fn, 0) [23:36] fictorial: isaacs: let me test these a bit then I'll post em yeah [23:36] pjb3: how do you know that, just because it's the next thing you do and you know the stat OS call will take longer? [23:37] fictorial: nothing earth-shattering [23:37] isaacs: pjb3: no, it's not a race condition. node actually enforces this. [23:37] pjb3: isaacs: how? [23:37] isaacs: pjb3: rtfs ;P [23:37] ashb: isaacs++ [23:37] pjb3: what would happen if I did this? [23:37] pjb3: var promise = stat("/etc/passwd") [23:38] ashb: rtfs like isaacs said and find out [23:38] pjb3: for(var i=0; i < 1000000; i++) { whatever() } [23:38] pjb3: promise.addCallback(function(s) {} ... ) [23:38] isaacs: pjb3: like i said, it's not a race condition or a timing issue. the current executing process will block the execution and the stat() will wait patiently until it's done. [23:39] orlandov: to be fair i don't think the way promises are intuitively obvious, even looking at the code, specially for soemone just taking a look now [23:39] isaacs: orlandov: yes, there's a learning curve. [23:39] isaacs: pjb3: this, however, would be dangerous: p = stat("/etc/passwd"); setTimeout(function () { p.addCallback(foo) }) [23:39] sudocarl: pjb3, the thing is that promise can wait until it gets a "newListener" event before firing off the success callback [23:40] sudocarl: issacs, wouldn't that still work? [23:40] sudocarl: because promise should wait until there is a listener? [23:40] sudocarl: before firing the callback? [23:40] pjb3: sudocarl: yeah, that's what I was wondering [23:40] isaacs: sudocarl: afaik, it'll be a problem. [23:40] ashb: TIAS [23:40] isaacs: you can do stuff without assigning a callback ever, and just an errBack [23:40] isaacs: because in that case, the setTimeout is *also* deferring execution until later, so you end up with a race condition. [23:41] ashb: depends. it sohuldn't ever crash [23:41] ashb: it might just mean you dont get your callback fired [23:41] isaacs: however, last tiem i played with that type of pattern was a while back, and it's entirely possible that ryah or someone else added some magic in there. [23:41] isaacs: ashb: right, what i'm saying is, if you add your callback in a setTimeout fn, then it might not be added before the emitSuccess() happens [23:41] ashb: yeah [23:41] isaacs: but you kind of have to go out of your way to make that mistake. [23:42] ashb: depends if anyone has made it fire if its compelted when you add the first onSuccess [23:42] isaacs: ashb: as i understand it, it just puts a todo item on the process queue [23:42] ashb: no idea [23:42] ashb: i've used node for all of 5 mins :D [23:43] isaacs: ACTION has not rtfs enough :) [23:43] inimino: it's the same as the browser's single-JavaScript-thread event loop [23:43] ashb: i'm just here to steal ideas, steal info and spread FUD >_> [23:43] kriskowal: you guys need to read ref-send and mark miller's dissertation [23:43] isaacs: inimino: that's how i understand it, yes [23:43] rakeshpai has joined the channel [23:43] inimino: which as far as I know isn't really well-documented anywhere [23:43] pjb3: I just tested it, adding the callback in a setTimeout doesn't work [23:44] inimino: well, actually, it's documented now in HTML5 [23:44] kriskowal: promises aren't just an API; there's a lot that needs to happen under the hood for them to provide the reliability and composability features they're supposed to guarantee [23:44] inimino: I should say there isn't any good introductory material that I'm aware of [23:44] kriskowal: if you want to learn about promises, check in at #erights [23:46] isaacs: pjb3: yep. it should never work, actually. [23:47] isaacs: as in, not even a race condition, just a flat out failure. [23:47] pjb3: yeah, but if you do for(var i=10000000; i > 0; i--) { puts(i) } [23:47] pjb3: between stat("whatever") [23:47] pjb3: and adding the callback, the callback does fire [23:48] isaacs: pjb3: that should work, yes [23:48] isaacs: because it's actually all happening in a single thread. [23:48] pjb3: so as you said, it's not a timing issue [23:48] isaacs: the stat itself occurs in a process pool. [23:48] kriskowal: some stuff on promises http://waterken.sourceforge.net/web_send/ [23:48] inimino: it's an event loop [23:48] kriskowal: the lib Q API is the important bit. [23:48] kriskowal: it's not just an event loop. [23:49] inimino: reading about the browser JavaScript execution model would probably be highly enlightening [23:49] kriskowal: at least, it's not supposed to be. [23:49] kriskowal: promises are supposed to guarantee stable propagation of causes and effects [23:49] kriskowal: through return values and arguments, with very reliable order of resolution [23:49] isaacs: kriskowal: i'm pretty sure they do in node. (if not, posting a bug would probably be a great help) [23:50] pjb3: yeah, I can't get my head around how this works: http://gist.github.com/245894 [23:50] pjb3: somehow, both callback get fired [23:51] isaacs: pjb3: becasue, until it gets to the END of your current block of executing code, you can add as many callbacks as you want. [23:51] inimino: pjb3: both event handlers are added, so both are fired [23:51] inimino: pjb3: there is only one event [23:51] isaacs: you could loop i for hours. [23:51] isaacs: it's not a timing issue. [23:51] kriskowal: ah, pjb3, a promise is a "state" event. once a promise has been "resolved", all further callbacks are guaranteed to execute in successive events [23:52] kriskowal: a "promise" is just that; a promise that all registered callbacks will execute exactly once when the promise has been resolved [23:52] isaacs: pjb3: the setTimeout case fails because it's handing the program some code to run "later", [23:52] pjb3: isaacs: so that stat executes once the interpreter has eval'd everything in the file? [23:52] ashb: no the stat will fire off in a thread almost straight away [23:52] isaacs: pjb3: the blocking c-level stat() call happens in the process pool, pretty son. [23:52] isaacs: *soon [23:53] isaacs: but the *promise* wrapper provided by libeio won't do its thing until node is done with the current code. [23:53] pjb3: but the callbacks aren't fired until it's parsed everything? [23:53] isaacs: it'll sit there with teh results of the stat() call, waiting patiently until its turn comes up [23:53] kriskowal: it's not a matter of parsing. but it is a matter of the current thread of execution completing. [23:53] inimino: parsing is something else altogether [23:53] pjb3: isaacs: yeah, that's what I'm trying to grasp, how it knows when it is it's turn [23:54] isaacs: so, guys, but s/parse/execute/ and pjb3's comment is right. [23:54] ashb: so the timeout can't fire until you get back into the event loop [23:54] pjb3: right, I'm sure I'm getting the parsing/executing/evaling language mixed up [23:54] ashb: which could happen via a .wait() or an explicit loop() call [23:54] isaacs: pjb3: imagine that all your code is wrapped in a loop. [23:54] isaacs: when it gets to the end of the loop, it checks to see if there's anything on its todo list, and then it does it. [23:54] isaacs: adding a callback adds something to the todo list. [23:55] pjb3: isaacs: awesome, that clears it up for me [23:55] isaacs: setTimeout() also adds something to the todo list. [23:55] pjb3: so the call to stat("/etc/passwd") is a "todo-list" item as well, at least conceptually, right? [23:55] ashb: yes [23:55] isaacs: pjb3: yes, exactly. [23:55] kriskowal: um. [23:56] inimino: isaacs: now go write the blog post that explains the browser/node event loop in an introductory fashion and then we can just point people to it :) [23:56] isaacs: kriskowal: broad strokes. [23:56] isaacs: :) [23:56] isaacs: inimino: not a bad idea, actually [23:56] kriskowal: no, it's a promise. any callback you attach to the promise gets added to the todo list when the promise is resolved. [23:56] isaacs: oohhhh... couldn't restrain yourself, could you kriskowal! [23:57] kriskowal: if it helps, imagine i said that in the voice of the simpson's comic book guy [23:57] pjb3: so at least logically, I can think about the order of operations that is happening in the gist I posted as [23:57] pjb3: 1. when I tell you to, call stat [23:57] pjb3: 2. when you call stat, do this [23:57] pjb3: 3. right now, do a for loop [23:57] pjb3: 4. when you call stat, also do this [23:57] pjb3: 5. ok, call stat now [23:58] kriskowal: 6. that first thing happens [23:58] kriskowal: 7. that second thing happens [23:58] isaacs: pjb3: as long as when you say "call stat", you mean "get the results of the stat call and inform the listeners" [23:58] crux has joined the channel [23:58] pjb3: isaacs: yeah, that's what I mean [23:58] isaacs: actually checking in with the OS about the nature of the file is done in the process queue almost immediately [23:58] isaacs: and asynchronously [23:58] isaacs: oops, not process queue, process *pool* [23:58] isaacs: pjb3: incidentally, the reason why (imo) this is such a powerful pattern is that it encourages small bits of code that don't block one another and only care about order when it really matters. [23:59] isaacs: code written in that fashion tends to be easier to reason about. [23:59] kriskowal: on a side note, the node api is a bit out of date if it's tracking the commonjs proposal. [23:59] pjb3: I'm sure I could look this up somewhere, but does stat take a second argument as a callback function? [23:59] inimino: kriskowal: which proposal? [23:59] pjb3: because stat("/etc/passwd", function(s) { ... } )