[00:04] cloudhead: kriskowal: did you find the answer? [00:04] kriskowal: 42? [00:04] cloudhead: Is there even a high level way to do that? [00:04] cloudhead: : ) [00:04] cloudhead: "does anyone know what the lowest level API available in javascript for enqueueing a callback to the event loop?" [00:04] kriskowal: oh, no. i still haven't heard of anything lower-level than setTimeout [00:04] cloudhead: ok [00:05] cloudhead: cause I was looking for a way to do this too [00:05] cloudhead: but it doesn't seem to be possible yet, unless you use exec [00:10] isaacs: cloudhead: in javascript proper, setTimeout is the only way [00:10] isaacs: in node, you can use the process.Timer class [00:11] isaacs: look for GLOBAL.setTimeout in noe.js [00:11] isaacs: *node.js [00:11] the_undefined has joined the channel [00:12] cloudhead: isaacs: but then you would just use 0 as the time value? [00:12] isaacs: cloudhead: yep [00:12] isaacs: i've done that in browser js plenty [00:12] cloudhead: so potentially, I could return a promise before the timeout goes through [00:12] cloudhead: even if the timeout is 0 [00:13] isaacs: cloudhead: yes. [00:13] cloudhead: nice [00:13] isaacs: setTimeout(fn, 0) is not strictly "0" [00:13] isaacs: it's 0 + (process queue overhead) [00:13] orlandov: isn't that undefined? [00:13] isaacs: which is quite small [00:13] cloudhead: so it'll fork? [00:13] isaacs: cloudhead: no, it'll just happen later. [00:13] cloudhead: ok [00:13] cloudhead: cool. [00:14] isaacs: like, after the stuff that's already on the process queue [00:15] jed has joined the channel [00:17] cloudhead: isaacs: so is it better to use process.Timer, or is it equivalent to setTimeout [00:18] isaacs: cloudhead: i'd use setTimeout, personally, just becasue then the code is more clear. [00:18] isaacs: setTimeout is like a 4 line function wrapping process.Timer [00:18] cloudhead: ah ok, good [00:21] cadorn has joined the channel [00:26] hassox: isaacs: thanx heaps for you help yesterday mate [00:26] hassox: really worked out a lot from that session :) [00:26] isaacs: no problem, hassox [00:26] hassox: where is everyone located? [00:26] hassox: ACTION is in Melbourne Australia [00:27] isaacs: ACTION is in Silicon Valley, CA, where the internet lives. [00:27] hassox: lol [00:31] deanlandolt: ACTION is in Washington, DC, where jsconf.us lives. [00:32] hassox: we have kangaroos [00:32] hassox: does that count for something? [00:32] isaacs: hassox: and australians [00:32] hassox: ;) [00:32] binary42 has joined the channel [00:42] alexiskander has joined the channel [00:44] deanlandolt has joined the channel [00:46] inimino: setTimeout isn't even JavaScript proper [00:46] isaacs: inimino: well, it's in all the browsers, and in node. [00:46] isaacs: it's common, and old. [00:47] inimino: yes, it's something like DOM0 [00:47] isaacs: inimino: except, not terrible and evil [00:48] inimino: the Web is built on DOM0 :-) [00:48] inimino: well, the parts of the Web that are mostly JavaScript ;) [00:49] isaacs: oh, yeah, true that [00:49] isaacs: dom0 isn't strictly evil [00:49] orlandov: chaotic neutral? [00:49] isaacs: hehe [00:50] isaacs: quick, someone write a blog post exploring the DnD alignments of various programming languages and environments. [00:50] inimino: heh [01:06] deanlandolt has joined the channel [01:08] deanlandolt has joined the channel [01:09] Connorhd__ has joined the channel [01:09] martyn__ has joined the channel [01:10] kriskowal: isaacs NERD [01:10] kriskowal: i love doing that. [01:12] deanlandolt has joined the channel [01:14] deanlandolt has joined the channel [01:21] alexiskander has joined the channel [01:25] rictic has joined the channel [01:30] alex-desktop has joined the channel [01:35] bryanl has joined the channel [01:44] jed: what's the most reliable way of getting the protocol/scheme from a request? [01:45] iamstef has joined the channel [01:59] mikeal has joined the channel [02:22] blakemizerany has joined the channel [02:32] malkomalko has joined the channel [02:39] dnolen has joined the channel [03:02] pdelgallego has joined the channel [03:08] deanlandolt has joined the channel [03:10] deanlandolt has joined the channel [03:12] deanlandolt has joined the channel [03:13] erikcorry|away has joined the channel [03:16] deanlandolt has joined the channel [03:19] shfx has joined the channel [03:24] erichocean: w00t! only 37 functions away from a Solaris v8 build: http://pastie.org/746652 [03:28] micheil has joined the channel [03:31] rictic: Oh hey, v8 supports __defineGetter__ and __defineSetter__ … sweet [03:42] micheil: hmm.. what are some usages for them? [03:42] deanlandolt: micheil: they do what they sound like...and it's pretty broadly useful [03:43] micheil: an example maybe? [03:47] micheil has joined the channel [03:52] hassox: is there any documentation on V8 or do you have to read the sauce to see what's what? [04:00] micheil: yeah, you actually drink the sauce [04:00] micheil: no, there's docs on google's website for it [04:00] hassox: thanx [04:05] micheil: by the way, it's source code, not sauce code [04:05] binary42 has joined the channel [04:06] hassox: I know [04:06] hassox: I always call it the sauce [04:06] dnolen has joined the channel [04:07] hassox: dunno why.. [04:07] Connorhd__ has joined the channel [04:07] RJ2 has joined the channel [04:11] inimino: secret's in the sauce [04:12] micheil: ACTION is trying to think of how to structure the api to the IMAP module he's working on [04:13] deanlandolt: hassox: i think v8's more a juice than a sauce ;) [04:14] inimino: ...IMAP? [04:25] hassox: that's tru [04:44] jazzychad: when node accepts a TCP connection, does it spin the connection off to a different local port or pool the connections? [04:49] eddanger has joined the channel [04:51] micheil has joined the channel [04:51] jazzychad: seems to pool them on the same port from what i can tell [04:56] jcrosby has joined the channel [05:04] mikeal has joined the channel [05:12] kriszyp: is it best to submit bugs to http://github.com/ry/node/issues or to the mailing list? [05:21] inimino: kriszyp: I'd say the mailing list [05:22] rakeshpai has joined the channel [05:25] kriskowal has joined the channel [05:26] kriskowal has joined the channel [05:32] scudco has joined the channel [05:32] scudco has joined the channel [05:37] mikeal has joined the channel [05:38] dnolen has joined the channel [05:47] JimBastard has joined the channel [05:54] erichocean: w00t! v8 now compiles on Solaris 10! [05:56] JimBastard: nerdgasm [06:19] eddanger has joined the channel [06:23] kriskowal has joined the channel [06:26] aurynn: now port it to sparc! [06:28] jcrosby has joined the channel [06:29] logicuce has joined the channel [06:30] onar_ has joined the channel [06:37] eddanger: Hi All, I am having a problem where after the 3rd request to my hello world app, it has: Segmentation fault: 11 (core dumped) [06:37] eddanger: server is FreeBSD 7.2... [06:48] blakemizerany has joined the channel [06:55] hassox has joined the channel [07:00] erichocean: aurynn: now I'm getting the rest of node.js working ;-) [07:05] JimBastard: peeeace [07:20] rakeshpai has joined the channel [07:40] scudco has joined the channel [07:49] JimBastard has joined the channel [07:51] JimBastard: hello party people [07:51] Connorhd: morning [07:53] JimBastard: do you know if there are any xmpp modules for node? like using websockets i guess? [07:54] Connorhd: don't think I've seen any [07:54] JimBastard: word [07:59] kriskowal has joined the channel [08:03] rakeshpai_ has joined the channel [08:23] michaelk^ has joined the channel [08:39] the_undefined has joined the channel [08:40] ryah: hello [08:41] kriskowal: hey [08:41] kriskowal: if i undestand clocks, it is absurdly early for you, ryah, and absurdly early for me. [08:41] kriskowal: i mean, late. late. [08:43] JimBastard: clocks tend to be linear [08:43] kriskowal: radial, really. helical in some sense, maybe more than one. [08:43] JimBastard: unless traveling at high speeds [08:43] kriskowal: yeah, and stretchy at high speed [08:44] kriskowal: not a good way to loose weight though, but maybe live longer [08:44] JimBastard: heh [08:45] kriskowal: mr. bastard, what is your github handle? [08:45] JimBastard: yo ryah ive got a team competing in a programming contest this weekend, node is gonna be part of my stack ill be showing it off [08:46] JimBastard: http://github.com/Marak/ [08:46] erikcorry|away has joined the channel [08:46] kriskowal: i've only heard the term "stack" in competition in the context of cal tech's senior ditch day [08:47] kriskowal: wherein the seniors, in an attempt to keep the lower classmen from pranking their rooms, leave complex puzzles for them. [08:48] JimBastard: k [08:49] kriskowal: best wishes and g'night. [08:55] micheil has joined the channel [08:55] ryah: JimBastard: cool [08:58] JimBastard: mostly automated deployment, http testing, and doing compacts and builds of client side JS [08:58] JimBastard: you da the man [09:04] mikeal has joined the channel [09:14] JoePeck_ has joined the channel [09:15] erikcorr1|away has joined the channel [09:15] logicuce has joined the channel [09:17] iamstef has joined the channel [09:18] frodenius has joined the channel [09:20] elliottcable has joined the channel [09:22] Yuffster has joined the channel [09:23] shfx has joined the channel [09:23] jchris has joined the channel [09:27] teemow has joined the channel [09:30] halorgium has joined the channel [09:37] skampler has joined the channel [09:38] johan-s has joined the channel [10:15] logicuce has joined the channel [10:16] micheil has joined the channel [10:32] pdelgallego has joined the channel [10:44] malkomalko has joined the channel [10:57] bry has joined the channel [11:22] micheil: ryah: are you still about? [11:31] chrisfarms has joined the channel [11:51] JoePeck_ has joined the channel [11:52] micheil: does anyone know if it's possible to export an object from a module as the default module..? [11:53] micheil: I mean, I have the object SMTP, and I want to be able to setup in a piece of code to have var SMTP = require("libs/smtp"); [11:54] micheil: without needing to tell it to point exports.SMTP to SMTP [11:54] micheil: by doing var SMTP = require("libs/smtp").SMTP; [11:58] jspiros has joined the channel [12:13] bry has joined the channel [12:16] JimBastard has joined the channel [12:29] micheil: morning JimBastard [12:30] JimBastard: morning [12:32] jasondavies has joined the channel [12:35] jasondavies: hmm I'm getting a version mismatch when running node-waf, is it safe to just change the version in bin/node-waf to 1.5.10? [12:37] jasondavies: ls [12:37] jasondavies: oops wrong window [12:38] JimBastard: i can haz root [12:39] micheil: JimBastard: make me a sandwhich =P [12:39] JimBastard: sudo [12:48] micheil: hmm.. [12:56] jasondavies has joined the channel [12:58] micheil: elliottcable: Mu looks like a nice name, but is there any code to go with the name? [13:04] alex-desktop has joined the channel [13:09] micheil: the_undefined: hmm.. that was an interesting article you did on rightjs and the cargo cult, I'd actually never heard that term before.. [13:10] the_undefined: micheil: richard feynman came up with the concept of cargo cult science [13:10] micheil: hmm.. [13:10] micheil: well, either way, I can see your point [13:11] micheil: in many respects, it could be similar to compare Node.js to php+apache [13:11] the_undefined: I was a little harsh, but mostly because I like writing articles that piss people off, they have a much higher comment conversion rate ;) [13:11] micheil: ones apples, the other is oranges [13:12] the_undefined: yeah, it's not fair to do that comparison [13:12] the_undefined: unless you put it in clear context [13:12] micheil: true [13:12] micheil: hmm.. I wish I could figure out the best way to write this api.. [13:12] the_undefined: for example lets say you want to write a chat application, apache+php might still be viable due to the fact that your team members know [13:13] the_undefined: micheil: which API? [13:13] micheil: one for an SMTP lib [13:13] micheil: the_undefined: the is true, I know in my case, I know js better then any of the other languages I've studied, which makes me love node just the little bit more. [13:14] micheil: I'm not sure whether this api should be very low-level or high-level, or middle level like ruby's implementation is [13:14] micheil: python's is very low level I think, I can quite comprehend what they [13:14] micheil: 're doing though. [13:15] JimBastard: mmmmmmmm [13:15] JimBastard: TCPIP protocols [13:15] JimBastard: whats up with the bittorrent port [13:16] micheil: hmm? [13:16] the_undefined: micheil: why are you writing the lib? What is the goal? [13:16] micheil: the_undefined: to see if I can, and because I think it'd be useful [13:17] the_undefined: micheil: hm, bad inspiration for an API :) [13:17] micheil: yeah, true [13:17] michaelk^ has joined the channel [13:18] the_undefined: I don't know enough about smtp to be really useful [13:18] micheil: well, I don't know if I want to have something that has a few public methods and a heap of private, or a fully public api [13:18] the_undefined: Usually I do it by writing some code of how I want to use the library [13:18] the_undefined: just a few sample use cases [13:19] the_undefined: where I make up how the library would talk to me [13:19] micheil: hmm./. [13:19] micheil: okay [13:19] the_undefined: there are some flaws because you may forget about some semantics, but its usually a good start [13:20] micheil: I guess the best way to go would be something like: [13:20] micheil: var smtpConn = SMTP.connect(host, port, options...); [13:21] micheil: erm [13:21] micheil: no [13:22] micheil: the_undefined: and you have one creepy penguin [13:24] the_undefined: micheil: creepy penguin? [13:24] micheil: http://debuggable.com/posts/burning-apple:4ad4a03b-6998-4bb8-b8a6-6c43cbdd56cb [13:25] JimBastard: tldw [13:32] the_undefined: haha [13:47] kriszyp has joined the channel [13:55] micheil: ryah: I really have no idea how you read those histograms you like reading... [14:33] n8o has joined the channel [14:44] jspiros has joined the channel [14:44] deanlandolt has joined the channel [14:48] alexiskander has joined the channel [14:50] n8o_ has joined the channel [15:02] micheil has joined the channel [15:08] binary42 has joined the channel [15:12] rolfb has joined the channel [15:20] ryah: micheil: histograms? [15:21] micheil: yeah [15:21] jed has joined the channel [15:21] micheil: the ones that benchmark between node and other servers, eg, the one between node and the facebook one [15:21] ryah: oh - its reponse time [15:22] ryah: left is is faster [15:22] jed_ has joined the channel [15:23] n8o has joined the channel [15:23] micheil: okay... [15:23] micheil: hmm.. what code editors do people use on os x? [15:25] dnolen has joined the channel [15:26] jasondavies: ACTION uses vim [15:27] micheil: I'm looking for something a little more.. gui based. [15:27] micheil: On my ubuntu box I use Gedit, with a fair few plugins [15:27] alexanderte has joined the channel [15:28] jasondavies: a lot of OS X people seem to swear by textmate [15:29] jasondavies: there is gvim of course but it's probably not what you're looking for when you say gui-based [15:35] micheil: I've been using textmate, but I can't figure out how to get tab completion in it [15:35] inimino: ACTION recommends vim [15:39] rolfb has joined the channel [15:40] aurynn: I swear by textmate. [15:41] inimino: aurynn: you mean vim [15:41] alexanderte has joined the channel [15:41] alexanderte: then* [15:41] aurynn: no [15:41] aurynn: I outgrew vim [15:41] inimino: see, vim is for the young and hip, textmate for the old and infirm! [15:42] frodenius: hrhr [15:43] aurynn: it was more that gvim was irritating, and ran poorly on osx10.3, at the time. [15:43] inimino: ah [15:44] inimino: ACTION recommends real vim with a nice terminal emulator [15:45] aurynn: ACTION refuses to edit text in the terminal [15:45] micheil: inimino: you're proly using uxrvt? [15:45] micheil: ;p [15:45] inimino: I am [15:45] aurynn: I have ridiculously high-resolution bitmapped displays.. why would I use a legacy console system? [15:45] inimino: urxvtcd in fact :) [15:46] ashb: aurynn: there are gui versions of vim. http://code.google.com/p/macvim/ [15:46] ashb: or gvim [15:46] aurynn: ashb, but not very good. [15:46] ashb: macvim is very nice [15:46] inimino: aurynn: because nothing so far comes close the power of unix :) [15:47] inimino: aurynn: and a grid of character cells turns out to be about perfect for a text editor UI anyway [15:48] inimino: all those pixels help draw nice glyphs! [15:48] aurynn: ACTION checks out MacVim [15:48] ashb: the google code project is a nice cocoa version. not the old crappy carbon version [15:49] micheil: hmm.. night folks [15:49] logicuce has joined the channel [15:50] aurynn: hm. I remember this. [15:50] aurynn: ACTION wonders where her vimrc went [15:50] bryanl has joined the channel [15:51] ashb: i've often thought of switching to another editor, but i do too much remote editing and working on more than one machine [15:51] ashb: and i want something i can use (mostly) the same in all environments [15:51] aurynn: I use vim when I need to do spot edits on remote systems [15:51] aurynn: but not for primary development [15:52] ashb: function print () { print.apply(undefined, arguments); } [15:52] ashb: oops [15:52] ashb: :/ [15:53] aurynn: hm. So far this is sensible, a vim that uses the OS key chords [15:53] aurynn: some of them, anyway [15:53] quirkey has joined the channel [15:53] ashb: aurynn: let me know how you get on. I've actually been thinking of switching to textmate. so aview from 'that side of the fence' would be good [15:54] ashb: (just cos i fancy a change) [15:55] micheil: ashb: textmate is... different [15:55] micheil: but I come from using Gedit, so, eh. [15:55] ashb: heh [15:58] aurynn: I really, really like TextMate [15:58] aurynn: and that it lacks a comparable alternative really locks me to OSX [15:58] nrstott: E text editor [15:59] nrstott: works well on windows, uses textmate bundles. linux version under development [15:59] aurynn: I don't use windows [15:59] nrstott: source code is released if you want to hack on it to make it work better on linux [15:59] micheil: ACTION feels like just doing ssh -X to grab at Gedit. [15:59] nrstott: it uses cygwin on windows, so it basically works on linux [15:59] aurynn: I've been paying attention to the linux build, but it looks like it died [15:59] nrstott: but it's not stable [15:59] nrstott: i dont get how people use gedit ;0 [16:00] nrstott: id rather use gvim [16:02] ashb: nrstott: ugh cygwin [16:05] nrstott: ashb, ugg, i agree [16:05] ashb: 2 things i dont like about it: 1) you can't use the utils outside of a cygwin/bash shell [16:05] ashb: 2) it still uses the failsome cmd.exe [16:05] ashb: which is the worst terminal ever invented [16:11] aurynn: yeah, E looks pretty dead at this point. [16:37] nefD: vim for the win! [16:37] nefD: vim + NERDTree + ctag & TagList = the best evar [16:38] nefD: and to make things even better, the terminator terminal app, which provides for tabbed sessions in the same window [16:39] logicuce has joined the channel [16:48] frodenius: yeah, terminal tabs are so awesome! [16:52] johan-s has joined the channel [16:54] nefD: i get kind of OCD with my desktop space, so having multiple terminal windows bugs the shart out of me [16:55] inimino: ACTION recommends xmonad [16:55] RayMorgan has joined the channel [16:56] nefD: hmm, thanks, I'll check that out [17:06] dnolen has joined the channel [17:14] sudocarl has joined the channel [17:24] ryanmcgrath has joined the channel [17:33] teemow has joined the channel [17:36] RayMorgan_ has joined the channel [17:41] mikeal has joined the channel [17:53] scudco has joined the channel [18:06] sudoer has joined the channel [18:17] aguynamedben has joined the channel [18:19] eddanger has joined the channel [18:20] isaacs has joined the channel [18:20] jcrosby has joined the channel [18:26] dnolen has joined the channel [18:28] ericflo has joined the channel [18:28] logicuce has joined the channel [18:34] erichocean: so now we need a node.js-based buildbot [18:35] erichocean: I recommend porting this one: http://integrityapp.com/ [18:37] jtoy has joined the channel [18:39] mikeal has joined the channel [18:48] isaacs: erichocean: we could probably port Jake pretty easily [18:48] isaacs: oh, you said buildbot, not build tool [18:49] erichocean: yeah; I've read the buildbot source cover to cover; it wasn't pretty [18:49] erichocean: node.js would be a much better fit IMO [18:53] qFxo has joined the channel [19:02] soitgoes has joined the channel [19:03] alexiskander has joined the channel [19:19] bryanl has joined the channel [19:38] Yuffster_ has joined the channel [19:44] inimino has joined the channel [19:48] inimino has joined the channel [20:03] malkomalko has joined the channel [20:06] RayMorgan has joined the channel [20:14] jazzychad: erichocean: would runcoderun.com work for your auto-build needs? [20:17] jed has joined the channel [20:30] hornbeck has joined the channel [20:35] isaacs: kriszyp: you around? got an idea about http://www.pastie.org/746255 [20:35] isaacs: it looks like the JSON.stringify() happening on the module exports obj is strictly for debugging purposes, and serves absolutely no purpose most of the time. [20:43] brandon_beacher has joined the channel [20:49] erichocean: jazzychad: hmm, I can't tell; the website doesn't say how it works [20:49] erichocean: but given the pricing, I'd say "no" [21:08] kriszyp: isaacs: that's what I was thinking too [21:08] kriszyp: haven't looked at the code [21:21] jazzychad: erichocean: i think it pulls repos and runs a build script and reports sucess/fail [21:21] jazzychad: i'm not sure how it all works, but one of my friends works on it, so it rang a bell [21:23] blakemizerany has joined the channel [21:28] jamiew has joined the channel [21:38] rtomayko has joined the channel [21:38] logicuce has joined the channel [21:41] the_undefined has joined the channel [21:51] mikeal has joined the channel [22:00] RayMorgan has joined the channel [22:01] hassox has joined the channel [22:01] hassox: good morning [22:01] hassox: quick q for anyone out there [22:02] hassox: does a http.Response object emit an event when response.finish() is called? [22:05] isaacs: kriszyp: i'm thinking about a way to remove those debug() statements in node.js without losing the debugging ability, but it's a bit tricky. [22:05] isaacs: it crossed my mind to dig into the build tools and strip them out unless you do a ./configure --debug or something [22:06] isaacs: but that scares me. [22:06] isaacs: ryah_away: you around? any comments re ^ [22:07] isaacs: my other idea was to create an internal module called "debug", and only switch it on if the env var is there. [22:15] the_undefined: isaacs: I don't think response.finish() gives you any event other than the callback you can pass into [22:16] isaacs: the_undefined: hrm.... context? [22:16] isaacs: ACTION lost the conversation where we were talking about that, apparently. [22:16] isaacs: ACTION 's stack overflows sometimes [22:16] the_undefined: isaacs: nvm. I think I was trying to talk to hassox [22:16] the_undefined: :) [22:16] hassox: oh hey [22:16] isaacs: ok, great. still not senile. [22:16] the_undefined: too much beer [22:16] hassox: oh you can pass a callback into it? [22:16] the_undefined: isaacs: well, at least we can't proof it yet ;) [22:17] the_undefined: hassox: yeah, I think so [22:17] hassox: that would be sufficient [22:17] hassox: any ideas on how I would do taht? [22:17] hassox: that [22:17] the_undefined: let me check first [22:18] hassox: it doesn't look like it's in the dox [22:18] the_undefined: hassox: nvm, you cannot pass a function to it [22:18] the_undefined: you only can for HttpClient [22:19] the_undefined: hassox: but, I think you can add a "close" listener to the underlaying tcp connectino [22:19] the_undefined: something like this: [22:19] hassox: hrm [22:19] the_undefined: req.connection.addListener("close", function(){ ...}); [22:19] the_undefined: that should work [22:19] hassox: that would do the job too [22:19] hassox: awesome :D [22:19] hassox: t [22:19] hassox: hanx [22:20] inimino: hassox: note that the connection isn't guaranteed to be closed when the request finishes [22:20] hassox: hrm [22:21] the_undefined: inimino: a freaking keep-alive [22:21] hassox: ah yeah [22:21] hassox: good point [22:21] hassox: thanx :) [22:21] hassox: well that still leaves me with the issue of finish [22:21] hassox: I guess I could hijack the function and wrap it [22:22] hassox: but I really really don't wanna do taht [22:22] the_undefined: message.emit("sent"); [22:22] the_undefined: let me see where this hooks into [22:24] aurynn has joined the channel [22:24] gjritter has joined the channel [22:25] the_undefined: hassox: try res.addListener('sent', function() {}) [22:25] hassox: kk 1 sec [22:27] hassox: the_undefined: u are the man/woman! [22:27] erichocean: cool [22:27] hassox: thanx the_undefined :D [22:27] the_undefined: hassox: np ;) [22:28] the_undefined: hassox: FYI, I just looked through lib/http.js [22:28] hassox: kk [22:28] hassox: ACTION must lose the fear of the js sauce [22:29] hassox: it's a lot more readable than I thought it was a week ago ;) [22:35] rolfb has joined the channel [22:35] the_undefined has joined the channel [22:38] hassox: anyone know of a good style guide for js that doesn't suck? [22:42] jazzychad: hassox: i know several people like dojo's style guide http://dojotoolkit.org/developer/StyleGuide [22:42] hassox: thanx jazzychad [22:42] hassox: I'll give it a read [22:43] jazzychad: hassox: also some suggestions on the node wiki http://wiki.github.com/ry/node/contributing [22:44] hassox: awesome :) [22:44] hassox: just a quick q [22:44] hassox: do you use ; all the time? [22:44] hassox: or only when you're on multi statements on one line? [22:45] jazzychad: personally, i do it all the time [22:45] jazzychad: 100% [22:46] jazzychad: not that this reason applies to node, but the main reasons i do it is out of habit (C coder) and ... [22:46] jazzychad: it's the only way to minify the code later into one line [22:46] hassox: oh that's a good point [22:46] hassox: but is that really a concern in node? [22:47] hassox: I can't see myself minifying in node [22:47] jazzychad: well, i don't see many people needing to minify node code [22:47] jazzychad: haha "node code" [22:47] isaacs: hassox: i use ; most of the time. [22:47] isaacs: for compression, it really doesn't matter. \n is the same number of bytes as ;, and you don't compress ssjs, anyhow. [22:47] isaacs: i use ; because then i *know* that i'm not chaining. [22:48] hassox: chaining? [22:48] isaacs: and i often do blah\n\t.method(...)\n\t.method(...) etcl [22:48] jazzychad: right [22:49] isaacs: http://gist.github.com/259097 [22:49] isaacs: methods that return "this" [22:49] hassox: ah right [22:49] hassox: oh cool :) [22:49] isaacs: when i don't see a ; on a line, i'm mentally looking for the next method. [22:49] hassox: I didn't realise you could split it onto multiple lines [22:49] isaacs: yeah, js is extra dangerously flexible like that ;) [22:50] jazzychad: i'm so used to using ;'s that code w/o them (python) just looks naked [22:50] hassox: lol [22:50] jazzychad: crockford has some screwy examples of what happens when js assumes where to put the ; for you [22:50] jazzychad: i just like to avoid all that [22:50] rictic has joined the channel [22:51] gjritter: you have to be careful with splitting lines in javascript, particularly with returns [22:51] gjritter: http://gist.github.com/259100 is an example that does something you probably wouldn't expect... [22:51] jazzychad: oh hey mr. nerve [22:52] gjritter: hey mr. jazzy [22:52] isaacs: yes, return\n is dangerous. [22:52] jazzychad: quite [22:52] isaacs: that's why OTB is so very very bad in JS. [22:52] jazzychad: otb? [22:53] isaacs: otb = "one true brace", or "put braces on their own lines". in JS, braces are butterflies. [22:53] isaacs: } else { etc. [22:53] jazzychad: yes yes, right [22:53] hassox: } else { << - isn't good? [22:53] isaacs: hassox: it IS good [22:53] jazzychad: no, that is good [22:53] hassox: oh ok [22:53] hassox: phew ;) [22:53] isaacs: that's what i'm saying. make your elses into butterflies [22:53] hassox: that's what I've been doing [22:53] isaacs: } butterfly P [22:53] hassox: ah gotcha [22:53] isaacs: s/P/\{ [22:53] erichocean: is anyone aware of coming changes to the coupling lib in node.js/deps? [22:54] jazzychad: i used to do OTB a long time ago... then the style guide at work forced butterfly (they called it cuddling) [22:54] isaacs: a brace on its own line can be interpreted as a code block. [22:54] jazzychad: so i've changed my ways thankfully [22:54] isaacs: and js doesn't have block-scope, but it does have arbitrary blocks (for no raisin) [22:54] hassox: a code block? [22:54] hassox: js has those? [22:54] hassox: can you pass them around n stuff? [22:54] isaacs: hassox: crazy, rite? [22:54] isaacs: nope. [22:54] isaacs: you can't do *anything* with them. [22:54] hassox: ah right [22:54] isaacs: they do nothin.g [22:54] hassox: oh [22:54] hassox: that kinda sucks [22:54] isaacs: it also has line labels. [22:54] hassox: ACTION was getting excited  [22:54] jazzychad: isaacs: futurama reference? [22:55] isaacs: jazzychad: yes, it is canon in my religion. [22:55] jazzychad: that's the greetest [22:55] isaacs: ^_^ [22:55] isaacs: line labels, but no gotos. code blocks, but no block scope. [22:56] isaacs: combine that with "," ending a statement, arbitrary whitespace, and expressions-as-valid-statements, and you've created a language in which an object literal can be very badly misinterpreted. [22:56] hassox: sounds like quite a few gotchas [22:57] gjritter: it's a powerful language with a lot of accidents [22:57] jazzychad: nicely put [22:57] isaacs: gjritter: i agree. [22:57] isaacs: http://gist.github.com/259105 [22:59] jazzychad: i put "javascript: the good parts" on my wishlist [22:59] hassox: what's with the trailing "," you mentioned? [22:59] isaacs: hassox: you can combine statements with , [22:59] isaacs: so you can do things like this: [22:59] isaacs: return (a=b, b = c, c = d) [22:59] isaacs: the combined statement evaluates to the value of the last statement. [23:00] isaacs: that lets you do things like: for (var i = 0, l = arr.length; i < l; i ++) [23:00] hassox: so in this case the value of d ? [23:00] isaacs: right [23:00] hassox: ok [23:00] hassox: so it's not like splatting in rub [23:00] hassox: ruby [23:00] hassox: where you can say [23:00] hassox: elem1, elem2 = [1,2] [23:00] hassox: can you use it like that? [23:00] isaacs: hassox: actually, that's destructuring [23:01] isaacs: in the plans for es5, implemented in spidermonkey today [23:01] hassox: cool [23:01] isaacs: var [foo, bar, baz] = [1, 2, 3] [23:01] isaacs: and even: var {foo} = {foo : "bar"} [23:01] hassox: what's that one do? [23:01] isaacs: in your example, elem1 would be left as-is, and elem2 would be set to the array. [23:02] isaacs: that sets teh var "foo" to the "foo" member of the obj [23:02] isaacs: in this case, "bar" [23:02] hassox: yeah that would be cool [23:03] jazzychad: oh yeah, useful [23:03] isaacs: hassox: unfortunately, it's not widely available yet. [23:05] jazzychad: oh right, since there are people here now... i had a question last night... [23:05] jazzychad: when you are accepting tcp connections in node, does it spin off the connection on a new local socket, or pool all connections on the listening port? [23:06] jazzychad: sorry... *new local port [23:07] isaacs: ... crickets... [23:07] jazzychad: hah [23:08] jazzychad: my cursory investigation with netstat seems to indicate they all stay on the same port [23:10] jazzychad: well, that was a fruitful conversation :) [23:10] gjritter: funny, I saw a tweet about irc crickets earlier today :-) [23:10] bryanl has joined the channel [23:11] isaacs: jazzychad: send it to the mailing list. i'm curious myself. [23:11] isaacs: i'm sure *someone* knows. at least ryah_away probably does, i mean, he wrote the thing, right? [23:12] jazzychad: i could dig through the source i suppose [23:12] jazzychad: i was just curious about scaling stuff, if one could have a huge number of open connections [23:13] jazzychad: not like 2^16 ports isn't huge already, but still [23:14] gjritter: There was a thread on the mailing list about how to scale to 100000 connections. I think most people ran into OS/benchmarking difficulties above several hundred simultaneous connections. [23:14] gjritter: running out of sockets, sockets not being closed by ab fast enough, etc. [23:15] RayMorgan_ has joined the channel [23:15] jazzychad: hmm, that's interesting [23:15] logicuce has left the channel [23:16] gjritter: http://groups.google.com/group/nodejs/browse_thread/thread/d19df83c7fd1f3ca [23:17] gjritter: this is not directly node related, but some of the linux kernel parameter settings would be helpful for node as well: http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-1/ [23:22] jazzychad: woah what a thread.. thanks [23:27] inimino: hassox: I use semicolons only where necessary [23:27] RayMorgan_ has joined the channel [23:29] the_undefined: anybody interested in discussing promises/deferreds might want to join #commonjs [23:29] the_undefined: having a little discussion there [23:30] logicuce has joined the channel [23:35] logicuce has left the channel [23:35] isaacs: how would you folks feel about something like require("debug").log(thing, "category") [23:35] isaacs: to replace sys.debug() [23:35] isaacs: and sys.error() [23:36] isaacs: then it could have a mechanism to flip a switch to turn on/off certain types of messages. [23:36] isaacs: require("debug").show("core", "warning", "info", "error") [23:36] isaacs: require("debug").throw("error") [23:37] isaacs: i'm finding that now that i'm used to categorized debugging with Y.log(), i'm really missing it in node. [23:40] jazzychad: i've written a consolelog module. [23:40] jazzychad: http://github.com/jazzychad/consolelog.node.js [23:40] jazzychad: feel free to fork/tweak [23:40] isaacs: jazzychad: i think that your thing is a bit higher-level that my debug module. [23:41] isaacs: but maybe you could put my thing to use somehow. [23:41] jazzychad: mm, oh i see what you're saying now [23:41] isaacs: i'm looking to fix the way that debug() is used in node.js [23:42] isaacs: it does some things that cause unexpected side-effects in some cases. [23:42] RayMorgan_ has joined the channel [23:44] mikeal has joined the channel [23:46] cloudhead has joined the channel [23:49] hassox: lads [23:49] hassox: if I'm making a function to add a callback to a queue [23:50] hassox: would callback or addCallback be more appropriate? [23:50] hassox: callback(fn) or addCallback(fn) [23:50] malkomalko_ has joined the channel [23:52] jazzychad: i would say addCallback seems to be the convention [23:52] mediacoder: hassox: hmm.. addCallback() and addErrback() are used on Promise success/error [23:52] hassox: eyah thought so [23:52] hassox: thanx guys [23:52] mediacoder: i would say addCallback implies a promise-success ..not sure if your callback is that :-) [23:53] hassox: not quite [23:53] hassox: it _may_ run [23:54] mediacoder: hm, dunno.. might confuse people maybe, if your callback is not related to a success :-) [23:55] jazzychad: but just 'callback' would imply that it would be the only callback (to me) [23:56] jazzychad: and may overwrite whatever callback(s) is already registered [23:56] jazzychad: maybe pushCallback ? [23:57] mikeal has joined the channel [23:57] hassox: this is a callback that will execute unless something further down the stack decides it wanted to finish things [23:58] hassox: stack == callback queue [23:58] jazzychad: maybeCallback [23:59] jazzychad: so like a last ditch/default callback ? [23:59] hassox: ah good call [23:59] hassox: thats nice [23:59] hassox: kinda yeah [23:59] jazzychad: defaultCallback(fn) [23:59] jazzychad: tho i guess that could also be confusing :/ [23:59] hassox: yeah