[00:07] lifo has joined the channel [00:11] morgan: Anyone know of an example of a dynamic server written for Node yet? Inline JS in HTML? [00:15] Spot_: Whenever I try to call a method a attached to the Array object, node blows out and says the function (it displays it) "has nomethod 'lastIndexOf' " [00:15] Spot_: anyone else have this issue? [00:15] Spot_: *no method [00:16] kriskowal: did you add the method to Array or Array.prototype [00:16] Spot_: proto [00:16] kriskowal: does the function say [native code] [00:16] Spot_: no [00:16] Spot_: nowhere [00:17] kriskowal: then your Array variable is not the original Array of the context [00:17] kriskowal: so it very well might not have .lastIndexOf [00:17] Spot_: Hmm interesting [00:17] Spot_: ok [00:17] Spot_: thanks [00:18] kriskowal: check [].constructor === Array [00:22] Spot_: ok [00:24] Spot_: It says it is [00:24] Spot_: strange [00:28] mahemoff has joined the channel [00:29] cloudhead has joined the channel [00:54] inimino: erichocean: ping [00:54] erichocean: hi [00:54] inimino: hi [00:54] inimino: erichocean: did you see my paste yesterday about the "var x" thing? [00:55] erichocean: no, but I found the issue [00:56] erichocean: I was using the wrong call signature for show tree (doh!) [00:56] inimino: ok [00:56] inimino: yeah, there seemed to be something off about those trees [00:56] jashkenas: Looking through the Node docs -- it looks like the names of functions are usually camelCased when attached to objects, but all parameters are under_scored -- was there ever a discussion about the casing style? [00:56] erichocean: I also rewrote showTree so that it doesn't build up the string in memory [00:56] erichocean: that was causing a SEGFAULT for me [00:56] jashkenas: And perhaps making it all one way or the other? [00:57] inimino: erichocean: oh, ok, cool [00:57] erichocean: but once I started using sys.write everything worked wonderfully [00:57] erichocean: oops, sys.print [00:57] inimino: erichocean: yeah, this is what I used yesterday: http://boshi.inimino.org/3box/PEG/erics_parser_instrumented.js [00:57] inimino: and the output: http://boshi.inimino.org/3box/PEG/erics_parser_instrumented_output [00:58] inimino: first I added the 'print' statements to see what was happening, then I compared spidermonkey and V8 and they were the same [00:58] erichocean: sweet [00:59] erichocean: I ran it on a pretty large file and it worked well [00:59] inimino: then I noticed that the tree was actually correct, but that's probably a good start to figure out what's going on with that longer example [01:00] inimino: (that one with the ,,127,,127,,127 in the output) [01:00] erichocean: I think the net2 branch would help a lot, speed wise [01:00] erichocean: being able to work directly on string buffers is nice [01:00] inimino: yes [01:01] erichocean: clang has a nice string re-writing model [01:01] erichocean: I'm hoping to get a node lib for that, with your parser in place of the Clang parser (which is for C-style languages) [01:01] voodootikigod_ has joined the channel [01:02] erichocean: then I can run analysis on the source and edit-in-place :-) [01:02] inimino: nice :-) [01:05] steadicat has joined the channel [01:12] isaacs: mikeal: check out what happens when you do ./cli.js install http://github.com/isaacs/npm/tarball/master in my "version" npm branch right now [01:12] mikeal: i will tomorrow, i'm hacking spidermonkey javascript right now tho and I don't want to confuse myself [01:12] isaacs: hehe [01:12] isaacs: must be tricky. [01:14] ryah: jashkenas: everything should be camelcased [01:14] jashkenas: ryah: thanks [01:14] mikeal: i'm adding CommonJS module support to CouchDB views [01:14] ryah: jashkenas: it's a mistake where it is not [01:14] jashkenas: (most of the params in the docs) [01:15] ryah: yeah [01:17] Tim_Smart has joined the channel [01:33] tmpvar has joined the channel [01:36] binary42 has joined the channel [01:57] guan has joined the channel [01:57] gwoo has joined the channel [02:04] isaacs has joined the channel [02:05] ryah: how does jquery do it's documentation? [02:06] ryah: s/it's/its/ (sorry) [02:08] jashkenas has left the channel [02:08] jashkenas has joined the channel [02:08] mikeal1: i'm not sure [02:08] RayMorgan_ has joined the channel [02:09] mikeal1: just @jeresig on twitter, he'll probably tell you [02:09] mikeal1: or message him on github [02:09] mikeal1: ah http://jquery14.com/pre-release-1/new-jquery-api-site [02:09] mikeal1: sounds like it's all custom [02:10] mikeal1: you should probably just steal all the code :) [02:11] sztanpet has joined the channel [02:12] ryah: it uses wordpress [02:12] ryah: god. [02:12] mikeal1: are you serious [02:13] mikeal1: for what it's worth, i kind of like the current documentation [02:13] mikeal1: it would be nice if it had anchor links, but that's like 2 lines of jQuery to add [02:13] mikeal1: the current node.js docs that is [02:14] ryah: i'd like to have documentation for various versions up [02:15] mikeal1: ahh [02:15] ryah: yeah, little anchor links would be nice too [02:16] mikeal1: the cheap way is to just cp docs docs/0.3.2 [02:16] mikeal1: before you modify them for each release [02:16] ryah: yeah - which isn't a bad idea [02:16] ryah: low-tech [02:17] ryah: just like node itself :) [02:17] mikeal1: hehe [02:17] Connorhd: heh, wordpress for docs [02:17] mikeal1: you'll need to make sure to change the naming convention for the directories every month if you want it to be like node ;) [02:17] ryah: yeah. i'm not using wordpress, that's for sure - no matter how cool jquery's site is [02:17] Connorhd: they were using mediawiki before [02:17] mikeal1: wow.... [02:17] mikeal1: they just hate themselves [02:18] Connorhd: heh, I was thinking the same thing [02:18] mikeal1: they have a huge community tho [02:18] Connorhd: I guess the categories with subcategories in wordpress actually work quite well [02:18] mikeal1: so part of it comes down to "how many other people are going to maintain all this for us" [02:19] ryah: asciidoc isn't that bad. [02:19] ryah: just want to know how to control it a bit more [02:19] Connorhd: one thing I quite like is docs that have comments on the pages, but I'm not sure thats easy to do for node [02:20] Yuffster has joined the channel [02:20] ryah: yeah [02:20] ryah: that's the great thing about php docs too [02:20] mikeal1: php.net does that [02:21] mikeal1: php really needs it tho, there are so many crazy edge cases to consider that they need a good place to stick all that information [02:21] Connorhd: yeah, php was what I was thinking of [02:21] mikeal1: i actually really like the documentation that is generated by Sphinx [02:21] Connorhd: there have been loads of times where my exact issue/function were in the comments [02:21] mikeal1: it's very Python specific [02:22] mikeal1: but it does a lot of great interlinking when you reference different APIs, and it'll even auto-link to other Sphinx docs sites [02:22] mikeal1: i absolutely hated it at first, because it's all reStructuredText [02:22] mikeal1: but eventually i got over it [02:23] ryah: i think having docs sepearted from the code-repo is good [02:23] mikeal1: me too [02:23] mikeal1: i've never been a fan of code that is 3/4 inline documentation [02:23] cloudhead: it'd be great to have a nice, clean doc site with comments, for node.js [02:23] cloudhead: that's one of the things I deplore about ruby [02:24] mikeal1: comments wouldn't be great at the moment, because things are changing so quickly a lot of the comments would be outdated fast [02:24] cloudhead: that's true [02:24] Connorhd: hmm, jquery just use disqus comments [02:24] mikeal1: but eventually it would be really awesome [02:24] cloudhead: yah [02:24] mikeal1: i'm not a disqus fan [02:24] ryah: well i'd be nice to have docs which refer to specific versions [02:24] ryah: it'd [02:25] mikeal1: whenever something tells me to "login or signup" it's kind of like they are saying "close this tab" [02:25] cloudhead: ryah: and comments too possibly [02:25] ryah: cloudhead: yeah [02:25] cloudhead: that would avoid much confusion [02:25] Connorhd: mikeal1, I dunno, you can use openid or just post as guest [02:25] cloudhead: deprecated comments go to the bottom : ) [02:25] Connorhd: no worse than having its own login system [02:25] mikeal1: it would be nice to have docs that with comments that refer to major releases [02:25] mikeal1: so we don't throw away all the comments every week [02:25] cloudhead: disqus is the least worse js commenting system [02:26] ryah: better would be to mark comments as refering to specific versions [02:26] mikeal1: ahh [02:26] mikeal1: just tag them [02:26] cloudhead: ya, and grey them out as they get old [02:26] mikeal1: i could build this in CouchDB [02:26] mikeal1: ..... someday [02:26] ryah: :) [02:26] cloudhead: this would be awesome to build actually [02:26] cloudhead: ACTION ponders [02:27] Connorhd: someone needs to throw something together and put it on github ;) [02:27] mikeal1: in fact, all the versioning could be done with tags [02:27] cloudhead: or git [02:27] mikeal1: and you could collect comments relative to "this version and before" with pretty simple view queries [02:28] cloudhead: hm yea I see where you're going [02:28] mikeal1: i need to finish adding CommonJS modules to CouchDB views and this other node.js CouchDB caching proxy first [02:28] mikeal1: so like… maybe week after next I could mess with this [02:29] cloudhead: mikeal1: did you see my couchdb lib? [02:29] mikeal1: bah, I'll have something else I have to do by then [02:29] mikeal1: yes i did [02:29] cloudhead: cool [02:29] mikeal1: it's interesting [02:29] mikeal1: did you see felix's library? [02:29] cloudhead: a caching proxy is an interesting idea for node [02:29] cloudhead: yea, I actually found out about it when I was 3/4 done [02:30] Spot_: Is there anyway to get path.exists() to pass the file it checked to the callback? [02:30] mikeal1: the caching proxy would also listen to _changes on all databases that have been requested and invalidate cache proactively [02:30] cloudhead: oh that's hot [02:30] mikeal1: Spot_: why can't it access it from the closure? [02:30] cloudhead: I wonder how it would compare to something like Varnish [02:31] Spot_: mikeal1, That's not actually what I asked :) But by the time the event fires, the source var has been overwritten (loop) [02:31] cloudhead: if it can do cache invalidation through _changes, you could keep the cache fresh 100% of the time [02:31] cloudhead: always ready for a heavy load [02:31] mikeal1: yup [02:32] cloudhead: very cool [02:32] cloudhead: keep me posted on that [02:32] mikeal1: and it can still do etag checking for view queries [02:32] cloudhead: yea [02:32] mikeal1: it'll go up on github for sure [02:32] cloudhead: cool [02:32] mikeal1: cloudhead: yeah, i liked your library, i was just thinking it would be cool if under the hood it used felix's library [02:33] mikeal1: because we plan on making that as fast as possible [02:33] cloudhead: yea, that could have worked out, seeing as his is more low-level [02:33] cloudhead: ah nice [02:33] cloudhead: well I'll definitely keep an eye on it [02:34] mikeal1: has anyone implemented a btree in node yet? [02:34] cloudhead: not that I know of [02:35] cloudhead: what you thinking of doing with that? [02:35] spoob has joined the channel [02:35] cloudhead: implementing couch in node? [02:35] cloudhead: : ) [02:36] spoob: How is CommonJS on Node coming along? [02:37] mikeal1: cloudhead: it would just be nicer if i was able to write the cache to btree [02:38] mikeal1: no, erlang couchdb is plenty fast, and you can use it without ever not touching javascript :) [02:38] mikeal1: we are investing in node.js tho [02:38] mikeal1: i did this recently http://www.mikealrogers.com/archives/726 [02:38] mikeal1: and we want something similar for externals [02:39] cloudhead: ah so a btree to store the proxy cache [02:40] mikeal1: yeah, it would be useful, but not entirely necessary [02:41] cloudhead: you planning on storing the data on disk? [02:42] mikeal1: it's not feasible to store all the response bodies in memory [02:42] mikeal1: i might do that for small responses [02:42] mikeal1: but any large documents or large HTML response from _show and _list functions [02:42] mikeal1: just not going to scale if it's only in-memory [02:43] CIA-77: node: 03Ryan Dahl 07master * r7c1c89f 10/ (benchmark/http_simple.js benchmark/static_http_server.js): Update benchmark script to new API - http://bit.ly/9qoJIa [02:43] CIA-77: node: 03Ryan Dahl 07master * r7811fa6 10/ doc/index.html : Update example on index.html - http://bit.ly/dk0g99 [02:43] CIA-77: node: 03Ryan Dahl 07master * r4f01c74 10/ doc/api.txt : Fix long lines in docs - http://bit.ly/cklQes [02:45] brosner_ has joined the channel [02:45] brosner_ has left the channel [02:46] ryah: regarding the doc website - it would be nice to be able to have links to blog posts which involve that function [02:46] cloudhead: mikeal1: oh right you're storing _list/_view stuff too, didn't think about it [02:47] cloudhead: ryah: yea, like a 'resources' section for each module or function, linking to relevant stuff [02:47] jed has joined the channel [02:54] jackyyll has joined the channel [02:54] JimBastard has joined the channel [02:55] JimBastard: fuck fuck fuck must work on node projects and not play starcraft 2 [02:55] ryah: srsly [02:56] gwoo: double srsly [02:59] cloudhead: JimBastard: if I had a windows machine, I'd probably be playing too : ) [02:59] bronson has joined the channel [03:00] Connorhd: is that why mac/linux users seem to be able to be productive? no fun games? :P [03:00] JimBastard: i didnt get into the beta but ive got the client at 97% downloaded [03:01] JimBastard: im crossing fingers that it works [03:04] arlolra has joined the channel [03:05] cloudhead: ahah [03:06] arlolra: ryah, can you open some ports for me? [03:08] ryah: arlolra: maybe who are you? :) [03:08] arlolra: buildbot [03:08] ryah: arlo - right [03:08] arlolra: correct [03:08] ryah: um. which ports do you need? [03:09] arlolra: 8010 [03:09] arlolra: and [03:09] arlolra: 9989 [03:09] arlolra: or , you can pick two [03:10] steadicat: has anyone deployed node behind nginx? [03:10] ryah: arlolra: they're open [03:10] JimBastard: a few people steadicat [03:10] ryah: steadicat: yes [03:10] steadicat: do you guys use proxy_pass? [03:11] JimBastard: ive done it on apache too (which isnt as great) [03:11] steadicat: as I understand it, it only supports http 1.0 [03:11] kriskowal has joined the channel [03:11] ryah: http://8.19.35.89:8010/ [03:11] JimBastard: i think the general strategy is proxy pass [03:11] ryah: arlolra: ---^ [03:11] steadicat: which means no chunked transfers, no comet, ecc... [03:11] JimBastard: errmmm [03:11] JimBastard: was it mediacoder maybe who had it setup right [03:11] JimBastard: i'd look around a bit [03:11] JimBastard: its possible for sure [03:11] arlolra: i see [03:12] arlolra: it helps to have the ip. [03:12] steadicat: i'm reading this: http://stackoverflow.com/questions/1160454/nginx-proxy-to-comet/1160574 [03:12] ryah: steadicat: chat.nodjs.org runs behind nginx [03:12] steadicat: hmm [03:12] spoob: hi ryah; how is CommonJS on Node these days? [03:12] RayMorgan has joined the channel [03:12] steadicat: is there a trick? or maybe i'm just using the wrong version of nginx? [03:13] ryah: spoob: what in particular [03:14] spoob: ryah; nothing in particular, just pondering how to have narwhal and node, whether I should be using jack and node or try and have narwhal on node [03:15] kriskowal: spoob i am trying to get narwhal running on node [03:15] spoob: kris; I am interested in your efforts, can I subscribe to your newsletter? :) [03:16] ryah: steadicat: http://pastie.org/830189 [03:16] kriskowal: hah, yeah. it's in kriskowal/node/tree/narwhal-master [03:16] spoob: thanks. :) [03:16] kriskowal: it crashes half way through the bootstrapping inexplicably [03:16] deanlandolt: spoob: or http://groups.google.com/group/narwhaljs [03:17] spoob: dean; I'm glad to see so much interest in this topic! [03:18] spoob: cappuccino have just done a merger of jake and loader branches back to master, hence my resurrected interest [03:18] ryah: steadicat: it would be nice, of course, if nginx could do keep-alive proxying [03:18] ryah: i'd really like to write a fastcgi parser/bindign for node [03:19] steadicat: ryah: but my problem is even more basic than that [03:19] steadicat: when I call sendBody, node sends a chunk [03:19] steadicat: prefixed with the chunk length [03:19] steadicat: and nginx just outputs the chunk length to the client [03:19] ryah: steadicat: make sure you set your headers correctly [03:19] steadicat: instead of parsing ti [03:19] ryah: steadicat: Transfer-Encoding: chunked [03:19] steadicat: i'm just forwarding a reponse I get from another service, so it should be valid [03:19] steadicat: let me check [03:20] spoob: ryah; wouldn't node have a problem with CGI given the one-environment model of node vs separate contextes per CGI model? [03:20] ryah: spoob: what? [03:20] arlolra: ryah: (Feb 18 03:18) rev=[4f01c74e9f8cb9850ec48462809bc9ff3cbdcb1c] failure #0: failed git [03:20] spoob: ryah; node has one environment for everything, CGI scripts run in their own context [03:21] joshthecoder_ has joined the channel [03:21] arlolra: ryah: http://8.19.35.89:8010/builders/node.js-full/ [03:21] ryah: spoob: I'm not talking about CGI - i'm talking about fastcgi [03:21] ryah: no one uses cgi [03:21] spoob: fastCGI only has one context/environment then? [03:22] spoob: I'm not a web type, sorry. Unix/C, only moved to web browsers with cappuccino and webgl [03:22] ryah: spoob: fastcgi is just a protocol [03:22] JimBastard: lolz [03:22] JimBastard: so i got starcraft 2 installed and fired up, but without a valid cdkey i can't get into battle.net. [03:22] JimBastard: im going to cry myself to sleep now [03:22] JimBastard: and pray there is a single player crack by the morning [03:23] ryah: it's a http transport protocol [03:23] steadicat: ryah: it works now... -_- [03:23] tmpvar: JimBastard, thats what you get.. you fucking pirate [03:23] steadicat: ryah: I must have messed up the headers last time I tried [03:23] spoob: I was thinking that Apache runs as the server, and forks off per request (via CGI/FCGI). Hence separate context per connection. Node has one context for all of the connections [03:23] ryah: arlolra: rad - now i have to figure out what this means :) [03:23] steadicat: ryah: thanks [03:24] arlolra: it just says that git isn't installed on that solaris machine [03:24] JimBastard: tmpvar its really my fault for not applying for the beta sometime in the past 10 years [03:24] ryah: spoob: fastcgi is fast because it doesn't require a new process per request [03:24] arlolra: i'm setting up a buildbot slave on my lap to test it out [03:24] tmpvar: JimBastard, hah. [03:24] spoob: ryah; ah, so apache/fastcgi is single context and so is node, hence you wanting to have fcgi for node too. Gotcha. :) [03:24] tmpvar: HA [03:24] steadicat: ryah: there is an implementation of scgi for node: http://github.com/orlandov/node-scgi [03:25] ryah: arlolra: hm. /opt/local/bin [03:25] ryah: arlolra: i guess the path needs to be updated somehow? [03:25] tmpvar: ryah, do you have a public roadmap for node somewhere? [03:25] ryah: tmpvar: no [03:26] tmpvar: is that on purpose? [03:26] tmpvar: just curious, because there are days where i should be doing things, but I like to mix it up [03:26] ryah: tmpvar: http://pastie.org/830202 [03:26] ryah: tmpvar: i havent finished it yet [03:27] tmpvar: nice, thanks! [03:27] arlolra: ryah: oops, no, git is fine ... check the bottom of http://8.19.35.89:8010/builders/node.js-full/builds/0/steps/git/logs/stdio [03:28] ryah: arlolra: hm [03:28] ryah: arlolra: those are files that are symlinks [03:31] ryah: arlolra: could it be that they already existed somehow and it can't overwrite them? [03:32] tmpvar: ryah, beyond agreeing completely, how can you have a sub 1.0 "final" release? (Ideally, I'd like [03:32] tmpvar: the project to be complete after a few more months.) [03:32] mahemoff has joined the channel [03:33] arlolra: arlolra: i don't think so [03:33] arlolra: oops [03:33] ryah: arlolra: let's talk in PM [03:33] arlolra: k [03:39] ryah: tmpvar: hm? i guess we'll move to 1.0 [03:55] alexiskander has joined the channel [04:02] bpot has joined the channel [04:05] arlolra: anyone here want be a buildbot slave for node.js? [04:36] scudco has joined the channel [04:39] jashkenas: anyone played with getting Node integrated with Readline? [04:39] jashkenas: I know that it's on ryah's todo list. [04:48] bpot has joined the channel [04:55] [Pwner]John has joined the channel [05:00] brandon_beacher has joined the channel [05:04] [Pwner]John: well [05:05] [Pwner]John: 2.5 is the newest in apt-get [05:05] [Pwner]John: :\ [05:12] sztanphet has joined the channel [05:16] ryah: jashkenas: i was actually thinking about doing that tonigth [05:16] ryah: http://www.delorie.com/gnu/docs/readline/rlman_41.html <-- such a great api [05:16] ryah: a thing of beauty [05:16] jashkenas: Wonderful. If you do it, I'll start using it straight away. [05:17] jashkenas: Minimal. [05:20] micheil: ryah: node-repl wrapper with defunkt's rlwp [05:22] ryah: but that's an extra process [05:22] ryah: could just comile it in :) [05:22] ryah: plus i want command comleition [05:22] ryah: er [05:22] ryah: command completion [05:23] ryah: http://8.19.35.89:8010/grid <-- [05:23] ryah: :D [05:27] micheil: ryah: any ideas on implement glob() ? [05:27] argonoid has joined the channel [05:28] micheil: ryah: how do I add myself as a buildslave? [05:29] CIA-77: node: 03Ryan Dahl 07master * rc2e58c9 10/ (3 files): Remove a few wait() calls in the tests - http://bit.ly/8YA3wB [05:30] micheil: ryah: I've got a few thing's I'm wanting to implement on fs module: fs.glob, fs.mkdir_p, fs.rmdir_r, fs.rmdir_rf, fs.tree [05:30] ryah: micheil: i'm trying to figure that out myself [05:30] micheil: maybe using libev? [05:30] micheil: libeio can't do it [05:31] ryah: i meant the slave [05:31] micheil: oh [05:31] ryah: glob() is a bit hard [05:31] micheil: as for glob.. we could add it into libeio: [05:31] micheil: case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break; [05:31] micheil: only: [05:32] brainproxy has joined the channel [05:32] ryah: mkdir_p, rmdir_rf, should be done in js [05:32] micheil: case EIO_GLOB: req->result = glob (req->ptr1); break; [05:32] micheil: okay [05:32] micheil: I've got a js implementation (sync) [05:32] micheil: but it shouldn't be too hard to make an async version [05:33] teemow has joined the channel [05:44] micheil: ryah: would it be wise to also add to fs a fs.modeToPerm(mode); // 76895 => 0755 [05:44] micheil: or something [05:44] [Pwner]John: ryah [05:45] [Pwner]John: I installed Python2.6 [05:45] [Pwner]John: w/ alias python2.6 [05:45] [Pwner]John: good? [05:46] [Pwner]John: thread.error: can't start new thread [05:46] [Pwner]John: ^^ [05:46] dnolen has joined the channel [05:48] [Pwner]John: git pull: [05:48] [Pwner]John: error: Entry 'Makefile' not uptodate. Cannot merge. [05:49] [Pwner]John: nevermind [05:53] ryah: [Pwner]John: bummer [05:53] unomi has joined the channel [05:54] [Pwner]John: I fixed the Makefile thing [05:54] [Pwner]John: jobs=1 [05:54] micheil: [Pwner]John: I think git pull --ff may also help [05:55] [Pwner]John: k [05:55] micheil: also, ryah you must've been so damn busy today, 9 commits? :P [05:55] [Pwner]John: Checking for gnutls >= 2.5.0 : fail <-- Needed? [06:01] micheil: no [06:01] micheil: not needed [06:01] micheil: although, recommended [06:01] micheil: oh shit. I just realised that I removed my changes in my node checkout for chmod [06:03] [Pwner]John: Do you need sudo to do this? :p [06:05] [Pwner]John: start start_new_thread(self.__bootstrap,()) [06:05] [Pwner]John: would that be it if I put it in python? [06:05] [Pwner]John: :P [06:07] bacon has joined the channel [06:10] mikeal has joined the channel [06:11] micheil: ryah: working on fs.chmod now, and I'll get the docs up-to-date [06:11] micheil: what did you think re that comment on your docs changes the other day? [06:12] micheil: ryah: http://github.com/ry/node/commit/df94c763aef94756b2ebc0d655274c88903a825b [06:12] micheil: node.fs vs node.path, both have common functions I think [06:12] spoob has joined the channel [06:14] argonoid has left the channel [06:14] micheil: also, should we split the documentation on fs into two sections: Async and Sync [06:15] micheil: with a note at under those headings: When working with node, it is generally recommended that you use Async methods, however, occassionally you do need Sync operations. [06:15] micheil: or something [06:23] ryah: micheil: nah - let's leave the sync methods undocumented still [06:23] micheil: hmm.. okay [06:23] micheil: any reason? [06:24] ryah: shrug [06:24] micheil: because I have had a few people ask me (like my old boss ) about why there is something being used in one of the howtonode tutorials which isn't documented [06:24] cmlenz has joined the channel [06:24] ryah: I think we can just add a paragraph that says "there are also sync versions" [06:24] micheil: hmm.. [06:25] micheil: /fs.(\S+)Sync/ "fs.sync.$1" [06:25] micheil: instead of just adding Sync on to the end of the method name [06:26] micheil: so that it's totally isolated from async methods [06:30] micheil: ryah: also, make doc has issues [06:30] micheil: http://gist.github.com/307409 [06:33] [Pwner]John: l54832k9It <-- That is my new pass. [06:33] [Pwner]John: crud [06:33] [Pwner]John: wrong thing [06:33] [Pwner]John: So it won't work on this linux? [06:33] [Pwner]John: :\ [06:37] micheil: ryah: do you think it'd be possible to move away from WAF? [06:37] micheil: like, what does WAF give us? [06:40] micheil: I mean, as it is we have a makefile [06:40] micheil: and windows' users, if we ever port node to windows, they'll probably want a binary or compiled version, surely? [06:43] micheil: or is Waf just convenient because v8 uses it? [06:45] CIA-77: node: 03Ryan Dahl 07master * rcb32883 10/ AUTHORS : Add authors file - http://bit.ly/a3cGf9 [06:45] ryah: micheil: to what? [06:46] micheil: well, we could just use make [06:46] ryah: no [06:46] micheil: why not? [06:46] ryah: it's too complicated [06:46] micheil: okay [06:46] ryah: waf works [06:46] micheil: ACTION has written a few very basic makefiles, but could always learn the more indepth [06:46] ryah: ususally [06:46] micheil: ACTION is writing the tests for chmod [06:48] micheil: ryah: should I write tests for chmod on both file and directory? [06:48] ryah: nah, just a file is fine [06:48] ryah: just something simple [06:50] micheil: okay [06:53] chakrit has joined the channel [06:58] micheil: odd.. my test is crashing. [07:02] micheil: ryah: is there any way to get more information as to why a test is crashing? [07:08] ryah: micheil: hm - you can run gdb on it [07:08] micheil: gdb? [07:08] ryah: micheil: ./configure --debug && make [07:08] ryah: gdb --args ./node_g test/mjsunit/test-chmod.js [07:08] ryah: run [07:08] ryah: backtrace [07:17] edspencer has joined the channel [07:18] markwubben has joined the channel [07:31] edspencer has joined the channel [07:34] edspencer_ has joined the channel [07:38] chakrit1 has joined the channel [07:50] micheil: heh, I'm glad I wrote those tests, I'd buggered up the code to the async version [07:52] rictic has joined the channel [07:53] micheil: node> 33545 & 0700 [07:53] micheil: js> 33545 & 0700 [07:53] gbot2: micheil: 256 [07:53] micheil: js> 33545 & 0777 [07:53] gbot2: micheil: 265 [07:53] micheil: js> 33545.toString(8) [07:53] gbot2: micheil: Error: SyntaxError: missing ; before statement: 33545.toString(8) ......^ [07:53] micheil: js> (33545).toString(8) [07:53] gbot2: micheil: "101411" [07:53] micheil: js> (33545 & 0700).toString(8) [07:53] gbot2: micheil: "400" [07:54] micheil: js> (33545 & 0777).toString(8) [07:54] gbot2: micheil: "411" [07:58] _Pilate: js> node [07:58] gbot2: _Pilate: Error: ReferenceError: node is not defined [08:00] micheil: nevermind I got it.. [08:01] joshthecoder has joined the channel [08:02] scudco has joined the channel [08:06] tisba has joined the channel [08:13] cmlenz has joined the channel [08:20] micheil: ryah: would you be interested in adding a tmpfile implementation? [08:20] micheil: http://www.gnu.org/s/libc/manual/html_node/Temporary-Files.html#Temporary-Files [08:26] felixge has joined the channel [08:26] felixge has joined the channel [08:34] mahemoff has joined the channel [08:37] kjeldahl has joined the channel [08:40] piranha has joined the channel [08:40] kjeldahl has joined the channel [08:44] olivvv has joined the channel [08:51] markwubben has joined the channel [08:52] markwubben has joined the channel [09:08] dekz has joined the channel [09:16] phrearch has joined the channel [09:16] phrearch: hi [09:16] phrearch: is there websocket support for node.js yet? [09:20] Tim_Smart has joined the channel [09:28] micheil: yes [09:33] phrearch: i want to create a xmpp webclient with websockets, but im not sure whether i should use twisted or node for that [09:33] phrearch: at least for the serverside mediator [09:34] ijsthijs has joined the channel [09:35] Tim_Smart: phrearch: Node.js makes easy work of chat stuff [09:36] phrearch: yea, ill definitly have to try it soon [09:36] phrearch: not really sure what it can do yet [09:39] Tim_Smart: phrearch: Well I'll link you to my IRC client frame for IRC Bots, and it might give you an idea [09:39] Tim_Smart: *framework [09:39] phrearch: yea, ill need to read up a bit on it [09:40] phrearch: i need xmpp though. not sure how much of an efford that will be for js [09:40] mAritz has joined the channel [09:41] ijsthijs: xmpp is very extensive [09:42] phrearch: yes, and i dont really have the resources to invent the wheel, so i need to use existing implementations where possible [09:42] ijsthijs: ruby has some good implementations (stable) [09:42] phrearch: twisted has some xmpp support with wokkel, but i dont know if its good enough [09:42] micheil: ryah: I've just implemented a sync readdir, although, the sorting is a bit off [09:42] phrearch: im writing python :/ [09:43] ijsthijs: k :\ we use xmpp4r which works quite well and is easy to use [09:44] phrearch: hm looks good [09:46] ijsthijs: there are a couple of libs that use it (http://github.com/mojodna/switchboard/ for example) [09:51] kennethkalmer has joined the channel [09:52] jed has joined the channel [09:59] rtomayko has joined the channel [10:02] markwubben_ has joined the channel [10:02] felixge has joined the channel [10:02] felixge has joined the channel [10:03] mAritz has joined the channel [10:03] BBB has joined the channel [10:06] jspiros has joined the channel [10:06] Tim_Smart has left the channel [10:08] markwubben has joined the channel [10:08] tisba_ has joined the channel [10:20] kjeldahl has joined the channel [10:30] mahemoff has joined the channel [10:32] hassox has joined the channel [11:15] JonGretar has joined the channel [11:16] JonGretar: Hi.. [11:17] JonGretar: Just wondering if Node.js added anything like Array.include() to JS? [11:18] JonGretar: Not seeing it in the docs. But just decided to check. [11:31] tlynn_ has joined the channel [11:37] jed_ has joined the channel [11:42] ithinkihaveacat: JonGretar: what does Array.include() do? the array object does have filter(), map(), etc. [11:42] ithinkihaveacat: see http://wiki.github.com/ry/node/ecma-5mozilla-features-implemented-in-v8 [11:43] JonGretar: [1,2,3].includes(2) -> true [11:43] JonGretar: indexOf should work. [11:44] JonGretar: Writing an assert test. [11:48] JonGretar: assert.ok( [1,2,3].indexOf(2) > 0 ); works so I could use that. [11:48] JonGretar: thanks [12:02] happyelephant has joined the channel [12:16] micheil: JonGretar|away: rule of thumb is for language enhancements: underscore.js [12:25] JonGretar: micheil: Yeah. I was just going to try to do it without extra libraries. [12:26] micheil: fair enough :) [12:26] JonGretar: micheil: Updating the tests on a library that is not mine. Not cool to add extra libraries on a project that is not ones own. :) [12:27] micheil: true [12:32] micheil: js> {key: "value"}.forEach(function(){puts(arguments)}); [12:32] gbot2: micheil: Error: SyntaxError: syntax error: {key: "value"}.forEach(function(){puts(arguments)}); ..............^ [12:33] micheil: js> {key: "value"}.forEach(function(){sys.puts(sys.inspect(arguments))}); [12:33] gbot2: micheil: Error: SyntaxError: syntax error: {key: "value"}.forEach(function(){sys.puts(sys.inspect(arguments))}); ..............^ [12:33] micheil: js> var obj = {key: "value"}; obj.forEach(function(){sys.puts(sys.inspect(arguments))}); [12:33] gbot2: micheil: Error: TypeError: obj.forEach is not a function [12:33] micheil: hmm [12:37] alex-desktop has joined the channel [12:37] unomi has joined the channel [12:45] mahemoff has joined the channel [12:51] micheil: ryah: exists async should use the same pattern as the other async methods [12:51] micheil: (I'd argue it belongs in fs rather then path too) [12:52] unomi has joined the channel [12:52] cmlenz has joined the channel [13:01] markwubben has joined the channel [13:20] gf3 has joined the channel [13:23] felixge has joined the channel [13:28] micheil: felixge: what do you think? http://groups.google.com/group/nodejs/browse_thread/thread/41d5decfbbf065ce [13:31] olivvv: Hi. Is it planned to add dom support to node.js ? [13:41] micheil: probably not [13:41] micheil: olivvv: there's a list of DOM supporting modules on the modules page in the wiki [13:41] kriszyp has joined the channel [13:42] micheil: olivvv: my reasoning for saying probably not: think of node.js as the web server, not the platform, does apache or nginx have DOM support? [13:44] olivvv: micheil: well supports xpath, evenif it is not so convenient to use [13:44] kriszyp_ has joined the channel [13:44] olivvv: PHP [13:44] micheil: PHP isn't apache or nginx. [13:44] micheil: PHP is the platform [13:44] micheil: apache and nginx are the servers [13:45] olivvv: then what would be the platform on top of node.js ? [13:45] micheil: you then write and add on modules on top of node, eg, fu.js or express or whatever to make it more of a webserver stack [13:45] micheil: in the sense of sinatra style things or whatever [13:46] micheil: or, you go bare metal on top of node.js's http server, if that's your kind of thing [13:47] unomi has joined the channel [13:47] micheil: olivvv: see: http://wiki.github.com/ry/node/modules#web-frameworks [13:48] olivvv: micheil:thanks a lot [13:50] olivvv: I see there is already 7 template engines [13:50] micheil: yeah [13:50] micheil: although, none of those to my knowledge are DOM templating [13:50] olivvv: I dont like so many templates [13:50] micheil: they just use regexp's and stuff to substitute values [13:51] olivvv: back in the years with php we had also hundreds of template engines [13:51] olivvv: that is sometimes that makes code incompatible [13:51] micheil: olivvv: I would probably recommend either template.node.js or JSON Template [13:51] olivvv: something [13:51] micheil: olivvv: there's probably going to be thousands of modules for node [13:52] micheil: just the same as there are hundreds of javascript libraries. [13:52] micheil: it's our hacker instinct, "I think I can do XYZ better then Mr. X" [13:53] olivvv: yes, but see with modern frameworks we had just "view" on top of which we could plug template engines [13:53] olivvv: so ppl stopped using template engines [13:53] markwubben_ has joined the channel [13:53] olivvv: because views are just sufficient [13:54] olivvv: having a good common general rendering solution is good [13:55] pmuellr has joined the channel [13:56] alexiskander has joined the channel [13:57] micheil: olivvv: once again, this gets back to the fact that node isn't php or ruby or python or whatever. [13:57] micheil: node is more like the webserver, eg, apache, nginx, lighthttp [13:58] micheil: there are layers that can sit above node to make it act like a traditional webserver stack (apache+php, nginx+ruby, for example) [14:05] rolfb has joined the channel [14:09] alexiskander has joined the channel [14:13] kjeldahl has joined the channel [14:23] eelco has joined the channel [14:23] alexiskander has joined the channel [14:24] kjeldahl has joined the channel [14:26] unomi has joined the channel [14:31] davidsklar has joined the channel [14:34] Connorhd has joined the channel [14:39] guan has joined the channel [14:42] drostie has joined the channel [14:46] dnolen has joined the channel [14:49] kjeldahl has joined the channel [14:49] olivvv: micheil: I was wondering, how does flusspferd compare to node.js ? [14:49] micheil: hum-duh-um... [14:49] micheil: no idea. [14:50] micheil: :P [14:50] cloudhead has joined the channel [14:51] micheil: olivvv: possibly not as fast (v8 vs spidermonkey) [14:52] olivvv: but they are in the same category [14:52] olivvv: ? [14:53] Connorhd: flusspferd isn't as focused on async is it? I'm not sure it does async at all [14:54] micheil: I've never seen flusspferd [14:56] felixge has joined the channel [14:56] felixge has joined the channel [15:04] kriszyp: olivvv: I think you'd want to ask ashb about flusspferd, but from what I have seen, it is pretty good [15:04] unomi has joined the channel [15:09] atcrabtree has joined the channel [15:09] stepheneb has joined the channel [15:11] bru has joined the channel [15:11] bru: hallo world [15:13] olivvv: kriszyp:yes, i ve already been chatting with him [15:14] bru: question: are the API changes in 0.1.29 enforced or the deprecated ones still work for now? [15:22] bryanl has joined the channel [15:23] alexiskander has joined the channel [15:26] unomi has joined the channel [15:26] dnolen has joined the channel [15:29] [k2] has joined the channel [15:31] ithinkihaveacat has joined the channel [15:34] joshbuddy has joined the channel [15:34] joshbuddy has joined the channel [15:37] dnolen has joined the channel [15:38] qFox has joined the channel [15:43] Yuffster has joined the channel [15:44] keeto has joined the channel [15:44] keeto has joined the channel [15:49] unomi has joined the channel [15:51] arlolra has joined the channel [15:56] piranha has joined the channel [15:58] arlolra: If anyone wants to volunteer a server to act as a buildbot slave, let Ryan or I know. [16:00] gwoo: arlolra: anything in particular you are looking for? [16:01] gwoo: i have a small rackspace cloud machine with ubuntu karmic [16:01] arlolra: that would be great ... so far we have nothing [16:01] gwoo: oh well then no problem [16:01] gwoo: im gonna be working on it today [16:01] gwoo: what do i need to do? [16:02] gwoo: do you have a setup guide? [16:02] arlolra: hmm, i should write one [16:02] gwoo: that would really help me :) [16:02] arlolra: do you have an email i can reach you at? [16:03] arlolra: i will put something together and send it to you later today [16:05] gwoo: cool [16:06] guan has joined the channel [16:07] binary42 has joined the channel [16:07] stepheneb has joined the channel [16:14] sztanpet has joined the channel [16:19] creationix has joined the channel [16:21] gf3 has joined the channel [16:26] felixge has joined the channel [16:26] felixge has joined the channel [16:32] creationix: felixge: so you think continuables should always output a single argument? [16:33] felixge: creationix: yes [16:33] felixge: creationix: and I also think there should be a single callback [16:33] creationix: what about errors? [16:33] felixge: if you need an error, it ought to be instanceof Error [16:33] creationix: yes, I do agree that errors should be Error instances, makes them more like exceptions [16:34] felixge: well, exceptions don't have to be instanceof Error [16:34] creationix: but if it's a single callback, then it's the responsibility of the person writing the callback to check the typeof every time [16:34] felixge: but lacking a better language construct, I think this is the way to go [16:35] felixge: also when you use Error instances, and you choose to later throw them, the backtrace picks up on where the Error object was create I think [16:35] felixge: creationix: it is, this is why I like bentomas continuable library [16:35] felixge: and I'd like to push for node to include that [16:36] felixge: basically here is how it works [16:36] creationix: yeah, the bentomas library seems a lot like promises with continuable syntax [16:36] felixge: if your callback gets an Error passed as the argument [16:37] felixge: and you do not return a non-error value from that callback [16:37] felixge: an exception is thrown in the next tick [16:37] felixge: creationix: well, it's not [16:37] felixge: I think single callback / single value make a big difference [16:37] felixge: but yeah it tries to do the same things promises do right now [16:38] creationix: felixge: My main goal is to get the syntax as slim and easy to read as possible without requiring a huge library [16:38] creationix: but I think the other options should be there for people who prefer them [16:39] felixge: I would like to have a library for continuables [16:39] felixge: brb, 10min [16:41] inimino: hm... [16:42] creationix: I think someone should write up a good comparison of the various methods with concrete syntax for comparison [16:42] inimino: creationix: do it :) [16:43] inimino: felixge: I think error testing using typeof is unnecessarily limiting [16:44] felixge: inimino: why? [16:44] inimino: (I mean instanceof) [16:44] creationix: my biggest aversion to promises and bentomas style continuables is mainly the requirement to create an object, mess with it and return it. Just a preference thing [16:44] inimino: felixge: because instead of something that is fully general, now you have something that only works in specific cases [16:44] bpot has joined the channel [16:45] creationix: I'm fine with errors being instanceof Error, I just don't like having to manually check and pass it on on every use [16:45] felixge: inimino: an object can wrap any value, so it works in any case. It may not be the most efficient thing in some cases so, I agree. [16:46] creationix: Error instances have stack traces built in, that's the best part i think [16:46] inimino: felixge: it doesn't work in any case. You can never successfully return an Error object. [16:46] felixge: * inimino I meant creationix , sorry [16:46] felixge: inimino: yes that is true. Why would you? [16:46] felixge: I dislike that fact myself [16:47] felixge: but it seems a good constraint to make the whole thing a lot simpler [16:47] inimino: felixge: well, I tend to put the burden of proof (or of finding usecases) on the case that breaks consistency [16:47] inimino: the nice thing about continuables is that they are fully general [16:47] felixge: inimino: consistency with what? [16:47] inimino: the returned type can be anything [16:48] felixge: inimino: you can't fully abstract the behavior of function calls, period. So why bother? [16:48] felixge: Close enough is good enough for me [16:48] inimino: the Either convention is just there for things that happen to return either an error or success result, but continuable utility functions (like the timeout()) on the list) don't have to care what the type is [16:49] voodootikigod: ryah: yt [16:49] unomi has joined the channel [16:49] rtomayko has joined the channel [16:50] creationix: felixge: inimino: I'm writing up a quick syntax comparison, will post gist soon... [16:50] felixge: Well, I think bentomas continuables make the right tradeoffs. I don't like the other ones [16:50] felixge: creationix: cool [16:50] inimino: felixge: well, I want node to stay low-level... [16:51] felixge: inimino: in that case I vote for plain callbacks [16:51] inimino: me too [16:51] felixge: but you still need a way to handle errors with those [16:51] creationix: me too [16:51] felixge: and for that I vote instanceof Error [16:51] creationix: seperate errback callback works [16:51] felixge: creationix: not for me [16:51] inimino: yes [16:51] inimino: felixge: then use a continuable library [16:52] inimino: you can use bentomas's library (which isn't what I consider a continuable at all, but...) [16:52] creationix: felixge: I'll an example with plain single callback too [16:53] inimino: and there'll be kriszyp's promise library, and plenty of choices for everyone :) [16:53] felixge: inimino: I have to go through tons of boilerplate code for each node function I'd be calling [16:53] felixge: actually, there is one thing that would make me re-consider [16:53] inimino: felixge: what do you mean? [16:53] felixge: if you do not bind an error callback, and an error occurs - it throws [16:53] inimino: felixge: if you use a library it will wrap all those for you [16:54] inimino: felixge: isn't that what those functions do now? [16:54] inimino: the ones in fs and so on [16:54] felixge: inimino: what functions? [16:54] felixge: inimino: no, they do not have a seperate error callback afaik [16:54] mAritz: general web-programming question: i've got a bunch of times as string in this format: dayofweek + 24h (for example monday 09:00 -> 19). i also have a function that converts these times to the timezone of the requesting user. however i just can't figure out how to handle daylight savings. how the hell do websites normally do that? :/ [16:55] inimino: felixge: well, true, currently I have to do testing on each one's return value [16:56] inimino: mAritz: you let the browser do it [16:57] mAritz: inimino: how? [16:57] creationix: felixge: actually I'm starting to see the beauty of single callback, it magically works some time without checks. On to more prototyping... [17:00] felixge: creationix: I think the real beauty is when it comes to aggregation of multiple async operations (like your do library). [17:00] voodootikigod: creationix: you have a blog running right now for node.js learning right [17:00] voodootikigod: creationix: can you pass me the url right quick [17:00] felixge: creationix: because now you can just assume that there is a single value, and that this value communicates it all. No need to have an additional indicator for each value to declare its type [17:00] creationix: howtonode.org [17:00] inimino: creationix: the rightContinuation function in fileIO is pretty nice too [17:00] voodootikigod: thanks [17:01] stepheneb has joined the channel [17:01] JimBastard has joined the channel [17:01] creationix: felixge: here's the first couple examples https://gist.github.com/602efd6a0d24b77fda36 [17:01] JimBastard: hey binary42 you busy? was hoping I could bug you about location.hash routing in rails, our rails team is having issues getting the serverside parts to work [17:01] binary42: JimBastard: Can it wait till lunch? [17:02] JimBastard: i mean, im asking for help. so whenever you can would be awesome [17:02] JimBastard: if you arent too busy [17:02] inimino: creationix: you don't need those return statements [17:02] binary42: JimBastard: Cool I'll ping you in a few. [17:02] inimino: (well, you don't need 'return') [17:03] creationix: inimino: they're there to end the function body [17:03] creationix: don't need the return value [17:03] creationix: shorter than nested else blocks [17:04] creationix: maybe I should write callback(data); return; [17:04] creationix: then it would be explicit what the returns are doing [17:04] inimino: oh well, I see now [17:04] inimino: I considered writing some that way but thought it would be confusing... but maybe it's fine [17:05] inimino: it is shorter [17:05] JimBastard: morning inimino [17:06] adamv has joined the channel [17:07] RayMorgan has joined the channel [17:07] inimino: hey JimBastard [17:08] inimino: creationix: I'm writing another example... I'm not sure about calling the callback with no content if the file is not a regular file though... [17:08] inimino: I'm going to make that an error [17:09] creationix: well, that's just part of my filter_map api. It filters out when the value is undefined [17:09] gwoo: darn my build bot failed http://8.19.35.89:8010/waterfall?show=builder3 [17:09] mAritz: inimino: can you give me a slight hint as to how to solve daylight issues with browserstuff? [17:09] inimino: well it makes the example shorter so I'll copy it [17:09] gwoo: permissions [17:09] inimino: mAritz: use the methods of Date() [17:10] mAritz: hm. ok. i'll look into it. thanks [17:10] inimino: `g mdc Date object [17:10] gbot2: Date - MDC - https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Date [17:10] inimino: mAritz: ↑ [17:12] creationix: felixge: inimino: Updated the gist to have node style promises as well [17:12] creationix: https://gist.github.com/602efd6a0d24b77fda36 [17:12] inimino: creationix: also you have if (data instanceof Error) { return callback(data); } [17:12] creationix: yep [17:13] inimino: (oh, right, you only have one callback) [17:13] inimino: creationix: so why are you testing it then? [17:13] creationix: huh? [17:14] inimino: the next line is callback(data) [17:14] creationix: ahh, good point [17:14] inimino: so if it's an instanceof Error or it it's not, you do the same thing [17:14] creationix: it's the same thing for that simple case [17:14] felixge: creationix: your example is highly biased towards your preferred solution ;) [17:14] inimino: creationix: https://gist.github.com/5b8af1bf20bb7ee4a53f [17:15] felixge: creationix: as you focus on the producers, not the consumers of continuables [17:15] creationix: felixge: no I have two consumers and one producer [17:15] inimino: creationix: the rightContinuation function is from fileIO [17:15] felixge: creationix: also, use consistent code formatting [17:15] creationix: the fs module is assumed to be of the same style [17:16] creationix: ok, updated the second example to shortcut the inner block [17:16] felixge: '{' should always be followed by a newline [17:16] felixge: ';' should always be followed by a newline [17:17] felixge: creationix: and no, you have no consumers in your example. You only have middleman [17:17] felixge: creationix: consumers would be the place where you invoke the function [17:17] creationix: fs.stat and fs.readFile are consumers [17:17] scudco has joined the channel [17:18] felixge: no, you are composing [17:18] inimino: sure, add some examples of use too [17:18] inimino: anyway, bbl [17:18] creationix: felixge: want me to consume my test_and_load too? [17:18] inimino: ACTION is glad to see continuables somewhat catching on [17:20] felixge: I do think your example is intriguing so [17:21] inimino: creationix: what do you think about the solution with Either? [17:21] inimino: felixge: by the way, an example of where you'd return an Error result successfully is an an asynchronous process that runs arbitrary code [17:22] felixge: inimino: you could still wrap that in an object [17:22] creationix: inimino: not sure, the rightContinuation hides it [17:22] inimino: (I am using Web workers to do this in the browser) [17:23] inimino: creationix: yeah, that's the benefit [17:23] ithinkihaveacat: with promises, could you inherit (i.e. share) the error handler? [17:23] inimino: felixge: ah, well, you're arguing for the same thing I am, then, I suppose [17:24] inimino: felixge: i.e. a continuable just returns "something" and it's up to the caller and callee to determine what type it has [17:24] ithinkihaveacat: with the single combined callback style, how would multiple callbacks share the same error handler? [17:24] creationix: inimino: your's makes me think of Promises converted from OO style to functional style [17:25] creationix: ithinkihaveacat: it's not and that's a good thing [17:25] unomi has joined the channel [17:26] creationix: functions can't return to more than one caller [17:26] inimino: creationix: well, it's not quite promises, but it's just continuables with an extra convenience function (which I found very handy when writing the rest of fileIO which contains a lot of functions like this one) [17:26] felixge: creationix: https://gist.github.com/4d701f34fc4e046a6684 [17:26] creationix: inimino: fair enough, it's a very different style [17:26] felixge: I reformatted your example on top, and added one using bentomas style continuables below [17:26] felixge: you win by 1 line, but you don't provide nearly the same features with the example [17:27] creationix: felixge: yep, good example [17:27] steadicat has joined the channel [17:27] felixge: but I am intrigued [17:28] creationix: mine is better if you have several levels since you don't need the three line instanceof check, but the other is better for the simple leaf nodes where you can compact it all in [17:28] felixge: with your approach [17:28] felixge: the fact that it does not need a library is very interesting [17:28] arlolra has left the channel [17:28] felixge: big bonus [17:29] felixge: the big disadvantage is that you cannot enforce single value callbacks [17:29] creationix: felixge: I think we'd have to write a non-trivial program to see which style is better in real use [17:29] felixge: * single argument [17:29] felixge: people can, (and will), pass multiple arguments to their callbacks [17:29] felixge: and since you have two callbacks, any aggregation function for grouping/chaining will need to take that into account [17:30] creationix: felixge: like Do.parallel does is you pass it multiple arguments [17:30] felixge: which increases complexity by a lot [17:30] creationix: well, depends on what kind of aggregation [17:30] felixge: like parallel [17:30] felixge: lets say you want to to group 2 calls [17:31] felixge: which can be success/error [17:31] felixge: and they have multiple arguments to their respective callbacks each [17:31] felixge: you get a pretty nasty data structure for the "overall" results [17:32] creationix: felixge: my Do.parallel doesn't emit success if any of the parts of it emit error [17:32] creationix: you'll never get, for example, one result and one error [17:32] creationix: either two succeses or one error [17:32] Booster has joined the channel [17:33] felixge: creationix: hm [17:33] felixge: creationix: so you discard the additional result that you may get? [17:33] felixge: in case there was an error [17:33] creationix: felixge: yes, they're collected, but never emitted since the counter never reaches zero [17:34] felixge: creationix: ok, I might be changing my mind here [17:34] felixge: I still think we should make it best practise to emit a single argument so [17:34] felixge: but I like thi [17:35] felixge: * this [17:35] pdelgallego has joined the channel [17:36] felixge: gotta head out for JS user group meetup now [17:36] creationix: alright, take care [17:39] ithinkihaveacat: creationix: do you have any examples of function composition? [17:39] ithinkihaveacat: a map of a map, say? [17:39] edspencer has joined the channel [17:40] creationix: what would a map of map do exactely [17:40] creationix: the readme in do has some composition http://github.com/creationix/do [17:40] ithinkihaveacat: am wondering because the signature of the function used inside the map function is different to the map function itself [17:41] creationix: ithinkihaveacat: I just release a change to that. The filter function can now be a regular continuable [17:41] ithinkihaveacat: well, you might have a function to remove space from the start of a string, and another to remove spaces from the end [17:41] ithinkihaveacat: (silly example, maybe) [17:41] ithinkihaveacat: you could use a chain [17:42] creationix: an async example might be to take a list of directories and map them to listing of files, and then map each of those to the contents of the file? [17:42] ithinkihaveacat: but, with non continuables, you can do [a, b, c].map(function(s) { return s.trimLeft(); }).map(function (s) { return s.trimRight(); } [17:43] creationix: yep, sync code is much easier [17:43] creationix: I'll write a quick example, just a sec... [17:47] scudco has joined the channel [17:48] ithinkihaveacat: creationix: btw, i'm wondering if Do.reduce() is a better name for Do.chain(), it's pretty much an async version of Array.prototype.reduce [17:49] creationix: hmm [17:50] creationix: it is very reduce like [17:50] creationix: except there is no initial value. The first item is special instead [17:50] creationix: and each step is different unlike a reduce [17:52] ithinkihaveacat: what do you mean by each step being different? [17:54] creationix: in a traditional reduce, a single callback is called over and over against an aggregate value [17:54] ithinkihaveacat: if your steps are [ s1, s2, s3 ] you want to end up with s1(initial)(s2(s3)) [17:54] creationix: chain passes the value along the same, but it's a different callback [17:55] creationix: ahh, you're saying that the continuables are the value, and the common callback is just evaluating them [17:56] ithinkihaveacat: oh, yes, the common callback will be exactly the same for every Do.chain() [17:56] creationix: then it's not so much a reduce since the common callback isn't user specified [17:57] ithinkihaveacat: that's true [17:57] creationix: and I'm not sure how a user-specified callback would work in this case, I'll add one if there ever arises a use case for it [17:57] ithinkihaveacat: you don't actually want it to be user specified (since it's the same for every Do.chain) [17:58] ithinkihaveacat: the process feels very reduce-like to me though [17:58] creationix: "map", "filter", and "filter_map" are very different from "parallel" and "chain" [17:58] creationix: with "map" and friends, the data source is a plain array with arbitrary content, and the user specified callback is a continuable [17:58] creationix: with "parallel" and "chain" the data source is an array of continuables and the callback is not user specified [17:59] stephenlb has joined the channel [17:59] ithinkihaveacat: that's true of non async map/filter and reduce though--map/filter take one argument, and return many (potentially)reduce's callback takes twornsgle value [18:00] ithinkihaveacat: wow, lost some characters there [18:00] cmlenz has joined the channel [18:00] ithinkihaveacat: reduce's callback takes two arguments, and returns a single value [18:01] creationix: well as far as renaming, I may want to add a reduce that reduces an array of arbitrary content using async callbacks [18:01] creationix: that's the one that should be called reduce, not the current chain [18:01] cmlenz has joined the channel [18:01] ithinkihaveacat: sorry, have to head off, back in a few hours [18:01] ithinkihaveacat: hrm good point [18:01] creationix: that's cool, thanks for the input [18:05] mikeal has joined the channel [18:09] stepheneb has joined the channel [18:30] CIA-77: node: 03Micheil Smith 07master * rbcc032e 10/ (4 files in 3 dirs): Adding interface between node and libeio for Chmod. - http://bit.ly/cCG2WK [18:30] CIA-77: node: 03Rasmus Andersson 07master * r3bb7ad6 10/ (src/node.js test/mjsunit/test-process-mixin.js): fixed process.mixin to properly copy getters/setters - http://bit.ly/9etJAv [18:30] CIA-77: node: 03Ryan Dahl 07master * rc5de1b6 10/ AUTHORS : fix email in AUTHORS - http://bit.ly/a1bnhl [18:37] markwubben has joined the channel [18:39] piranha has joined the channel [19:03] kriskowal has joined the channel [19:08] creationix: inimino: Do you know how to pass an error through with bentomas's library, I'm having throuble porting the example to it [19:09] inimino: creationix: I haven't looked at it that closely I don't think [19:09] ijsthijs has joined the channel [19:10] creationix: it's an interesting hybrid of continuables and promises for sure [19:11] hecticjeff has joined the channel [19:12] creationix: inimino: just to be sure we're on the same page. Your use of rightContinuation means that any errors are automatically passed through? [19:12] inimino: creationix: yeah [19:12] creationix: and then your cont(Left(...)) is a way of manually triggering an error [19:12] inimino: creationix: basically yeah [19:13] inimino: (Left could mean anything, using it for an error is just a convention) [19:13] isaacs has joined the channel [19:13] inimino: one of the things I wanted to do was separate continuables from error handling [19:14] inimino: so you could do everything with continuables without actually using the Either type [19:16] dnolen has joined the channel [19:17] creationix: I see [19:17] ryah: creationix: sorry about missing you on the AUTHORS [19:17] creationix: ryah: not a big deal, I was just curios as to where I stood on the list [19:17] ryah: i did a little hand-editing and must have inadvertently deleted that line [19:18] maritz has joined the channel [19:18] creationix: we could write a script that automates it from the git log. We'd just need a list of aliases for people like me who committed under a few emails [19:19] rednul_ has joined the channel [19:19] ryah: git log --pretty=format:"%an %ae" | tail -r | uniq [19:19] creationix: nice [19:19] ryah: but that's not exactly it [19:21] ithinkihaveacat has joined the channel [19:27] isaacs: ryah: yeah, lotta repeats there [19:29] ryah: my awk skills could be better [19:29] ryah: meh [19:29] creationix: git log --pretty=format:"%an %ae" | tail -r | awk ' !x[$0]++' [19:30] creationix: it's close [19:30] ryah: nice [19:31] Connorhd_ has joined the channel [19:33] dnolen has joined the channel [19:33] creationix: iniminio: I added bentomas "continuables" and promises to my example https://gist.github.com/602efd6a0d24b77fda36 [19:33] creationix: also changed your example to work exactly like the others [19:34] piranha has joined the channel [19:35] inimino: creationix: cool [19:36] creationix: hmm, seems I have a syntax error in your style, just a sec... [19:36] inimino: creationix: so what I hope will happen is that node will stay low-level, and people who like promises will build nicer promise libraries than what node has now (like kriszyp is doing) and then we can have some continuable stuff and everyone will be happy [19:36] creationix: yep, fine with me [19:36] inimino: creationix: yeah, I think it reads better with 'else' [19:36] ryah: isaacs: foohack or izs? [19:36] isaacs: ryah: i like izs better [19:36] isaacs: shorter [19:37] inimino: (but I guess that's similar to the other examples so that's fine either way) [19:37] markwubben has joined the channel [19:37] ryah: creationix: http://pastie.org/831315 [19:38] creationix: fair enough, looks like it's ordered by actual commit date and not when the patch was made [19:38] ryah: yeah [19:38] creationix: which is what git log does [19:38] ryah: commit date is good because i'm sure i clobber actual dates fairly often [19:39] inimino: creationix: also, readFile would probably generate a nice diagnostic error in case the filename was a directory or something, so some of the examples could be simplified further [19:39] Tim_Smart has joined the channel [19:39] inimino: (but that would kind of miss the point of the example I guess) [19:39] inimino: anyway [19:39] inimino: ACTION gets back to work [19:40] creationix: ryah: what all uses promises other than the fs module. Pretty much everything else is eventEmitters, no? [19:41] ryah: creationix: dns [19:41] ryah: http.ct [19:41] ryah: cat [19:41] creationix: ahh yes, there are a few [19:41] kriskowal_ has joined the channel [19:42] stepheneb has joined the channel [19:42] creationix: ryah: what do you think about moving all of those to simple callbacks and shipping a nice promise library separate? [19:43] ryah: i'm torn [19:43] ryah: on the one hand, i want less to maintain [19:43] creationix: I'm mainly thinking about overhead here for all the people who'd like to use something other plain node promises, but if it's not that much overhead, I don't mind wrapping around promises [19:43] ryah: yeah [19:44] creationix: you could still ship promises with node, and have a promise version of fs that wraps the base fs [19:44] kriskowal_ has joined the channel [19:44] ryah: yeah - moving promises out of src/node.js is necessary [19:44] ryah: and we should be sure that all APIs expose just a normal callback interface [19:46] creationix: sounds good to me if that's what you want [19:47] Booster has joined the channel [19:48] jan____ has joined the channel [19:48] jan____: hi [19:48] markwubben has joined the channel [19:49] creationix: jan___: hi [19:49] rtomayko has joined the channel [19:51] mahemoff_ has joined the channel [19:55] ijsthijs: finally put my tiny node project live :) [19:56] creationix: isjthijs: congrats, got a link? [19:56] bentomas has joined the channel [19:57] ijsthijs: It's a small part really ;) http://www.dispostable.com/ the realtime new message notifications [19:58] bentomas: inimino: I agree that node-continuables isn't true continuables, when I named it I wasn't clear on the difference. Though it is trivial to make it a "continuable" that doesn't do processing until a callback is added [19:59] teemow has joined the channel [19:59] bentomas: creationix: if you want an error to propagate you either return it again or return nothing [19:59] ijsthijs: would be cool to have it entirely in node (the iframe/ajax solution is kinda hacky) [20:00] bentomas: creationix: the big difference between my library and straight up continuables is that mine builds in basically your Do.chain function. So that the work is put on the developer as opposed to the user [20:01] creationix: bentomas: so did I get your code right in my gist example. I wasn't sure [20:02] creationix: https://gist.github.com/602efd6a0d24b77fda36 [20:02] bentomas: creationix: and we are assuming the fs library is written in the same style? [20:02] creationix: yep [20:03] creationix: of course the example doesn't show everything, there is no use of either since it's not needed in this case, for example [20:03] bentomas: yeah, I'm updating it some [20:03] mikeal has joined the channel [20:03] dnolen has joined the channel [20:05] bentomas: creationix: https://gist.github.com/gists/5eacac27eabc6f585f6a/edit [20:06] bentomas: ooops [20:06] bentomas: there [20:07] creationix: can't see it [20:07] creationix: ok, now I see it https://gist.github.com/5eacac27eabc6f585f6a [20:08] bentomas: (it is obviously untested, but that's the idea) [20:08] bru has joined the channel [20:09] creationix: so return values are very meningful, interesting... [20:09] creationix: line 10 should be return undefined, not return null, but that's unimportant [20:09] creationix: or just return I guess [20:11] rictic has joined the channel [20:11] bru has joined the channel [20:12] kennethkalmer has joined the channel [20:12] bentomas: creationix: well, hmmm. if you return undefined (or nothing) then it sends the previous value to the next callback. it never occurred to me that you would want to return undefined. I'd have to change it so that you have to return something (so that it doesn't automatically pass along the last value) [20:13] bentomas: though, at this point I'm kind of giving up on the library, there are too many competing ideas out there and I just want to go with the flow [20:13] maritz has joined the channel [20:13] creationix: well, I only return undefined in this case because that's how the problem was defined, it's not a big constraint to say you can never return undefined for a value [20:15] bentomas: ahh, I see felixge did a version using mine too. his is good as well: https://gist.github.com/4d701f34fc4e046a6684 [20:16] bentomas: creationix: are you going to update your example file with either of those? I think they are more representative of how the library is supposed to be used... [20:16] creationix: yes, working on it [20:16] bentomas: ooops, sorry, you just did! [20:16] creationix: well, the second one is supposed to be Felix's example, but I see I changed the semantics when I reformatted it [20:17] bentomas: still works I thik [20:17] bentomas: this example page is great by the way, it is nice to be able to compare all the different styles directly [20:18] bentomas: I do like the "simple continuable with single combined callback" style a lot [20:19] bentomas: quick question, what if I want to perform an action, and may add a callback later, but may not. with the continuable style you are using with Do.chain that doesn't seem possible, the only way to get it to run is to add a callback, is that right? [20:20] creationix: bentomas: correct, why would you want to run something without attaching a callback? [20:21] creationix: I curious, not criticizing [20:21] bentomas: an update clause on a database for example. I want to send it off to be updated but don't care when it finishes [20:21] bentomas: or in a website for logging or something [20:21] bentomas: where you don't need to pay attention to when it finishes [20:21] creationix: action(param)() [20:21] inimino: bentomas: if you don't care you can pass function(){} [20:22] creationix: yeah, that's better, not passing anything may be a problem [20:22] bentomas: inimino: yeah... [20:22] inimino: (but it's a rare case) [20:24] bentomas: and this is more of a semantic issue but with simple continuables (which by the way, I LIKE) calling a function "test_and_load" isn't exactly accurate [20:24] bru: sorry to repeat the question from early on, but will current node applications (developed for an earlier version) work with after the api changes in 0.1.29? [20:24] cmlenz has joined the channel [20:24] bentomas: because it doesn't do testing or loading, it returns a function which itself does that [20:24] creationix: bentomas: Ok, I cleaned up the examples a bit and put a note in the header about your version returning null instead of undefined [20:24] inimino: bru: not without some updates [20:25] inimino: bru: nothing a little :%s/foo/bar/gc won't fix though [20:25] bentomas: creationix: looks great [20:25] creationix: bentomas: yeah, your stuff works different than I first imagined. It's neat though [20:25] bru: inimino: thanks, I was trying to fiddle a bit with node.websocket.js and it doesn't fail... though clearly something is wrong with it [20:26] creationix: I'll post a link to the mailing list since there has been a lot of confusion on the various styles. [20:26] bentomas: creationix: another interesting example would be using each of these libraries to do both chaining and grouping [20:26] creationix: I think I should add an example from Kris's style too though [20:26] creationix: bentomas: yes, but that's a bit more work, maybe I'll write an article about it for howtonode.org [20:27] bentomas: well, if I can help just tell me. I'm not as familiar with the other styles as you are, but I could write some too [20:28] creationix: kriszyp: would your version of promises work any different than node's for the simple example I'm working on? https://gist.github.com/602efd6a0d24b77fda36 [20:29] tmpvar has joined the channel [20:29] kriszyp: hmm, let me consume this... [20:31] bentomas: creationix: you're Do library looks really useful. I'm not crazy about the parralel works. If any one of them returns an error you return just the first error found. is that correct? [20:31] kriszyp: I'll fork it and show my versions (not I have two libs) [20:31] kriszyp: s/not/note [20:31] creationix: bentomas: correct [20:31] bentomas: s/the parralel/the way parallel/ [20:31] creationix: kriszyp: thanks [20:32] bentomas: because all of the continuations can potentially have side affects it seems pretty useful to me that even if one of them errors that you get the results so you know what happened [20:32] creationix: bentomas: yes, I thought about this, but I decided to err on the side of simplicity and ignore the 10% of cases where it won't work [20:33] bentomas: ahhh... makes sense [20:33] creationix: the Do api is still changeable (unless the 50+ followers I got almost overnight are already using it in production code) [20:34] bentomas: 50+ wow, nice. Overnight it became more popular than all of my github projects combined :) [20:34] bentomas: (not that it was undeserved popularity, mind you!) [20:34] creationix: well, "almost" overnight, it was more like 36 hours to hit 50 [20:35] inimino: bentomas: I use something which just collects all the results (whatever they might be) [20:35] bentomas: is yours in your FileIO lib? [20:36] inimino: no, it's somewhere else... [20:36] inimino: ACTION looks... [20:36] kriszyp: here it is: https://gist.github.com/080f933af31a575dbc59 [20:36] inimino: http://boshi.inimino.org/3box/revstore/dispatch.js search for "parallel" on this page, second hit is where it's defined [20:36] inimino: (right below // XXX put this somewhere else, probably in a module for handling these kinds of things) [20:37] kriszyp: both of them are shorter than any of the continuable-based approaches [20:37] inimino: ACTION sighs [20:37] creationix: thanks Kris [20:37] kriszyp: (and of course easier to read, IMO, but that's completely subjective ;) ) [20:38] creationix: kriszyp: how do they handle errors in stat and readFile? [20:38] kriszyp: they propagate [20:38] kriszyp: just like how you are doing in your continuables [20:39] creationix: oh, I see, you're returning them like bentomas does [20:39] kriszyp: except it is automatic with promises [20:39] bentomas: kriszyp: I agree, of all the options Promises are the most readable. I wish CommonJS promises didn't return a new Promise object each time "then" is called [20:39] kriszyp: the promise returned from test_and_load is supposed to be in an error state if stat or readFile have an error, right? [20:40] deanlandolt: bentomas: then don't use then, use when [20:40] kriszyp: my when returns new promises too [20:40] deanlandolt: you need then to return a promise so it can be chained [20:40] deanlandolt: err...okay, use whenPreservingType ;) [20:41] deanlandolt: (that /really/ needs a better name!) [20:41] kriszyp: the cost of creating new promises on v8 is ridicilously trivial compared to normal async operations and the reduced hazards of mutations, that it seems incomparable to me [20:41] bentomas: deanlandolt: I don't like when. I don't like that I have to require the function [20:41] bentomas: kriszyp: touche [20:42] kriszyp: and this is why I created two libs :) [20:42] kriszyp: some people like requiring, some monkey patches :). I don't care that much myself [20:42] deanlandolt: bentomas: presumably there could be a thenPreservingType corralary [20:42] creationix: kriszyp: just to make sure I understand, the empty return on 99 and 112 will emit a success event with undefined as the value? [20:42] deanlandolt: you'd have to monkeypatch though [20:42] kriszyp: yep [20:43] kriszyp: creationix: that's correct [20:43] bentomas: kriszyp: I thought emitting undefined made it use the fulfillment value... [20:43] creationix: kriszyp: and this example doesn't show it, but, how would I emit an error instead if I wanted [20:43] kriszyp: throw new Error("somethign went wrong"); [20:43] deanlandolt: creationix: throw new Error [20:44] creationix: oh, so "then" and "when" wrap the call in a try...catch? [20:44] kriszyp: yes [20:44] creationix: nice, I approve :) [20:44] deanlandolt: well, when wraps then which wraps the call i believe [20:44] bentomas: is that the only way? what if I decided to add a setTimeout? [20:44] kriszyp: and I was assuming that readFile could potentially throw an error [20:44] kriszyp: setTimeout(funtion(){throw new Error()}) is impossible to catch, no matter how I code my library ;) [20:45] creationix: yep, but you're returning a promise, so it's cool (fs.readFile()) [20:45] kriszyp: this is why it is more convenient to stay in the realm of promises, IMO [20:46] kriszyp: instead of using setTimeout, you delay(1000).then(function(){ throw new Error()}) and you'll get a promise in an error state (instead of an uncaught error) [20:46] bentomas: right, so is there a way to get a promise in an error state without throwing, so you can potentially do it from a setTimout (or other async callback from a function that doesn't use promises) [20:46] kriszyp: I suppose I should add a delay function to my library... [20:46] kriszyp: yeah, emitError still works [20:46] bentomas: ahh, right, that's what I thought [20:46] kriszyp: promise.emitError is fine, I am not clobbering process.Promise or anything [20:46] kriszyp: I attempted to be pretty minimalistic [20:47] kriszyp: I didn't do the full deferred/promise secure pair thing that the ocap people prefer [20:47] kriszyp: didn't think that was desired too much in #node.js [20:48] bentomas: alright, well back to work for me [20:48] bentomas: creationix: thanks again for creating that gist, great idea! [20:48] bentomas has left the channel [20:48] kriszyp: yeah, good idea, that helped me too, to understand the different ideas out there [20:48] creationix: I'm going to post it to the mailing list now to clear up some of the confusion [20:50] steadicat has joined the channel [20:51] stepheneb has joined the channel [20:52] markwubben has joined the channel [20:56] markwubben has joined the channel [20:58] creationix: alright, email sent. Hopefully there won't be too much bike-shedding over this. [20:58] JoePeck has joined the channel [20:59] ryah: creationix: you shoul dhave copied the gist into the email [21:00] creationix: oops [21:00] markwubben_ has joined the channel [21:00] ryah: unnecessary coupling :) [21:00] creationix: I can send another if you want. I'll even color code it for email with html? [21:01] creationix: yeah, I think I will, gist have been down more than I like lately [21:04] unomi: hey ryah what kinds of servers are you looking for? [21:04] Connorhd_ has joined the channel [21:04] micheil: ryah: LGTM? [21:06] micheil: ryah: Path module merged into URL module? that makes no sense [21:08] dnolen has joined the channel [21:09] maritz has joined the channel [21:12] ryah: micheil: why not? path is a resource locator [21:13] micheil: hmm.. [21:13] micheil: it does seem right [21:13] ryah: looks good to me [21:13] ryah: lgtm-^ [21:13] micheil: one is a url, and the other is a filesystem location [21:13] deanlandolt: micheil: a url is, you know, a location too :D [21:13] micheil: true [21:13] ryah: urls can refer to file system paths [21:13] deanlandolt: an http url is a location...a file:// scheme url is a fs location [21:14] micheil: different type [21:14] micheil: although, the fd's we use in node don't use scheme's, so, that's my main issue [21:14] ryah: happy [21:14] micheil: >_> [21:14] micheil: :P [21:14] ryah: that looks like a path to me [21:15] deanlandolt: a path that works via http or local fs [21:15] deanlandolt: great exmaple [21:15] micheil: I don't know, path, url and stuff is a little odd [21:15] ryah: anyway. i'm not saying we merge it right now - i just think exists() should be in the fs module [21:15] ryah: if anywhere [21:15] micheil: maybe best to keep path separate, but mixin them to fs.* and url.*? [21:15] ryah: seems a bit useless to me [21:16] creationix: well ../../happy.jpg isn't a cross-platform path, it just happens to be the same for unix and urls [21:16] micheil: yes [21:16] micheil: fs.exists doesn't belong in path [21:16] mcarter: ryah, did you ever see my email about the promise.wait bug? [21:16] ryah: mcarter: yes - and i've been meaning to get back to you [21:16] mcarter: ryah, cool, no rush [21:17] micheil: ryah: btw, the AUTHORS file [21:17] mcarter: ryah, I haven't had a chance to investigate either, especially with the implementation of promise.wait changing recently [21:17] deanlandolt: creationix: it's cross platform on a browser platform [21:17] micheil: somehow you've gotten the wrong email address for me, as that's no longer an email address [21:17] micheil: (hasn't been for about 1 year) [21:18] deanlandolt: try opening a local fs html page in a browser -- those paths will work on any platform in any browser [21:18] creationix: deanlandolt: exactly, the browser is a platform, windows is another (not that node supports windows yet anyway) [21:18] ryah: mcarter: basically - i'm removing it very soon - like this week. which i apologize for. [21:18] ryah: mcarter: i'll lament in an email [21:18] mcarter: ryah, well, just see that you leave some way of doing synchronous file reading before you remove it [21:18] inimino: ACTION will dance on its grave [21:18] mcarter: ACTION will dance on inimino's grave [21:18] ryah: mcarter: sync file i/o is there [21:19] mcarter: ryah, oh, brilliant. somehow I didn't notice. [21:19] ryah: mcarter: just undocumented still [21:19] ryah: mcarter: fs.statSync(), fs.readSync() [21:19] ryah: etc [21:19] creationix: any my favorite sync function: fs.readFileSync [21:20] mcarter: ryah, will you still be open, ever, to a patch that provides a true coroutine implementation for nodejs? [21:20] ryah: mcarter: no. i'll go into it in an email [21:20] javajunky has joined the channel [21:20] mcarter: ryah, for shame [21:21] ryah: i had been thinking about it for months since we first spoke about it, but finally a bug popped up this week that convinced me [21:21] micheil: mcarter: I did offer to document it., but I think we decided not to for the time being. [21:21] micheil: ryah: would you call http + tcp frozen modules? [21:22] mcarter: ryah, I suppose such an implementation might be able to exist as an external node module [21:22] ryah: mcarter: yes [21:22] mcarter: micheil, fair enough, I've go the source now that I know it exists [21:22] ryah: micheil: no but i'm gtting closer [21:23] ryah: okay. need to do work. [21:23] inimino: ACTION also [21:23] micheil: lol [21:32] rictic has joined the channel [21:33] micheil: creationix: on howtonode, we should start an article set, upgrading from 0.1.XX to 0.1.YY [21:33] creationix: maybe, I was going to wait till the api is a little more stable, but I guess there are enough node users now it would help [21:33] creationix: Ciaran Jessup's article is live! http://howtonode.org/express-mongodb [21:34] micheil: arse. [21:34] creationix: micheil: ? [21:34] micheil: man.. that's piss. someone doesn't like the fact that node's api changes because it's young, and complains about documentation, all they want to do is use in production and not develop it [21:35] micheil: they even started taking the piss out of howtonode, yet not offering solutions [21:35] creationix: micheil: who's complaining? [21:36] micheil: a guy named spot from napalmriot.com [21:36] micheil: my old boss, now I know why I don't work for him any more. [21:36] gwoo: micheil: lets get a lynch mob together [21:37] gwoo: is it me or that kind of attitude totally self defeating [21:37] gwoo: you complain, people who are working are demotivated, you don't get what you want [21:38] gwoo: creationix: great to see that article up! [21:38] creationix: me too, I was excited about this one [21:39] micheil: gwoo: no, I'm just pissed over his attitude [21:39] gwoo: this is an issue with the ArticleProvider code [21:39] gwoo: creationix: it goes way out to the right [21:39] bru: speaking of which, I just updated node.websocket.js to be compliant with 0.1.29 [21:39] bru: my fork is at http://github.com/bru/node.websocket.js (waiting for Guille to pull) [21:40] gwoo: nice [21:40] creationix: gwoo: maybe I should add auto scrollbars to the code areas [21:40] gwoo: yeah that would make the site look nicer in these cases [21:40] javajunky: yay thanks creationix, I ran out of time really so I'm looking for some clever folks to read over and help me polish it a little more :) Its bad timing really as it will likely only work against 0.1.28 but I've stated the sha's everywhere [21:41] gwoo: still it's awesome [21:41] creationix: don't worry, we have a plan to keep articles up to date with latest node [21:41] creationix: but on that, I need to go to class. [21:41] gwoo: later [21:41] creationix: micheil: feel free to fix the css on the long code lines [21:42] micheil: oh man. [21:42] micheil: can someone email me and remind me? [21:42] javajunky: I'll probably find time later in the week/ next week to update all the versions of everything I used, but it'll be good to get some feedback :) [21:42] micheil: micheil@brandedcode.com [21:42] markwubben has joined the channel [21:42] gwoo: micheil: you want in issue in the tracker [21:42] gwoo: ? [21:43] micheil: gwoo: just email me telling me to fix the css with node-blog & code [21:43] micheil: then I'll do it this afternoon [21:44] gwoo: done [21:44] micheil: cheers [21:44] micheil: (I'm addicted to email, inbox always generally 0, unless it's a todo.) [21:46] gwoo: micheil: hah, me too which is why i don't like it at all [21:48] gwoo: now i need more time to read through the whole article [21:52] Tim_Smart has joined the channel [21:55] ithinkihaveacat has joined the channel [21:59] pdelgallego has joined the channel [22:04] geoff_blair has joined the channel [22:08] geoff_blair has left the channel [22:09] aho has joined the channel [22:12] hassox has joined the channel [22:13] stepheneb has joined the channel [22:13] Tim_Smart: Anyone here familiar with MacVim? [22:17] binary42 has joined the channel [22:18] abadr has joined the channel [22:18] eck has joined the channel [22:18] eck has joined the channel [22:21] abadr: Anyone use djangode? It's been updated recently, yet it doesn't work with the latest Node [22:22] gsf: abadr: i see simon's been working on it, but the node api is changing a lot these days [22:23] abadr: What's the right thing to do? Fork, branch, and fix? [22:23] gsf: abadr: yep. then send him a pull request. :) [22:23] abadr: Or is it that they're writing djangode to a certain (older) version intentionally? [22:24] gsf: abadr: i doubt it. a lot of evolving going on [22:24] abadr: Cool. Thanks. [22:26] gsf: abadr: add some tests while you're at it. djangode could use some [22:32] bru has left the channel [22:35] jcrosby has joined the channel [22:36] isaacs: ryah_away: re: http://twitter.com/ryah/status/9304562145 i wouldn't call it axiomatic, myself. but certainly it's one nice way to separate concerns and reuse code. it's not the only way, of course, but it does allow for a rather consistent mental model. [22:36] isaacs: ryah_away: of course, that consistency is blown away once you start having 15 different ways to express a streaming response... [22:37] gf3 has joined the channel [22:39] eikke has joined the channel [22:44] pdelgallego has joined the channel [22:46] Booster has joined the channel [22:56] mattly has joined the channel [22:56] mattly_ has joined the channel [22:56] geoff_blair has joined the channel [23:00] Tim_Smart has joined the channel [23:03] jasondavies has joined the channel [23:07] JoePeck has joined the channel [23:11] hecticjeff has joined the channel [23:11] dekz has joined the channel [23:12] davidjrice: evenin [23:13] davidjrice: okay, slightly scared. About to deploy a node.js app to production for the first time! :) [23:13] gwoo: heya davidjrice [23:13] gwoo: wooohoo! [23:13] gwoo: did you get the oauth working? [23:13] davidjrice: nah! I've got a bit of a workaround using a tiny sinatra server to do the oauth [23:14] gwoo: darn [23:14] davidjrice: get this deployed and out of the way, maybe I can get oauth working in node and refactor [23:14] Tim_Smart has joined the channel [23:16] davidjrice: okay, no articles about node.js deployment I can find. Awesome! [23:16] javajunky: davidjrice I was going to do some work on an oauth api here ( http://github.com/ciaranj/node-oauth ) but got distracted, might be a decent jumping off point [23:16] davidjrice: pants+seat+flying [23:16] javajunky: http://howtonode.org/deploying-node-upstart-monit ? [23:16] davidjrice: javajunky: I saw that repo already, cheers. Couldn't get her working though [23:17] davidjrice: did you ever get a sucessful token request ? [23:17] javajunky: ;) there's nothing in it yet just the netflix js implementation of a client :) no api as such .. [23:18] javajunky: as I said I got distracted :( [23:18] gwoo: ACTION too [23:18] davidjrice: heh, I don't blame you. It's a pita [23:18] javajunky: a worthwhile pita though, if Ihad the time I'd finish it off, go flickr working and thats similar in a lot of ways [23:20] davidjrice: javajunky: indeed! Well if you get time again before I do, this might be handy http://github.com/davidjrice/node-twitter-oauth [23:20] davidjrice: javajunky: also, cheers for that article. Looks exactly what I need. [23:21] javajunky: cheers I'll take a look if I get a chance :) [23:22] dekz has joined the channel [23:23] markwubben has joined the channel [23:25] gwoo: davidjrice: im updating to the latest node [23:26] gwoo: ignore me, and deploy [23:27] pdelgallego has joined the channel [23:33] creationix has joined the channel [23:36] jashkenas has joined the channel [23:53] eikke has joined the channel [23:55] pdelgallego has joined the channel