[00:02] isaacs: mrd`: really? that seems odd.
[00:02] felixge has joined the channel
[00:03] jan____: moin felixge
[00:03] felixge: jan____: sup : )
[00:04] mrd`: isaacs: Agreed, but that's what my informal Chrome-based testing revealed.
[00:04] jan____: felixge: relaxing :)
[00:04] isaacs: ACTION writing a node-bench script
[00:05] RayMorgan: isaacs: with ejsgi does the response object send its headers once the first body.write happens, or right when the response is returned?
[00:06] isaacs: RayMorgan: when the response is returned, unless the response is a promise, in which case it's when the promise is resolved.
[00:16] isaacs: mrd`: hm, that's not what i'm finding
[00:16] isaacs: ("").concat(list) is about 2x faster than list.join(""), which is about 4x faster than looping
[00:17] mrd`: isaacs: Interesting.
[00:18] mrd`: isaacs: That's more what I'd expect at least.
[00:20] aguynamedben has joined the channel
[00:20] mrd`: isaacs: I assume you're testing with Node, rather than Chrome?
[00:20] isaacs: mrd`: that's right.
[00:21] isaacs: script is here: http://github.com/isaacs/node-playground/blob/master/array-concat-bench.js
[00:21] isaacs: i never used ("").concat(list), though
[00:22] isaacs: it's confusingly similar to python's "".join(list)
[00:22] isaacs: but SO different.
[00:22] mrd`: Hm, I suspect that's wrong actually.
[00:22] isaacs: oh, yeah, it is...
[00:22] ryah: orlandov: it should probably be after handlescpe
[00:22] ryah: orlandov: thanks for the note
[00:22] isaacs: because it stringifies the array, and you get commas.
[00:23] mrd`: Yeah.
[00:23] orlandov: kk
[00:23] mrd`: I think you want "".concat.apply("", list)
[00:24] isaacs: ohh, rght
[00:24] isaacs: ok, so that's gonna be slower.
[00:24] isaacs: because of the apply()
[00:24] isaacs: just a sec, lemme update the script
[00:27] isaacs: whoa, ok, so String.prototype.concat.apply("", list) is still fastest.
[00:27] isaacs: "".concat would be slower, because you have to look up the fn
[00:27] isaacs: no, wait, nvm...
[00:28] isaacs: you're right, str+= is still fastest. i forgot how to read the output from the program i wrote *^_^*
[00:28] mrd`: :)
[00:28] isaacs: reading it backwards.
[00:28] isaacs: so... fastest is str += list[i], second is join(), and third is concat
[00:28] mrd`: I would intuitively have expected the opposite.
[00:29] isaacs: yeah. that's why intuition loses over measurement :)
[00:31] mrd`: Yeah.
[00:33] ayo: but += means lots of copying
[00:33] mrd`: ayo: ?
[00:34] ayo: a good implementation of join should be a lot faster (i.e. calculating the required size first... then copy)
[00:34] ayo: http://kaioa.com/b/0803/cat_compare.svgz <- java
[00:34] mrd`: ayo: Yeah, but the point is in V8, it's not.
[00:34] ayo: weird
[00:35] mrd`: Agreed.
[00:36] ayo: java's stringbuilder/buffer use some buffer which is enlarged by 50% (or so) whenever it's required... so you get way less copy operations
[00:36] ayo: whereas concat (+, +=, concat) means a copy for each add
[00:37] ayo: if you know the final size beforehand (e.g. join) you only need to copy once, but you need one extra pass over the array (but it's still quite a bit faster)
[00:39] ayo: mh
[00:39] RayMorgan: ayo: V8 has optimized string concat... (quoted from before)
[00:39] RayMorgan: V8 doesn't copy strings when doing string concat, they push it to a buffer, and when the buffer fills they link it to another buffer. Once you need the total result they then join it in a new buffer
[00:39] ayo: v8 uses a stringbuilder thingy for join
[00:39] ryah: orlandov: where was that Unwrap?
[00:40] orlandov: ryah: in the node_postgres static functions
[00:41] RayMorgan: or something along those lines. In V8 string concat is faster than array.push/join
[00:42] ryah: orlandov: oh okay
[00:42] ayo: mh. that benchmark... only 10 items? :>
[00:43] isaacs: ayo: sure, it might be different for large lists, or for large strings, or for large lists of large strings
[00:43] isaacs: left as an exercise for the reader.
[00:44] ayo: how do you even get meaningful numbers with that kind of nano benchmark?
[00:44] isaacs: ayo: i use node-bench, which runs each comapre function for 1 second, then checks how many times it ran, and does that a few tims for each one, in a random order each time.
[00:45] isaacs: of course, if you want to benchmark something in the context of a full stack (which is 100% necessary, of course) then you really need to use something like apachebench with a full program running.
[00:45] isaacs: then it's less "nano"
[00:46] elliottcable: voodootikigod: eh?
[00:46] ayo: well, the code effectively does nothing. the functions could be thrown away completely by jitting
[00:47] ayo: they should at least return the result
[00:47] isaacs: ayo: the numbers are consisten.
[00:47] isaacs: returning the result isn't supported, because node-bench expects any return to be a promise for async testing.
[00:47] isaacs: they assign it to a variable, which does a copy.
[00:47] isaacs: run the test yourself. if you find it problematic, then send me a patch for node-bench. i'd love it
[00:47] ayo: well, a variable within this function's scope
[00:48] isaacs: if it was jitting, then it would'nt be consistently similar results.
[00:48] isaacs: ayo: but this isn't haskell
[00:48] isaacs: so it doesn't throw away variables that are known to be unused.
[00:48] ayo: currently
[00:48] isaacs: when v8 does that, i'll update node-bench
[00:48] isaacs: ;)
[00:49] isaacs: i like my yaks unshaven.
[00:49] dekz_ has joined the channel
[00:54] elliottcable: voodootikigod: uh am confused.
[00:58] mikeal: what are the "r" and "w" constants for file IO?
[00:58] mikeal: like process.O_CREAT
[00:59] jed has joined the channel
[00:59] isaacs: mikeal: hrm?
[00:59] isaacs: you can just binary-or them together
[00:59] isaacs: process.O_CREAT | process.O_RDONLY, etc
[01:00] mikeal: there it is
[01:00] mikeal: O_RDONLY
[01:07] mahemoff has joined the channel
[01:13] orlandov: 3
[01:14] konobi: 4!
[01:24] hassox has joined the channel
[01:25] jubos has joined the channel
[01:26] Jed_ has joined the channel
[01:31] r11t has joined the channel
[01:39] steadicat has joined the channel
[01:40] RayMorgan has joined the channel
[01:47] cloudhead has joined the channel
[01:49] r11t_ has joined the channel
[01:58] ryah: not to be a downer, but this yajl looks fairly crapy :)
[01:59] ryah: maybe i don't get it
[02:03] tmpvar has joined the channel
[02:05] CIA-75: node: 03Felix Geisendörfer 07master * rac2abe5 10/ (lib/multipart.js test/mjsunit/test-multipart.js):
[02:05] CIA-75: node: Bugfix: Handle Content-Type headers with charset
[02:05] CIA-75: node: Some HTTP clients include a charset parameter in the Content-Type, e.g:
[02:05] CIA-75: node: multipart/form-data; charset=utf-8; boundary=0xKhTmLbOuNdArY
[02:05] CIA-75: node: This patch makes the multipart parser more forgiving towards unexpected
[02:05] CIA-75: node: information included in the Content-Type header. - http://bit.ly/d5KZeX
[02:06] mattly has joined the channel
[02:14] shillcock has left the channel
[02:18] markwubben has joined the channel
[02:29] creationix has joined the channel
[02:39] jubos has joined the channel
[02:42] Connorhd has joined the channel
[02:51] keturn has joined the channel
[02:51] dekz has joined the channel
[02:52] webben has joined the channel
[02:55] micheil has joined the channel
[02:57] inimino: ryah: I didn't see the point of it, but I guess JSON parsing never seemed like a bottleneck to me
[02:58] inimino: ryah: and I've never needed a streaming JSON parser
[02:58] inimino: (I'm not really sure why one would, usually JSON is the sort of thing that you can't do much with part of a message in my experience)
[02:59] inimino: is somebody using it?
[03:04] steadicat has joined the channel
[03:07] micheil has joined the channel
[03:11] brandon_beacher has joined the channel
[03:13] binary42 has joined the channel
[03:20] r11t has joined the channel
[03:22] rednul_ has joined the channel
[03:40] jacobolus has joined the channel
[04:02] jacobolu_ has joined the channel
[04:03] jacobolus has joined the channel
[04:20] jacobol__ has joined the channel
[04:25] chakrit has joined the channel
[04:30] chakrit has left the channel
[04:30] chakrit has joined the channel
[05:00] dekz has joined the channel
[05:05] chakrit has joined the channel
[05:09] jacobolus has joined the channel
[05:14] chakrit has joined the channel
[05:17] ryah: inimino: i guess if you're getting the twitter firehose as a json object, it might be useful
[05:17] ryah: inimino: but, yeah
[05:17] ryah: if my goal was a fast screaming json parser, i think i could do a much better job - based on my quick glance at the source
[05:18] ryah: streaming
[05:18] ryah: :)
[05:18] ryah: then again - maybe i'm just misjudging it...
[05:19] ryah: it seems like he's doing a lot of buffer allocations
[05:21] _Ray_ has joined the channel
[05:51] _Ray_: Is there documentation about building compiled C++ node.js modules?
[05:58] ryah: _Ray_: online there is
[05:58] ryah: nodejs.org/api.html
[05:58] brainproxy has joined the channel
[05:59] _Ray_: Ah, sorry, hadn't seen. I'm going to try making a sort of sandboxed eval, with an entirely clean context :)
[06:01] ryah: _Ray_: with a string?
[06:01] tmpvar: woo, just broke 80% passing tests on my pure js dom level 1 impl
[06:01] _Ray_: ryah, yeah.
[06:02] ryah: _Ray_: not sure if you'd like a hint? (slash solution? of if you'd like to do it yourself)
[06:02] _Ray_: All solutions I thought of involve introducing some variables that eval can access
[06:02] _Ray_: If you have any that don't, shoot :)
[06:03] ryah: http://groups.google.com/group/v8-users/msg/915a5fb4b622fd80
[06:03] micheil: hi ryah
[06:03] ryah: micheil: hey
[06:03] _Ray_: Oh, damn, xD Thanks :)
[06:04] ryah: _Ray_: i can add that to node. i think other people might want it too
[06:04] micheil: ryah: any new tests or bugs to work on?
[06:04] ryah: micheil: net2 needs optimizing :)
[06:04] micheil: heh heh
[06:04] _Ray_: I'm just using for the typical "eval" IRC bot
[06:05] micheil: _Ray_: I think there's a compile source in the node.c file, not sure what it does really though
[06:05] micheil: ryah know's more then me on that
[06:05] ryah: it's just an eval with better errors
[06:06] ryah: micheil: have you tried running http2.js in the net2 branch?
[06:10] micheil: one second, I'l just pull
[06:11] micheil: I'll just run through the tests, should they all be passing at the moment?
[06:13] micheil: ryah: test results: https://gist.github.com/f2b5d5e717787a48cbf2
[06:14] micheil: hmm.. I wonder if it's easily possible to mod mjsunit to print out the OS build and other information like that..
[06:16] cloudhead: anyone got a one-liner for removing an element you don't know the index of from an array, while leaving the array intact if it doesn't exist?
[06:16] micheil: umm..
[06:16] cloudhead: something like a.splice(a.indexOf(x), 1)
[06:16] cloudhead: except that will delete the last element if x doesn't exist
[06:17] micheil: var i = array.indexOf(value); if(i > -1){ array.splice(i, 1); }
[06:18] cloudhead: : /
[06:18] micheil: or something
[06:18] cloudhead: yea
[06:18] micheil: I think john resig did a post on it a while back
[06:18] cloudhead: oh?
[06:18] micheil: yeah
[06:19] cloudhead: found it
[06:19] micheil: :)
[06:19] cloudhead: http://ejohn.org/blog/javascript-array-remove/
[06:19] tmpvar: 3 liner ;)
[06:19] micheil: yeah
[06:21] cloudhead: oh this removes by index though
[06:21] cloudhead: it's pretty much splice()
[06:21] cloudhead: weird
[06:25] micheil: yeah, you could easily modify it to find the index though
[06:26] creationix: Anybody here ever used CoffeeScript, Jeremy's changing the repl to use node instead of rhino
[06:26] creationix: he says it over 4 times faster
[06:30] jed has joined the channel
[06:34] creationix: http://gist.github.com/290455
[06:34] creationix: reminds me of ruby somewhat
[06:36] tmpvar: thats pretty slick, not sure what exactly it would be used for but slick none the less
[06:38] creationix: yeah, Jeremy and I are kinda just having making languages on top of JS
[06:39] creationix: I think that custom languages on top of javascript could be useful the same way ruby made all those DSLs back in 2008
[06:40] cloudhead: the problem is you need a preprocessor
[06:40] tmpvar: as per the move off of rhino, I think that is a strong move! I do wonder if its even possible to remain platform independent though..
[06:40] creationix: not for a repl at least, my new compiler I'm writing in pure coffeescript is platform independent
[06:40] creationix: it currently runs on both node and the browser
[06:41] creationix: trycoffee.org
[06:42] cloudhead: nice
[06:42] creationix: how hard is it to make a new version of node with extra libraries built in
[06:42] creationix: just adding files to the lib folder and running make right?
[06:43] cloudhead: creationix: if coffee-script came bundled with the default node install, I think I'd use it
[06:43] creationix: perhaps, but I'm pretty sure ryan will never let something like that be built in
[06:43] creationix: but I could be wrong
[06:44] cloudhead: yea, I doubt it would ever happen
[06:44] creationix: plus I would have to finish my compiler. The current one is written in ruby.
[06:45] creationix: I think once node has a good package manager it would be trivial to install add-on languages
[06:46] creationix: oh, the nice thing about making a compiler is that it easy to make a second one
[06:46] creationix: http://static.creationix.com/jack/public/index.html
[06:46] creationix: looks a like like the first, but is a different language
[06:48] cloudhead: cool
[06:48] cloudhead: hmm
[06:49] creationix: maybe node could have built in support for registering pre-processors
[06:50] creationix: and then you could run it as "node -lang=coffee" or "node-repl -lang=jack"
[06:51] cloudhead: yea
[06:51] cloudhead: I was thinking about that
[06:51] cloudhead: would be cool
[06:53] cloudhead: how do you chain methods wiht arguments in coffee-script?
[06:53] ryah: ryan 5218 0.0 7.2 45868 26896 pts/2 Sl+ Jan05 0:17 ../node/node server.js
[06:53] ryah: ^-- node_chat
[06:53] ryah: it never crashes
[06:53] cloudhead: nice
[06:53] Pilate: lol ive had an irc bot running for 2-3 weeks now
[06:53] ryah: then again - it doesn't get much traffic
[06:55] creationix: coffeescript can use parens for method calls
[06:56] cloudhead: creationix: doesn't seem like it? it's giving me a parse error
[06:56] creationix: my compiler isn't done, don't trust it
[06:56] creationix: gem install coffee-script
[06:56] cloudhead: no on the other one
[06:56] cloudhead: trycofee.org
[06:56] cloudhead: [1,2,3].forEach(y)
[06:56] creationix: yeah, they're both mine
[06:56] chakrit1 has joined the channel
[06:56] cloudhead: ah ok
[06:57] creationix: though, if you want the node based repl, you'll have to checkout the node branch and build the gem yourself
[06:58] creationix: ryah: what do you think about pre-processors in node? feature bloat or good idea?
[06:59] qFox has joined the channel
[06:59] jubos has joined the channel
[07:00] inimino: creationix: surely that belongs in a module
[07:01] creationix: the pre-processor itself does, but I'm talking about a way to hook them in at the command line
[07:01] lisa_ has joined the channel
[07:01] inimino: creationix: example?
[07:01] lisa_: lol. my linode just rebooted
[07:01] ryah_ has joined the channel
[07:01] inimino: heh, looks like it rebooted again
[07:02] ryah_: okay
[07:02] creationix: so I'm writing two compilers currently that run as modules, but to be cross platform they don't perform and IO
[07:02] ryah_: yeah. man
[07:02] creationix: they just take a string and return a string
[07:02] ryah_: I should be running nodejs.org on Joyent!
[07:02] _Ray_: Might seem dumb, but why could I be getting that it can't find , when trying to compile a module? I placed it in src/node_eval.cc, and added this to wscript: http://pastebin.com/m18d470e3
[07:02] creationix: so node would have a hook to preprocess source files written in other languages and handle all the IO
[07:03] inimino: creationix: well, you can just run "node foo.js" where foo.js loads the REPL module and the preprocessor
[07:04] creationix: inimino: no, because then foo.js needs to have node specific code to load the repl or another file
[07:05] inimino: sorry, I guess I don't understand the problem you're trying to solve
[07:05] micheil: ryah: I think I have a useful patch for the testing framework
[07:06] micheil: ryah: it's simply this on line 104 of test.py: print "\r\nPlatform: {0} {1}".format(platform.system(), platform.release())
[07:06] micheil: so that we can easily get out which platform the user is testing on
[07:07] ryah_: micheil: oh - it's part of v8 - so i'm not sure i want to change it. if i change it then i can't get updates from them without maintaining that patch
[07:07] ryah_: micheil: but it's a good idea
[07:07] micheil: ah
[07:07] creationix: inimino: I want to have a simple library that translates one language to another in a pure cpu-bound function. No I/O, no external dependencies, and can be plugged into either a browser, node, or some other backend that handles all the platform specific stuff
[07:07] micheil: okay.. I was trying to hack mjsunit to add it in, but couldn't
[07:08] ryah_: maybe in test/mjsunit/testcfg.py ?
[07:08] chakrit1 has joined the channel
[07:08] ryah_: that one is node specific
[07:09] inimino: creationix: ok
[07:09] inimino: creationix: so "plugged into" is going to require some kind of boilerplate or wrapper whether in the browser, node, or anything else, surely?
[07:09] creationix: yep
[07:09] ryah_: micheil: nevermind
[07:10] ryah_: micheil: test.py is node specifc
[07:10] micheil: oh, okay good
[07:10] ryah_: micheil: i'll add that
[07:10] creationix: inimino: and that interface is what I would like built into node if possible
[07:10] ryah_: micheil: want to diff me?
[07:10] micheil: ryah: sure (although, I'm no great python coder.)
[07:10] ryah_: me either
[07:10] creationix: of course in the browser it has to be a seperate script tag, but we're used to that on the browser
[07:12] inimino: creationix: I may be missing the point, but can't you just include a shell script or something with the preprocessor?
[07:12] micheil: ryah_: http://gist.github.com/290462
[07:13] micheil: ryah_: I'm looking over the http2 stuff now, I do notice you're missing the "I am a teapot" status code
[07:13] creationix: inimino: sure you can, my question is, would this be something interesting and useful enough to bake into node proper. It would make it that much easier and promote the idea
[07:13] inimino: hm, ok
[07:14] ryah_: why is amqp so much more painful that it needs to be
[07:15] cloudhead: node is getting amqp support?
[07:15] ryah_: yes
[07:15] creationix: ryah: because it's for business use
[07:15] cloudhead: omg nice
[07:16] micheil: ryah_: so does http2 have client and server tls?
[07:20] mikeal has joined the channel
[07:22] creationix: has anyone written a github post commit hook in node before?
[07:23] mikeal: kind of… not really
[07:24] micheil: creationix: it wouldn't be too hard
[07:24] micheil: creationix: github just pings a url with a json data packet
[07:24] mikeal: i'm working on something that uses a CouchDB _update function to accept the commit hook and then there is a _changes listener in node that does some build and test jobs
[07:25] micheil: ryah_: is while(queue[0]) faster then while(queue.length && (var message = queue.shift())){..}
[07:25] creationix: I making a static site generator that rebuilds the site on every commit to a certain repo. This is a somewhat costly operation, but happens infrequently
[07:26] creationix: yeah, now that I think about it, node makes it very easy. No forking or file locks required.
[07:27] ryah_: micheil: no, no http2 client yet. no ssl
[07:27] micheil: okay
[07:27] ryah_: micheil: i don't know if it's faster
[07:27] micheil: Freelist also looks like a good idea
[07:28] micheil: I might have to do a benchmark on them
[07:28] ryah_: that's not the sort of thing (i think) that needs to be optimized though
[07:29] _ry has joined the channel
[07:32] micheil: true
[07:34] micheil: _ry: what about moving away from the v8 test suite entirely?
[07:34] micheil: _ry: using something like DOH or jspec in raw with v8?
[07:35] micheil: (admittedly DOH is using the Rhino env.)
[07:35] _ry: i like the v8 runner
[07:35] _ry: it works
[07:35] micheil: okay
[07:36] micheil: _ry: hmm.. make test-all only takes 30seconds here
[07:36] dekz_ has joined the channel
[07:37] micheil: (which is still pretty long)
[07:37] _Ray_: Hrm. I'm trying to compile the example C++ extension from api.html, and I get (when saying make) "../hello.cc:1:16: error: v8.h: No such file or directory". What could I be doing wrong?
[07:37] _ry: micheil: your machine is faster than mine :)
[07:37] micheil: _ry: I guess so ;P
[07:37] _ry: _Ray_: um.. hm
[07:37] micheil: _ry: It'd be interesting to setup some sort of test-push server
[07:37] _ry: micheil: yes
[07:37] _ry: micheil: buildbot
[07:38] _ry: it needs to be done
[07:38] micheil: and have a client automatically checkout the latest code and run the tests
[07:38] micheil: oh
[07:38] micheil: buildbot's a mozilla tool isn't it?
[07:38] micheil: wait, no, mozilla use it
[07:41] mikeal: it wasn't created *by* mozilla
[07:41] mikeal: but they employee one of the committers now and use it pretty heavily
[07:41] mikeal: employ
[07:41] mikeal: man i'm tired
[07:42] felixge has joined the channel
[07:42] _Ray_: Ah, seems the example needs ' obj.includes = "deps/v8/src/"'., though now I get "../deps/v8/src/globals.h:57:2: error: #error Your target architecture is not supported by v8". Weird :p
[07:42] creationix: allright Disqus was easy, is that cheating? http://howtonode.org/
[07:43] mikeal: we need a planet too
[07:43] mikeal: that's something that really needs to be written *in* node tho
[07:44] CIA-75: node: 03Micheil Smith 07master * r704f394 10/ tools/test.py : Adding output of Platform information into the test runner - http://bit.ly/8YOcxF
[07:44] _ry: felixge: re
[07:44] felixge: _rheya : )
[07:44] _ry: _Ray_: ah good you figured it out
[07:44] micheil: mikeal: I already have ideas for that
[07:44] mikeal: i was thinking about writing something with node+couchdb for it
[07:45] mikeal: has anyone written a good feedparser library yet?
[07:45] micheil: mikeal: I'm going to do it using node+mongodb
[07:45] felixge: mikeal: nope, the problem is that tons of RSS feeds are invalid xml.
[07:45] micheil: although, I've gotta contact a few people to find out some implementation level details for the one I have in mind first
[07:45] mikeal: yup
[07:45] mikeal: the Python feedparser library handles them tho
[07:45] _Ray_: _ry, yeah, and also make was trying to compile using 64 bits for v8, I had to comment if bld.env['DEST_CPU'] == 'x86_64':arch = "arch=x64"
[07:46] mikeal: i don't know how long it took Mark Pilgrim to get all the crazy edge cases tho
[07:47] mikeal: micheil: how are you planning on doing caching and cache invalidation?
[07:47] micheil: mikeal: see pm.
[07:47] mikeal: planets get pretty slammed with requests, that's why the big ones all build static html files
[07:53] micheil: creationix == Tim?
[07:53] creationix: yes
[07:53] micheil: okay
[07:57] _Ray_: Hrmph. Still can't get it to compile. I might just be dumb :s
[07:57] _ry: ACTION trying to crowdsource a few node tasks
[07:57] _ry: node's becoming a bit difficult to manage :)
[07:58] _ry: so i want to merge in net2
[07:58] _ry: even though its totally not done
[07:59] micheil: _ry: I'm reading through the buildbot docs now (while also reading through the net2 changes)
[08:07] _Ray_: Any idea why I could be getting "Your target architecture is not supported by v8", when compiling the example's .cc, running on a C2D 2.4GHz (haven't changed any default architectures I think)?
[08:08] _ry: C2D?
[08:08] _ry: core2
[08:08] _ry: okay
[08:09] _ry: _Ray_: open up python, import platform; platform.machine
[08:09] _Ray_: i386
[08:10] micheil: _ry: that should be added into the make test thing
[08:10] felixge: _ry: When using a single http client for HTTP requests, all of them will automatically be queued/ordered, right?
[08:10] _ry: yeah
[08:10] felixge: awesome
[08:10] felixge: :)
[08:17] _Ray_: ACTION must go to sleep, will try again tomorrow
[08:18] _Ray_: For reference, the error I get is http://pastebin.com/m78126279
[08:27] _ry: http://www.google.com/trends?q=node.js <-- wow
[08:27] _ry: :)
[08:27] felixge: hah : )
[08:28] _ry: is using the prototype much faster than not?
[08:29] _ry: function Class () { this.method = function () {}; }
[08:29] _ry: vs
[08:29] _ry: function Class() {}; Class.prototype.method = function () {};
[08:29] _ry: if i do 100000 "new Class()" which will be faster and by how much?
[08:30] _ry: ACTION wish isaacs was here
[08:30] _ry: :)
[08:30] RayMorgan: prototype is faster
[08:30] RayMorgan: since it doesn't have to recreate the function in the scope each time
[08:30] _ry: yeah
[08:31] RayMorgan: I did a bench on that a while back.. pretty noticeable difference
[08:34] BBB has joined the channel
[08:39] nodelog has joined the channel
[08:39] _ry: i don't think that's acceptable
[08:39] BBB has joined the channel
[08:39] sztanpet has joined the channel
[08:39] _ry: other solution would be to hack the prototype chain
[08:40] _ry: Socket -> WritableStream -> ReadableStream -> EventEmitter
[08:42] nodelog has joined the channel
[08:42] keturn has joined the channel
[08:44] frodenius has joined the channel
[08:44] RayMorgan: _ry: you can also: function Class () { this.method = Readable.method; }
[08:44] scudco has joined the channel
[08:44] _ry: yeah i guess that's less work right? it's just another reference
[08:45] RayMorgan: yeah, exactly
[08:45] RayMorgan: it wouldn't have to recreate the scope
[08:45] RayMorgan: and the 'this' would be bound as you expect in the method
[08:45] _ry: okay. that sounds like a good solution
[08:46] jazzychad has joined the channel
[08:46] joshthecoder has joined the channel
[08:50] vhost- has joined the channel
[08:53] halorgium has joined the channel
[08:54] mrd` has joined the channel
[08:54] elliottcable has joined the channel
[08:56] orlandov has joined the channel
[08:59] paulca has joined the channel
[09:02] elliottcable has joined the channel
[09:02] halorgium has joined the channel
[09:14] mahemoff has joined the channel
[09:19] bronson has joined the channel
[09:23] paulca has joined the channel
[09:26] inimino` has joined the channel
[09:28] chakrit1 has joined the channel
[09:31] philippbosch has joined the channel
[09:36] lifo has joined the channel
[09:50] felixge: jan____: you still up
[09:50] felixge: ?
[09:51] bpot has joined the channel
[09:53] jspiros has joined the channel
[09:53] davidjrice has joined the channel
[09:53] hober has joined the channel
[09:53] zimbatm has joined the channel
[09:54] RJ2 has joined the channel
[09:54] RJ2 has joined the channel
[10:04] mahemoff has joined the channel
[10:08] mahemoff has joined the channel
[10:08] ithinkihaveacat has joined the channel
[10:09] jspiros has joined the channel
[10:13] jspiros has joined the channel
[10:13] mahemoff has joined the channel
[10:14] nsm has joined the channel
[11:22] mahemoff has joined the channel
[11:30] mahemoff has joined the channel
[11:36] CIA-78 has joined the channel
[12:09] bjartek has joined the channel
[12:36] richtaur has left the channel
[12:45] JimBastard has joined the channel
[12:45] JimBastard: sup micheil
[12:45] micheil: not much, trying to figure out how to turn on fast-cgi support in php >_>
[12:46] JimBastard: oofa
[12:46] JimBastard: are you using the mongodb driver yet?
[12:47] micheil: not yet
[12:47] JimBastard: word
[12:47] JimBastard: so i saw someone implemented an ftp server the other day
[12:48] JimBastard: i was thinking about a services module or something
[12:48] JimBastard: that could do like smtp and ftp and maybe some more in one place
[12:48] JimBastard: not quite sure though
[12:48] micheil: JimBastard: see my node-protocol project
[12:50] JimBastard: yeah so it seems that will enforce a syntax on protocol developers?
[12:53] micheil: sort of
[12:53] micheil: ack. bugger php..
[12:58] jfd has joined the channel
[13:02] Tim_Smart has joined the channel
[13:03] mies has joined the channel
[13:04] Tim_Smart: Hey, been looking at node.js. What kinda database support does it have currently?
[13:04] micheil: not much really
[13:04] micheil: there's a fair few noSQL drivers, but they are new
[13:06] micheil: _ry: here's the patch for adding in the machine build into the test.py tool, http://gist.github.com/290544
[13:06] charlenopires has joined the channel
[13:06] Tim_Smart: It will be exciting to see bindings / modules slowly appear for it :)
[13:07] micheil: Tim_Smart: it currently has a few drivers about, I've seen ones for Redis, Mongodb, and I think sqlite
[13:07] micheil: Tim_Smart: http://wiki.github.com/ry/node/modules#database
[13:07] Tim_Smart: Yeah I was reading about redis. Tbh I haven't really looked into redis
[13:08] micheil: redis looks good, but I think mongodb is better
[13:08] micheil: redis is a plain key/value store, mongo seems more json document store
[13:10] Tim_Smart: Ever since I start doing server side stuff, which was a while ago now, I have always been annoyed at blocking calls >.>
[13:10] Tim_Smart: it doesn't feel right, so nonde.js is awesome
[13:10] Tim_Smart: *node.js
[13:11] micheil: hmm.. I might do some.. designery stuff, have fun chaps.
[13:14] ithinkihaveacat: hey, is it acceptable/common to say in library docs "you can only emit this event once, if you emit more than once, results are undefined"?
[13:14] ithinkihaveacat: does it make any difference if the emit() is wrapped in a method call?
[13:15] ithinkihaveacat: for example, i assume you can only call http.ServerResponse.finish() once
[13:15] ithinkihaveacat: (not sure if this is enforced)
[13:15] ithinkihaveacat: if the "API" was http.ServerResponse.emit("finish") would that suggest you could call it more than once?
[13:17] ithinkihaveacat: also, is there any notion of "private" and "public" events? i.e. events only the object itself is supposed to listen to?
[13:18] lifo has joined the channel
[13:29] sixtus42 has joined the channel
[13:40] eikke_ has joined the channel
[13:49] micheil: ithinkihaveacat: I'm not sure I get what you mean there
[13:49] micheil: shit. I have to buy photoshop in 3 days :(
[13:51] ithinkihaveacat: just wondering whether (in terms of api design) it's common/acceptable to say "you can only emit this event once"
[13:52] ithinkihaveacat: i.e. if client code does foo.emit("myevent") twice, should the library check for this mistake, or is it okay to say in the docs "you can only emit this once"
[13:53] ithinkihaveacat: (or should the library be designed so that it's always meaningful to emit the same event twice?O
[13:55] ithinkihaveacat: (heading out, sorry)
[13:55] Tim_Smart: ithinkihaveacat: It's up to you,
[13:56] Tim_Smart: ithinkihaveacat: You just have to handle it accordingly
[14:07] hassox has joined the channel
[14:08] gbot2 has joined the channel
[14:11] nsm has joined the channel
[14:40] nsm has joined the channel
[14:42] Tim_Smart: Hmm I think I have found unexpected behaviour of the http module
[14:44] Tim_Smart: I can't close the server from the request callback
[14:48] Tim_Smart: and for a request the callback is called twice >.>
[14:51] kriszyp has joined the channel
[14:54] Tim_Smart: Figured out the doubling request, but the callback issue still remains. Doesn't give an error or anything...
[15:00] alex-desktop has joined the channel
[15:05] deanlandolt has joined the channel
[15:22] felixge has joined the channel
[15:22] felixge has joined the channel
[15:26] jan____: felixge: up now
[15:26] felixge: jan____: will be back in 20min, watching some show : )
[15:26] weepy has joined the channel
[15:26] weepy: Hi
[15:27] Tim_Smart: Hmm I am have a problem with http.createServer().close() method within a callback
[15:27] weepy: Question: how should one best run nodes as daemons ?
[15:28] Tim_Smart: you can't seem to close a http server from a callback
[15:28] weepy: Tim_Smart - is it just a question of scope ?
[15:28] jan____: felixge: I'll be off then, I got your msg, I'll check out the code
[15:29] Tim_Smart: weepy: Nope, as I dumped the variable into stdout and it was fine
[15:29] chewbranca has joined the channel
[15:29] Tim_Smart: just calling the close function anywhere other than the main event loop won't work
[15:30] weepy: u could try setTimout( function() { server.close() }, 0)
[15:31] Tim_Smart: yeah I'll try that and see what happens
[15:31] deanlandolt: i think process.nextTick is used for that now
[15:32] Tim_Smart: timeout doesn't work either
[15:32] Tim_Smart: deanlandolt: process.nextTick?
[15:33] deanlandolt: yeah -- process.nextTick(fn) is the same as setTimeout(fn, 0)
[15:33] deanlandolt: just cleaner
[15:33] Tim_Smart: ok
[15:33] Tim_Smart: hmm still doesn't want to work
[15:34] Tim_Smart: Might file a bug
[15:35] weepy: I'm trying to install node on a fresh ubuntu 8.04 and get this error when i ./configure:
[15:35] weepy: Traceback (most recent call last):
[15:35] weepy: File "/root/node/tools/waf-light", line 152, in
[15:35] weepy: import Scripting
[15:35] weepy: File "/root/node/tools/wafadmin/Scripting.py", line 7, in
[15:35] weepy: import os, sys, shutil, traceback, datetime, inspect, errno
[15:35] weepy: ImportError: No module named shutil
[15:36] deanlandolt: weepy: have you f'ed with your python install?
[15:36] weepy: non
[15:37] deanlandolt: hmm..that's weird -- shutil should /always/ be there
[15:37] weepy: shutil => command not found
[15:37] deanlandolt: that's the whole /point/ of a std lib, isn't it?
[15:38] weepy: well indeed !
[15:39] deanlandolt: fluky...i don't know what to tell ya -- what's the std python on 8.04? py2.4?
[15:40] blackdog` has joined the channel
[15:40] weepy: this seems to be python 2.5
[15:40] deanlandolt: html
[15:40] deanlandolt: sorry...bad copy/paste
[15:40] deanlandolt: http://ubuntuforums.org/archive/index.php/t-396154.html
[15:42] weepy: yeah i found that
[15:43] hassox: hey guys
[15:43] Tim_Smart: http://github.com/ry/node/issues/issue/55
[15:43] hassox: what time is it for you folks?
[15:43] weepy: most of the other modules seems to be there
[15:43] weepy: tho "No module named datetime"
[15:43] deanlandolt: you've definitely got a bad py
[15:44] deanlandolt: is this just a dev box?
[15:44] weepy: funny it's litereally a fresh install
[15:44] weepy: slice on linode
[15:44] deanlandolt: oh...well at least you've got root
[15:44] weepy: :D
[15:44] weepy: rootastic
[15:45] deanlandolt: i'd open a ticket w/ them but also try upping to py2.6 and/or allocating a fresh machine -- with a different image if possible
[15:46] weepy: ah - a little bit of "apt-get install libapache2-mod-python python-mysqldb" magic seems to have made it work
[15:46] weepy: no idea why
[15:46] joshthecoder: weepy, hmm maybe a package was needed that those pulled in
[15:46] weepy: must've
[15:47] deanlandolt: perhaps -- but shutil and datetime are part of the stdlib
[15:47] joshthecoder: yeah but ubuntu I think splits it up into packages
[15:47] joshthecoder: :\
[15:47] deanlandolt: joshthecoder: huh? the stdlib? that's crazy
[15:47] felixge: jan____: I'm back
[15:47] joshthecoder: I don't think they do so anymore post 8.X
[15:48] deanlandolt: wow...good
[15:48] jed has joined the channel
[15:52] kriszyp_ has joined the channel
[15:54] kriszyp_: \
[15:56] gwoo has joined the channel
[15:57] r11t has joined the channel
[16:03] _Ray_: ACTION wonders if anyone could help him get the example hello.cc module working, I get (when make-ing) this: http://pastebin.com/m78126279
[16:04] joshthecoder: _Ray_, what CPU arch you running
[16:05] joshthecoder: V8 is limited to only a handful of archs
[16:06] _Ray_: joshthecoder, core2
[16:06] joshthecoder: 64 bit mode?
[16:06] _Ray_: If I python "import platform; platform.machine()", I get i386
[16:07] _Ray_: I think so, yes. But v8 itself compiles with -m64 flags, it's just my module that doesn't
[16:07] micheil: _Ray_: try looking at ry's node-postgres
[16:08] micheil: http://github.com/ry/node_postgres
[16:08] micheil: ACTION might need to go into the woods of node-protocol and mongodb tomorrow.
[16:08] _Ray_: Well, first, I don't understand how I'm supposed to make a new wscript - there already is a wscript in node
[16:09] hassox: hawt
[16:09] hassox: :D
[16:09] _Ray_: I altered the one that was there to include the module, but I'm not sure if that's what's wanted?
[16:09] weepy: what's the "net2" branch of node ?
[16:18] _Ray_: Seems the usual 'make' command does not include required flags. "g++ hello.cc -c -m64 -DV8_TARGET_ARCH_X64 -Ideps/v8/src" compiles the example module, but I don't know how to make 'make' work, since it'll try to execute its own commands anyway.
[16:21] micheil: weepy: it's the new network sockets work
[16:21] micheil: weepy: there's a fair few enhancements, although, nothing that is 100% stable, it's a development branch
[16:22] micheil: rather maybe it's 100% stable, but even so, it's a dev branch
[16:22] _Ray_: Ah, there we go. The example needs two things changed in the wscript: obj.cxxflags = "-DV8_TARGET_ARCH_X64" and obj.includes = "deps/v8/src/". I'm now getting warnings about deprecated things in node.cc, but at least it compiles.
[16:24] sixtus42 has joined the channel
[16:27] _Ray_: Hrm. Seems that doesn't really work either. I now get "dlopen(node-v0.1.26/hello.node, 1): no suitable image found. Did find:node-v0.1.26/hello.node: file too short". Aaargh.
[16:34] stevestmartin has joined the channel
[16:39] mikeal has joined the channel
[16:46] Yuffster has joined the channel
[16:46] _Ray_: Ah, there we go. the correct .node wasn't build in the working directory, it was in build/default
[16:48] charlenopires has joined the channel
[17:04] steadicat has joined the channel
[17:21] unomi has joined the channel
[17:22] satous has joined the channel
[17:24] rtomayko has joined the channel
[17:29] felixge has joined the channel
[17:29] felixge has joined the channel
[17:50] jan____: felixge: gotta assemble stuff now, sorry :) I glanced and could find any obvious fail, more tomorrw
[17:51] jan____: *nudges mikeal*
[17:51] mikeal: hey
[17:51] felixge: jan____: k, have fun with your new ikea stuff :)
[17:51] felixge: hey mikeal
[17:51] mikeal: waiting for anna to get ready
[17:51] mikeal: then i'll come down with the drill
[17:51] jan____: no pressure, jchris is still on his way, the stuff is all here
[17:51] jan____: http://jan.io/Ge5K
[17:52] mikeal: we've got a red couch, what more do we need :)
[17:52] jan____: wifi :D
[17:52] jan____: stealing neighbours here, but it only works outside our meeting room
[17:53] jan____: if you have a router that could extend that, we'd be set for a while
[17:53] jan____: (yeah, sitting on the outside window sill)
[17:53] mikeal: i don't, but we can get one at apple
[17:54] jan____: you sure they can do that?
[17:54] mikeal: maybe you're right, i always have to tell the main router that it can be extended
[17:54] mikeal: we should just get the mifi from Nitin
[17:54] jan____: yeah, if you use the ...thing, not radius, that other one
[17:54] jan____: yea
[17:54] mikeal: that would be a better interim solution than stealing the neighbors
[17:55] jan____: it's a "guest" wifi
[17:55] jan____: so we're cool :)
[17:55] mikeal: hehe
[17:58] cloudhead has joined the channel
[18:01] jed has joined the channel
[18:03] jed_ has joined the channel
[18:04] jed has joined the channel
[18:12] chakrit1: Was trying to build node on windows via cygwin... failed with `pthread_atfork: not found` ... any chance of that gettting fixed soon?
[18:14] blackdog`: micheil: did you fix the childprocess bug in your branch?
[18:15] aho has joined the channel
[18:21] _ry: felixge: hey
[18:21] felixge: _ry: hey there : )
[18:21] felixge: writing a blog post on unit testing with node.js right now
[18:22] _ry: felixge: did you think anymore about doing promises with functions?
[18:22] tlrobinson has joined the channel
[18:22] _ry: i thought those examples were pretty good
[18:22] _ry: i like the idea of getting rid of the error callback
[18:23] felixge: _ry nope, not yet. I'm kind of having an inner conflict. I think the current promises are very easy to understand for new people, and I don't mind the extra typing
[18:23] _ry: maybe i should just open a ML thread
[18:23] felixge: ML?
[18:23] _ry: mailing list
[18:24] felixge: oh god, not another of those bike-shed discussions : )
[18:24] felixge: I actually think we should just use promises for high level stuff
[18:24] felixge: and plain callbacks for low-level stuff
[18:24] felixge: I really like the automatic failures you get from unhandled promise errors right now
[18:24] felixge: I think
[18:25] _ry: yeah
[18:25] felixge: but its not like we couldn't have that with functions
[18:25] felixge: so yeah lets try to take this idea further
[18:25] felixge: and see if we end up liking it enough
[18:25] felixge: do you still have a reference to the latest gist?
[18:25] _ry: http://gist.github.com/287389
[18:26] _ry: returning the error is the same as catching it
[18:26] _ry: hm
[18:27] felixge: ah right, that was a neat idea
[18:28] felixge: would we have properties on the function promises?
[18:28] felixge: like '.fired', '.value', etc.?
[18:28] _ry: like what?
[18:28] _ry: hm
[18:28] _ry: maybe
[18:28] _ry: certainly internally
[18:29] _ry: this sort of api just looks so much cleaner
[18:29] felixge: hm does it? I kind of feel the promise example reads more clearly
[18:29] _ry: and i think as long as you're not chaining - it's probably pretty understandable
[18:29] felixge: right
[18:30] felixge: I guess the chaining is more difficult to see with the fab promises
[18:30] gf3 has joined the channel
[18:30] felixge: I do like the idea of error being the first param to all functions
[18:30] felixge: what about you?
[18:31] _ry: http://gist.github.com/290669
[18:31] _ry: yeah i think that's good too
[18:32] felixge: looks good
[18:33] felixge: we could also very easily offer a 'callback' parameter as the last parameter of any function
[18:33] felixge: as it would just be the first handler for the returned promise
[18:34] _ry: yeah
[18:34] _ry: i mean it would require the support of the function author
[18:35] _ry: but it would be easy to transition between the two apis
[18:37] _ry: maybe to define a promise you just creat a funciton which takes the last param as a callback
[18:37] _ry: then do Promise.createInterface(myFunction)
[18:37] _ry: it returns a new API which you can display to your users
[18:38] _ry: eh, so for the posix stuff
[18:38] _ry: i'd do exports.open = Promise.createInterface(process.fs.open);
[18:38] _ry: okay gtg.
[18:39] chakrit has joined the channel
[18:43] jed: i like http://gist.github.com/290669#file_maybe_better_promise.js, because it feels like currying.
[18:44] felixge has joined the channel
[18:44] felixge has joined the channel
[18:44] unomi: http://news.ycombinator.com/item?id=1088699
[18:44] jed: felixge: how about we adopt a convention: in any function that takes a callback, the callback is optional.
[18:45] jed: if omitted, it basically returns the addCallback method, bound to the original method?
[18:45] felixge: jed: I've been doing that in most of my code so far, so +1
[18:45] jed: felixge: seems like something that might be worth investigating everywhere.
[18:45] jed: (it's also what i've been doing too.)
[18:46] felixge: > if omitted, it basically returns the addCallback method, bound to the original method?
[18:46] felixge: not sure I get this
[18:46] jed: posix.cat("config.json", callback )
[18:46] jed: is the same thing as
[18:46] gwoo has joined the channel
[18:46] jed: posix.cat("config.json" )( callback )
[18:48] jed: does that make sense?
[18:48] felixge: jed: yes
[18:48] felixge: that could be nice
[18:48] jed: currying is pretty intuitive.
[18:49] jed: especially if we use it anywhere that requires a callback,
[18:50] felixge: it would be nice if we supported full currying
[18:50] felixge: posix.cat("config.json" ).bind(scope, callback )
[18:50] felixge: Would avoid tons of 'var self = this' lines
[18:50] felixge: :)
[18:51] jed: i'm not sure i follow. wouldn't we just return a function that already has its scope set?
[18:51] jed: what else would you want to set the scope to?
[18:52] felixge: jed: I think right now addCallback() scopes the callback to the promise object
[18:54] jed: felixge: great post, btw. just in time.
[18:54] inimino: hey, this is nice to see
[18:54] inimino: I'm using functions too of course :)
[18:55] felixge: inimino: for callbacks?
[18:55] inimino: felixge: yes, have you seen my fileIO README?
[18:55] jed: link?
[18:55] felixge: inimino: probably, can you link me?
[18:55] inimino: http://boshi.inimino.org/3box/asof/1263250371783/fileIO/README.html
[18:56] inimino: "continuables" is basically what you're describing as a partially-applied promise which takes the addCallback as the last argument
[18:56] jed: ah, i see. yeah same thing.
[18:56] inimino: yep
[18:56] jed: i really like that pattern, kudos.
[18:57] inimino: yeah, it's quite nice
[18:57] inimino: I was encouraged by your work on (fab) that people wouldn't be too put off by the extra parens and function calls :)
[18:57] chakrit1 has joined the channel
[18:57] jed: i actually think this might be pretty important:
[18:57] jed: partially application : async :: chaining : sync.
[18:58] jed: jQuery took chaining manstream.
[18:58] inimino: the nice thing about partial application is it gives you the freedom to be lazy
[18:58] jed: perhaps we could do the same for callback partial application?
[18:58] inimino: could be :-)
[18:58] felixge: inimino: looks cool other than the 'either' idiom, doesn't fit into JS imo
[18:59] inimino: felixge: yeah, I don't know about 'either', that might not fly
[18:59] felixge: I like an explicit first parameter 'error' as a boolean better
[18:59] inimino: felixge: though I am using it everywhere and I find it kind of nice
[18:59] inimino: felixge: the nice thing about it is that you have a single value that you can pass around
[18:59] inimino: felixge: so you can have promises that still only return one argument
[18:59] felixge: inimino: yeah, but you can get that without either()
[19:00] felixge: which I'd like
[19:00] inimino: felixge: which makes uniform interfaces easier
[19:00] felixge: yeah
[19:00] inimino: I think we need something like either, but I'm not entirely sold on either itself
[19:01] inimino: also I'm doing the same partial-application style for streams
[19:01] felixge: inimino: why do we need it? did you look at: http://gist.github.com/290669
[19:01] inimino: (this is a little more radical)
[19:02] inimino: felixge: yes, but not everything needs to return an error parameter at all
[19:02] steadicat has joined the channel
[19:02] inimino: felixge: so now you have two "kinds" of promises, or you have things that always return an error argument that will never be used
[19:02] felixge: everything can potentially have an error
[19:02] inimino: not necessarily
[19:02] felixge: well, it will make people conscious about errors
[19:03] inimino: well, error enforces that they be conscious of it also
[19:03] inimino: if something needs to be able to return errors, then you have to deal with the error type before you can get the 'good' value out
[19:03] inimino: erm.
[19:03] inimino: s/error enforces/either enforces/
[19:03] felixge: just name the variable 'e' and never access it
[19:04] jed: felixge: hrm, i'd rather keep the expected arity.
[19:04] felixge: but I'm open to better alternatives
[19:04] inimino: sure, I just think it's cleaner not to have it
[19:04] jed: posix.cat('config.json')( callback ) or posix.cat('config.json')( successback, errorback )
[19:04] felixge: I think a promise has both an error and a success state
[19:05] felixge: no, that's unreadable in practise
[19:05] jed: felixge: yeah, i could see that.
[19:05] inimino: felixge: some do, but in fileIO I also made a uniform interface for promises and things that might return synchronously
[19:05] inimino: felixge: many of those things don't have failure states
[19:06] felixge: good for them :)
[19:06] inimino: well, lots of CPU-bound things don't :-)
[19:06] felixge: but anything that allows errors to happen without getting noticed, I'm against
[19:06] inimino: felixge: me too
[19:06] felixge: its my #1 requirement for promises
[19:06] inimino: (that's why I like the Either type so much :-)
[19:07] felixge: inimino: it looks like either will be highly unreadable with closures
[19:08] inimino: felixge: well, I generally use named functions ... the names are helpful as documentation
[19:08] chakrit has joined the channel
[19:08] felixge: inimino: that's too verbose for me
[19:08] inimino: felixge: but even with anonymous functions everywhere, I don't find it any worse than promises
[19:09] felixge: I don't think the current promise API is actually bet
[19:09] felixge: I'm enjoying it these days
[19:09] inimino: it's not unusable
[19:09] felixge: * bad
[19:09] inimino: but I'm far from content with it
[19:10] inimino: (or anything else I've seen, for the record... but I think we're getting close to better things)
[19:11] felixge: I'd like a function style API, but not if it means less clarity
[19:11] felixge: Things should be made as simple as possible, but not any simpler ;)
[19:12] inimino: hm...
[19:12] inimino: named function parameters would make your concerns go away, too bad we don't have them :)
[19:12] felixge: they wouldn't, I'd end up writing more code
[19:12] inimino: how more?
[19:12] felixge: oh
[19:12] felixge: you mean if JS supported them ?
[19:13] inimino: yes
[19:13] inimino: but actually...
[19:14] inimino: hm... I was going to say they could take an object with two functions rather than a single function, but I think that's too ugly for me
[19:14] felixge: well actually, the main thing that is interesting for me about (fab) style promises is to only have a single callback
[19:14] felixge: not multiple ones
[19:15] felixge: otherwise promises would be just as good
[19:15] inimino: well, yes
[19:15] inimino: it's the either() convenience function that would have to support that, if I were to do it that way with continuables
[19:16] inimino: you'd have to write something like statFile(path)(either({result:function(r){...},error:function(e){...}}))
[19:16] inimino: ...way too ugly
[19:17] felixge: yeah
[19:17] inimino: so the thing that you lose with statFile(path)(either(function(e){...},function(r){...})) is that you have to know the order of arguments to either() to know what it means
[19:17] inimino: instead of seeing .addCallback and .addErrback in the code
[19:18] inimino: how much do you dislike that?
[19:20] _Ray_: Does createChildProcess... fail? I'm calling .kill() on its result and getting "No child processes". What could this be?
[19:21] jed: i think the positional nature of success and error callbacks bother me less if we encourage a naming convention: statFile(path)( function success(){}, function error(){} )
[19:22] inimino: jed: well, there are those who are opposed to named functions when they don't have to be on principle (though it does make debugging easier in V8 particularly)
[19:22] jed: well, it's optional.
[19:23] jed: if you want your code to be easier to read and debug, you can use it.
[19:23] inimino: jed: also I think what felixge pointed out about having only one callback is nice, but yeah, I could live with that
[19:23] inimino: I guess one function(e,r){...} isn't so much worse... I could probably live with that too
[19:23] jed: inimino: no i agree.
[19:24] jed: fn( complete(){} ) or fn( success(){}, failure(){} )
[19:24] jed: i like that the best.
[19:24] jed: those that want brevity can get it. those that want readable code can get it.
[19:25] jed: i mean, these could even be shortcuts for addCallback, etc, if we made promises their own functions that dispatched to their methods.
[19:25] inimino: with current promises you can add multiple callbacks
[19:26] inimino: and there's no laziness
[19:26] inimino: I think that's the biggest issue that these other approaches solve
[19:26] felixge: sorry, gotta sign off for a bit
[19:26] felixge: but I'll chime in later again
[19:26] jed: you can still do multiple callbacks. fn( callback1 ) and fn( callback2 )
[19:26] inimino: felixge: ok
[19:27] jed: felixge: ok, see ya around.
[19:27] felixge: maybe we should move it to the mailing list if somebody feels inspired to sum up the discussion so far
[19:27] felixge: just to have the basic concepts written down to refer to them in discussion
[19:27] inimino: that would be good, yeah
[19:27] inimino: I'll send something
[19:28] inimino: after I get some food :-)
[19:28] inimino: jed: yes, if you're willing to cache the data
[19:28] inimino: jed: but that doesn't work for streams
[19:30] inimino: (also I'm not sure how people will react to calling the same stateful function multiple times... the fileIO streams interface uses that same idiom but it may be too much of a departure from typical JavaScript style... I don't know)
[19:30] jed: well, you could chain more to get around caching.
[19:30] jed: inimino: yeah, i hear that.
[19:30] inimino: jed: only if you're willing to give up the same interface for things that might or might not return synchronously
[19:31] jed: fn( callback1 )( callback2 )... oh my.
[19:31] inimino: jed: I have a Continuable-style API for something that reads lines from disk, and I don't like the process.nextTick approach so I make sure everything can work synchronously or not
[19:31] jed: i think trying to accommodate sync is part of the problem.
[19:32] inimino: it means you can have very fast interfaces without the overhead of going back to the event loop each time
[19:32] inimino: I think it'll end up being worthwhile for things where performance is an issue, and where things can be cached to provide it
[19:32] jed: sure, it's definitely a trade-off tho.
[19:33] inimino: yes
[19:34] inimino: though I've very rarely so far wanted to use more than one handler for a promise... the 99% case in my code even with promises has been to just have one handler
[19:34] inimino: anyway, lunch
[19:35] inimino: ACTION will check in again later
[19:36] jed: cool, see ya then.
[19:37] jamiew has joined the channel
[19:42] chakrit1 has joined the channel
[19:43] mies has joined the channel
[19:45] binary42 has joined the channel
[19:46] stevestmartin has left the channel
[19:59] brosner has joined the channel
[20:00] keeto has joined the channel
[20:02] rednul has joined the channel
[20:02] tmpvar has joined the channel
[20:09] jed: inimino: here's a summary of my thoughts. http://gist.github.com/290698
[20:12] omygawshkenas has joined the channel
[20:13] gwoo: jed: that looks nice
[20:13] jed: gwoo: thanks. like anything it's a trade-off.
[20:14] omygawshkenas: howdy #node -- Is the 'exit' event from Node's createChildProcess reliable (on a Mac)?
[20:14] omygawshkenas: I'm getting double-calls on it.
[20:14] omygawshkenas: Which can be fixed by adding a simple flag to see if it's already been called, but...
[20:14] omygawshkenas: I'd rather not have to do that.
[20:14] omygawshkenas: Here's the debug:
[20:14] omygawshkenas: http://gist.github.com/290703
[20:15] omygawshkenas: (code's in CoffeeScript, btw)
[20:15] paulca has joined the channel
[20:16] shfx has joined the channel
[20:24] shfx has left the channel
[20:26] mediacoder: omygawshkenas: seems ok on linux (compiled from coffeescript)
[20:26] omygawshkenas: I guess it might be a mac thing.
[20:27] omygawshkenas: It's interesting because not only does it get called twice, but the printed debugs are out of order (or nested somehow)
[20:27] cloudhead has joined the channel
[20:27] omygawshkenas: thanks for giving it a spin, mediacoder.
[20:29] mediacoder: omygawshkenas: not exactly your setup..but my testase: http://gist.github.com/290712
[20:30] omygawshkenas: yeah, that's more or less it -- the only difference being that I'm actually making the external process do work.
[20:31] mediacoder: mine, too..just doesnt do much work, since i dont pass your compiler anything :-)
[20:34] jed: omygawshkenas: if you give me a clean file to run i'd be happy to test it on my os x.
[20:34] omygawshkenas: sure thing, jed. just a sec.
[20:37] _Ray_: Also regarding createChildProcess on OS X, does anyone see the Error callback fire here? http://pastebin.com/m3c42c4c9
[20:39] _Ray_: Since evaluator.js isn't saying anything to stdout, I don't see why the error callback is executing... . I'm also having intermittent issues with the actual output callback only executing with null as param, not the actual data.
[20:39] _Ray_: err, stderr, not stdout.
[20:39] felixge has joined the channel
[20:39] felixge has joined the channel
[20:40] jed: Error: "null"
[20:40] jed: 42
[20:40] jed: is what i get.
[20:40] _Ray_: Right. Why is error firing at all?
[20:41] omygawshkenas: jed: sorry, I can't reproduce it with a clean test file -- only when its hooked into everything, so there must be something else I'm doing wrong.
[20:42] jed: _Ray_: i'm not sure. gonna poke around for a bit.
[20:42] jed: omygawshkenas: np, hope you get it resolved.
[20:42] jed: omygawshkenas: man, coffeescript is so nice.
[20:43] omygawshkenas: If we can manage to write it in itself, and run it on the Node runtime, it's going to be a real thing, I think.
[20:43] omygawshkenas: Are you using it for anything?
[20:43] jed: omygawshkenas: not yet, hopefully soon.
[20:43] jed: omygawshkenas: just admiring its brevity.
[20:44] omygawshkenas: Things might actually be getting a little too brief -- I was noticing while porting Underscore -- when you can fit function literals and postfix conditionals and all that jazz onto a single line ... the code ends up really dense.
[20:45] omygawshkenas: Not nice and spacey -- maybe the solution is just to be more Ruby-esque and define a million little methods.
[20:45] omygawshkenas: Style is still very much an open question.
[20:48] jed: omygawshkenas: i'm with tufte: density can be a good thing.
[20:48] jed: but i agree, if you can get it to bootstrap on node, it'll be pretty awesome.
[20:49] jed: _Ray_: i can't figure this one out... blarg.
[20:51] _Ray_: jed, maybe it's related to the intermittent issues of "output" only firing once, and with null as param
[20:51] _Ray_: But I haven't made a test case for that, I only have the live script that fails
[20:52] _Ray_: Incidentally it's an IRC bot :P
[20:56] omygawshkenas: for what it's worth, my double 'exit' event is intermittent as well. It almost always double-fires, but every once in a while just goes once.
[21:06] brosner has left the channel
[21:14] isaacs has joined the channel
[21:16] RayMorgan has joined the channel
[21:16] BBBB has joined the channel
[21:18] JoePeck has joined the channel
[21:30] jed has joined the channel
[21:33] mediacoder: CoffeeScript has its own "language-flag" on github :-) they're fast
[21:35] stevestmartin has joined the channel
[21:35] jed: "CoffeeScript is the #46 most popular language on GitHub"
[21:36] mediacoder: hehe..i actually just see my test-project as the only one :-)
[21:36] _Ray_: jed, any idea where I could start looking to debug the stderr thing?
[21:37] jed: _Ray_: i'm not too useful outside of the http module. the node.js heavyweights should be back in a bit: http://twitter.com/izs/status/8425141083
[21:37] _Ray_: heh, ok, thanks :)
[21:38] Tim_Smart has joined the channel
[21:39] Tim_Smart: Can anyone else reproduce this: http://github.com/ry/node/issues#issue/55
[21:43] jed: _Ray_: maybe you could try using sys.exec instead?
[21:43] _Ray_: jed, unfortunately I'm writing to the process. inimino however pointed me to the docs that say the "error" event is identical to output, and output fires with null when the process exits
[21:44] jed: Tim_Smart: are you executing that code as is?
[21:44] Tim_Smart: jed, no
[21:44] Tim_Smart: jed, I explain how to reproduce in the comment underneath
[21:45] Yuffster has joined the channel
[21:46] bryanl has joined the channel
[21:50] omygawshkenas: Ray: that's interesting about when null gets fired within the 'output' event.
[21:51] omygawshkenas: If I try to run the callback when 'output' fires null, instead of adding an error event.
[21:51] omygawshkenas: I get a million of these:
[21:51] omygawshkenas: WARNING: promise.wait() is being called too often.
[21:51] omygawshkenas: And then a segfault.
[21:55] mattly has joined the channel
[21:56] mediacoder: Tim_Smart: yea, looks like a bug to me, too.. the testServer object exists within the callback (in my setup) but calling close() doesnt work
[21:56] mediacoder: using request.connection.close() works tho
[21:56] Tim_Smart: OK, I found it by just testing a basic http server
[21:56] Tim_Smart: thought I would file a ticket
[21:57] Tim_Smart: I might have a go at maing a IRC module for node.js at some point
[21:57] Tim_Smart: it has some cool potential there
[21:57] jed: Tim_Smart: there's a few things i'd try first... maybe you need to finish the existing request?
[21:58] Tim_Smart: jed, yeah I have played with different scenarios, including that one
[21:58] jed: (also, you're using require as the name of your first param, which you should probably avoid)
[21:58] JimBastard: sup jed
[21:58] jed: yo JimBastard.
[21:58] eviltwin has joined the channel
[21:59] JimBastard: im having a party tonight in nyc, you should swing by if you are around
[21:59] Tim_Smart: jed, that was my bad, it was meant to be 'request'
[21:59] JimBastard: its a triumvirate we celebrating back to school party, my friends birthday, and me getting a new job
[21:59] JimBastard: should be a fun time
[21:59] jed: Tim_Smart: yeah, i do that all the time. also, "repsonse".
[21:59] jed: or switch the order of res and req.
[22:00] jed: JimBastard: dude, congrats. i'm in philly right now, alas.
[22:00] jed: JimBastard: thanks for the invite and get wasted for me, okay?
[22:00] Tim_Smart: jed, still doesn't affect the bug ;)
[22:00] JimBastard: no doubt, figured id invite some of my internet friends
[22:00] JimBastard: binary42 is getting invited too
[22:01] JimBastard: also i thought it was really funny, my friend sent me the link to fab the other day
[22:01] JimBastard: im like, ohh yeah i know fab
[22:01] jed: nice. good to live in a city with a lot of node'ers.
[22:01] jed: ha ha, awesome.
[22:01] jed: you were one of the first to see it, indeed.
[22:02] Tim_Smart: can you make 'packages' for node.js
[22:03] jed: Tim_Smart: not yet, there's some commonJS work around that though.
[22:03] Tim_Smart: OK awesome
[22:07] Tim_Smart: jed, you can close the server in the callback, you just have to make sure all the connections are closed first
[22:07] pjb3 has joined the channel
[22:08] jed: Tim_Smart: ah, so finishing the response isn't enough?
[22:08] Tim_Smart: jed, I don't think so
[22:09] Tim_Smart: nope it isn't
[22:11] jed: not sure that's a bug, but it should definitely give you more feedback.
[22:12] binary42 has joined the channel
[22:12] inimino: jed: I posted something on the mailing list about promises et al, hopefully it'll get some discussion going :-)
[22:12] Tim_Smart: yeah it should
[22:12] jed: inimino: ah, nice.
[22:14] jed: inimino: one thing that i'm curious about is whether the callback can be called more than once.
[22:14] jed: i'd like it if it could be called repeatedly. but at that point, you can't really call it a promise.
[22:15] inimino: jed: I think that's one of the defining characteristics of a promise, or a continuable... is that it can't
[22:15] tmpvar: JimBastard, where's the new gig?
[22:15] inimino: jed: but yeah, if you call it more than once you get exactly what I call a stream
[22:15] jed: inimino: which i think are much nicer.
[22:15] inimino: jed: and you can call the callback more than once and you can call the stream more than once, so it's bidirectional
[22:15] jed: esp with the "null terminator\"
[22:16] JimBastard: tmpvar a nyc startup
[22:16] inimino: jed: once you have streams you can do powerful stuff with them...
[22:16] JimBastard: im doing lead js pretty much
[22:16] tmpvar: nice, i also work in nyc
[22:16] JimBastard: do you goto nyc.js?
[22:17] tmpvar: haven't yet!
[22:17] JimBastard: ive done a few small talks there
[22:17] inimino: jed: for example (not to keep pumping fileIO or anything...) but look at the copyFile here: http://boshi.inimino.org/3box/fileIO/fileIO_cps.js
[22:17] tmpvar: been too busy to have what people call a "life"
[22:17] inimino: well, it's just:
[22:17] inimino: function copyFile(src,dest){return writeStream(dest,"binary")(streamFile(src,"binary"))}
[22:17] _Ray_: Ah, seems my problem might be this one: http://pastie.org/785671
[22:18] jed: inimino: yeah, that's eloquent.
[22:18] binary42: tmpvar: you should definitely come.
[22:19] tmpvar: i will, its a matter of when haha
[22:19] binary42: tmpvar: Well, Pivotal Labs let me know that Feb. is out on the second Thurs. so I either move for one month, cancel, or change days.
[22:20] binary42: Right now I don't have a speaker lined up.
[22:20] binary42: So I'm not sure if I'll hold the regular meeting.
[22:20] tmpvar: this is the first weekend i've been relatively "work free" in a few months, but i revert to coding haha. writing a js dom
[22:20] binary42: (their execs decided that night would be a good night to fly out and have dinner with the pivots)
[22:20] tmpvar: i see
[22:21] JimBastard: binary42 we could find a new spot
[22:21] binary42: JimBastard: Yeah, but I still need to find a speaker.
[22:21] binary42: We could do just lightning talks again I guess.
[22:22] JimBastard: ive got a bunch of small things kicking around
[22:23] binary42: Cool. Well, I'll come up with a plan in the next few days I guess.
[22:23] binary42: If any of you have ideas I'll be open for it.
[22:23] binary42: Speakers as well.
[22:23] JimBastard: aight
[22:24] binary42: Though I don't want to repeat similar topics too close together if possible.
[22:26] JimBastard: i got tons of new stuff
[22:27] binary42: The other option is a hack oriented night... but I'm not sure that would work as well.
[22:27] omygawshkenas: binary42: I think it would be nice to have "discussion"-style NYCJS meetups sometimes -- you pick a topic and let everyone know, we all mull it over, and briefly present and debate.
[22:28] binary42: omygawshkenas: That's a really good idea. I was going to do this for the DUMBO meeting but since we haven't kicked that off yet I might try it out.
[22:28] tmpvar: how many people usually attend nycjs?
[22:28] binary42: 20-ish IIRC.
[22:28] JimBastard: i think there was like 20-30 people at the last one
[22:28] tmpvar: nice
[22:29] binary42: We could easily handle more people.
[22:29] omygawshkenas: It would be fun to hear everyone's opinions and experiences about some of the more controversial aspects of JS.
[22:29] JimBastard: after party at my house
[22:29] binary42: JimBastard: lol. Well, I actually have some new things I want to try for the after stuff.
[22:29] binary42: Thinking food oriented post-nyc.js.
[22:29] JimBastard: that could be cool
[22:30] Tim_Smart: omygawshkenas: What you mean when you say controversial aspects?
[22:30] tmpvar: haha, instead of beer oriented?
[22:30] JimBastard: i was thinking more beer and video games related
[22:30] JimBastard: ^^
[22:30] omygawshkenas: oh, just things that everyone does differently -- maybe "undecided" is a better word.
[22:30] binary42: :-) I'm down for both!
[22:30] binary42: The post meeting dinners these last few times have been pretty fun.
[22:31] omygawshkenas: ++ that.
[22:31] JimBastard: yeah ive been busy everytime
[22:31] JimBastard: :-\
[22:31] paulca has joined the channel
[22:32] jed: yeah, bummed i missed you guys for ktown last time.
[22:32] cadorn has joined the channel
[22:32] binary42: Well, I'll post some ideas to the ML on Monday and see where people want take things.
[22:32] binary42: jed: Yeah. It was good. Thanks for coming though. I still need to post your talk online.
[22:33] binary42: I've had zero or close to zero time to finish encoding the video.
[22:34] jed: binary42: no rush, i was kinda a mess, heh.
[22:34] jed: and hopped up on tecate.
[22:34] tmpvar: ah man, namednodemap/nodelist implementations are going to hurt
[22:35] Tim_Smart: frodenius: Are you making the IRC bot in node.js?
[22:42] binary42: jed: It turned out fine I think. At least it's a start to some content. New or old.
[22:42] _Ray_: ACTION made an IRC bot, but is having trouble using IPC for an "eval" function.
[22:42] JimBastard: fuck irc
[22:48] rednul has joined the channel
[22:50] tmpvar: hah
[22:51] binary42: ACTION wants to replace IRC. Screw tradition here. I'm not using dialup anyway.
[22:53] siong1987 has joined the channel
[22:53] Tim_Smart: binary42: Replace with what?
[22:54] mattly: nodejs webchat of course
[22:54] binary42: Tim_Smart: probably IRC on the client gateway still but internally it'd probably just be AMQP.
[22:54] mattly: :p
[22:54] binary42: And that... could be done with node. ^_^.
[22:54] Tim_Smart: we should make a json orientated node.js chat
[22:54] binary42: ACTION curses at some spec failures. #%#@&%*#$&#$
[22:55] Tim_Smart: with support for file transfers etc
[22:55] binary42: I'd still support IRC clients but the whole network doesn't need to be IRC internally.
[22:56] zimbatm has joined the channel
[22:56] jspiros has joined the channel
[22:56] deanlandolt has joined the channel
[22:56] gwoo has joined the channel
[22:56] binary42 has joined the channel
[22:56] Tim_Smart has joined the channel
[22:56] aho has joined the channel
[22:56] mayerbacher has joined the channel
[22:56] eviltwin has joined the channel
[22:56] [k2] has joined the channel
[22:56] pjb3 has joined the channel
[22:56] jed has joined the channel
[22:56] cloudhead has joined the channel
[22:56] omygawshkenas has joined the channel
[22:56] unomi has joined the channel
[22:56] gbot2 has joined the channel
[22:56] tlockney has joined the channel
[22:56] r11t has joined the channel
[22:56] rektide has joined the channel
[22:56] Pilate has joined the channel
[22:56] tmpvar has joined the channel
[22:56] orlandov has joined the channel
[22:56] Yuffster has joined the channel
[22:56] JoePeck has joined the channel
[22:56] lifo has joined the channel
[22:56] RJ2 has joined the channel
[22:57] elliottcable has joined the channel
[22:57] CraigW has joined the channel
[22:57] nefD has joined the channel
[22:57] rednul has joined the channel
[22:57] BBBB has joined the channel
[22:57] keeto has joined the channel
[22:57] satous has joined the channel
[22:57] chewbranca has joined the channel
[22:57] alex-desktop has joined the channel
[22:57] eikke_ has joined the channel
[22:57] jfd has joined the channel
[22:57] bjartek has joined the channel
[22:57] CIA-78 has joined the channel
[22:57] ithinkihaveacat has joined the channel
[22:57] davidjrice has joined the channel
[22:57] philippbosch has joined the channel
[22:57] inimino has joined the channel
[22:57] cadorn has joined the channel
[22:57] mattly has joined the channel
[22:57] rtomayko has joined the channel
[22:57] hober has joined the channel
[22:57] jed: what the....
[22:57] binary42: i.e. ^ Net splits suck.
[22:57] binary42: Case in point.
[22:58] binary42: I'm done with IRC for the day at this rate. TTYL. Ping me using @binary42 if you want to talk.
[22:58] JoePeck has joined the channel
[22:59] eck has joined the channel
[22:59] gf3 has joined the channel
[22:59] scudco has joined the channel
[22:59] emyller has joined the channel
[22:59] ryah_away has joined the channel
[22:59] Atmoz has joined the channel
[22:59] erikcorry|away has joined the channel
[22:59] rudebwoy has joined the channel
[22:59] wil has joined the channel
[22:59] ashb has joined the channel
[22:59] _Ray_ has joined the channel
[22:59] bengl has joined the channel
[22:59] er1k757 has joined the channel
[22:59] jan____ has joined the channel
[23:00] jacobat has joined the channel
[23:00] mediacoder has joined the channel
[23:00] evilhackerdude has joined the channel
[23:00] qFox has joined the channel
[23:01] eviltwin has left the channel
[23:01] unomi has joined the channel
[23:03] webben has joined the channel
[23:04] bryanl has joined the channel
[23:04] halorgium has joined the channel
[23:04] frodenius has joined the channel
[23:04] vhost- has joined the channel
[23:04] mrd` has joined the channel
[23:04] joshthecoder has joined the channel
[23:05] eck has joined the channel
[23:07] felixge has joined the channel
[23:07] felixge has joined the channel
[23:08] sztanpet has joined the channel
[23:10] tmpvar: fail whale
[23:12] jed: yikes.
[23:12] jed: it's like an avalanche.
[23:13] mattly has joined the channel
[23:17] keeto has joined the channel
[23:28] mattly has joined the channel
[23:33] omygawshkenas has joined the channel
[23:34] jed has joined the channel
[23:39] mattly has joined the channel
[23:40] _Ray_ has joined the channel
[23:50] _Ray_: Any info on the status of this? http://github.com/ry/node/issues#issue/53
[23:55] r11t has joined the channel
[23:58] gf3 has joined the channel