[00:00] creationix: wow, looks like I missed some fun [00:00] creationix: anyway, does anyone here know how to use promised-io [00:01] creationix: I'm trying to convert some examples from step to promises [00:01] ajpiano has joined the channel [00:01] mjr_: creationix: step 1: get a time machine [00:01] mjr_: creationix: step 2: go back nearly 1 year. [00:01] mjr_: I mean, no. [00:02] creationix: mjr_: you think it's that outdated [00:02] creationix: I mean this came out just the other day http://www.sitepen.com/blog/2010/09/20/promised-io/ [00:02] mjr_: Oh, nm. I thought you were talking about something else. [00:02] creationix: not node promises, but modern common-js/dojo style promises [00:02] jchris has joined the channel [00:02] mjr_: Yeah, sorry. I humbly retract my sarcastic reply. [00:03] creationix: I agree, using node promises would be a terrible idea [00:03] [[zz]] has joined the channel [00:05] malkomalko_: hmm just swapping in connect-redis from the memoryStore seems to hang my server when trying to login [00:05] Tim_Smart: Heh cool http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html [00:06] Tim_Smart: git sneaks up on you all ninja like, and then every now again reveals another one of its secrets. [00:07] tisba_ has joined the channel [00:07] MikhX has joined the channel [00:07] mjr_: Tim_Smart: I learned git just to contribute to node. It's been quite enlightening and enjoyable. [00:08] Tim_Smart: mjr_: What did you use beforehand? [00:08] guybrush has joined the channel [00:08] mjr_: svn [00:08] _sri has joined the channel [00:08] mjr_: ACTION hangs head in shame [00:08] pquerna: no shame. [00:08] pquerna: i still use svn and like it [00:08] Tim_Smart: mjr_: Heh yeah. I had just started using SVN before I got into git, and was like "This is pretty cool" [00:08] creationix: pquerna: ever tried bzr? [00:09] creationix: it's like svn flavored git [00:09] coffeecup has joined the channel [00:09] zith_: svn is not so bad [00:09] pquerna: no; i've used hg quite a bit though. [00:09] pquerna: but everyone else wants to use git [00:09] creationix: but there is nothing like github for bzr [00:09] Aria: yeah, svn only sucks on merges. [00:09] pquerna: so they won. [00:09] creationix: pquerna: yep [00:09] davidsklar has joined the channel [00:09] almaisan-away has joined the channel [00:09] mjr_: pquerna: yeah, I don't actually hate svn. It's a clear tradeoff of branch/merge ability for simplicity. [00:09] evilhackerdude has joined the channel [00:10] zith_: are there any real advantages to using git over mercurial or vice versa these days, except for the user base? [00:10] creationix: mjr_: you should try bzr someday, it's a drop-in replacement of svn with more features and less bugs [00:10] zith_: seems like they have kind of converged on a feature set to me [00:10] Aria: I really like a lot of the tools that tack onto git. [00:10] Aria: Things like gollem, the wiki engine. [00:10] mjr_: creationix: I've moved on at this point. git + github = giant win. [00:10] creationix: yeah, github really broke all the competition [00:10] Tim_Smart: hg seems too sensible. That is why Google uses it. [00:11] creationix: I mean, who would use git if it weren't for github [00:11] Tim_Smart: I like ninja tools. [00:11] Tim_Smart: rawr [00:11] zith_: i use git without github.. [00:11] mjr_: linux kernel hackers [00:11] creationix: zith_ = linux kernel hacker? [00:11] zith_: i've written code that infects linux kernel modules, but i dont think that makes me a kernel hacker in the way you mean it [00:11] creationix: I host my own git repos all the time too, but I switched to git from bzr so I could share my code better [00:12] creationix: used to host my own bzr repos [00:12] s0enke: i use git without github at work. svn before. i wanna NEVER switch back. svn is pure hell. [00:12] creationix: and svn before that [00:13] s0enke: but i never checked bzr, hg and so on. [00:14] xslasherx: so [00:14] ajsie: i cant install npm [00:14] ajsie: http://pastie.org/1173423 [00:14] xslasherx: just wondering, do you think creating a blog using node.js + mongo a bit overkill? [00:14] isaacs: ajsie: you have to install node first [00:15] xslasherx: do you guys* [00:15] ajsie: but i have to install npm to install node? =) [00:15] isaacs: ajsie: um... no you don't. [00:15] s0enke: xslasherx, as a fun project not. if you have to ship tomorrow better use rails :D [00:15] mjr_: xslasherx: why just kill something when you can OVERkill it? [00:15] isaacs: ajsie: maybe you're thinking of using nave, and see that nave can be installed with npm? [00:16] isaacs: ajsie: if that's the case, you should know that nave is just a shell script, and can be downloaded from the git repo and dropped anywhere you want it to live. [00:16] creationix: xslasherx: sounds like a common setup [00:16] pdelgallego has joined the channel [00:17] Tim_Smart: xslasherx: There are a few blog engines for node around. [00:17] mjr_: mongo is so popular these days. It's starting to confuse me. [00:17] Tim_Smart: redis <3 [00:17] Tim_Smart: I'm saying that a lot these days.. [00:17] Tim_Smart: I should marry redis. [00:17] xslasherx: mongo > redis [00:18] mjr_: If you don't care that much about whether your data is saved, why not use redis? [00:18] creationix: xslasherx: watch out, them are fightin' words [00:18] mjr_: If you do care, why not use couchdb or like mysql or postgres. [00:18] Tim_Smart: mongo is for people that want to be the fastest, but just aren't. [00:18] s0enke: well mongo is sql-ish and therefore easy to integrate [00:18] creationix: for a blog, really anything will work [00:19] creationix: /dev/null is great for comments [00:19] mjr_: I figure there's some compelling reason that people keep using mongo. [00:19] Aria: Heh, yeah. You need a sequence of stuff, and then a blob of information for each bit. [00:19] zith_: i'm interested in VoltDB [00:19] Aria: Blogs are super simple that way. [00:19] zith_: seems pretty nifty [00:19] creationix: mjr_: great marketing [00:19] jameshome_: excellent documentation [00:19] jameshome_: lovely api [00:19] mjr_: Yeah, I'll bet that helps quite a bit. [00:20] jameshome_: a pleasing tradeoff between performance and expressive depth [00:20] s0enke: mjr_, i guess because it has (auto-)replication, sharding and failover builtin, and almost all sql-features builtin [00:20] mjr_: But what about the "might lose your data" aspect? [00:21] xslasherx: mjr: no, its more like people like you, saying things like this, that gets people excited about mongo =) [00:21] creationix: nStore ftw! [00:21] Tim_Smart: redis <3 [00:21] mjr_: Which is not to say that redis might not lose your data, it's just that if redis loses your data, you are not surprised. [00:21] Aria: mongo's just conceptually so simple, and not hard to make run [00:21] Aria: (and it defaults to no authentication -- which means developers can play with it fast) [00:22] s0enke: mjr_, well a) if you know it, then you can deal with it b) you can set the fsync() interval c) they're working on it (guarantee levls) [00:22] xslasherx: mongodb == infinite concurrent connections [00:22] _sri has joined the channel [00:22] _announcer: Twitter: "I'm having trouble using websockets on #Titanium+#Nodejs" -- LeivinceJohn. http://twitter.com/devcorkvince/status/25165811287 [00:22] Nietecht: That "might lose data thing" is something I'm not really getting, what does it mean? That your app suddenly loses data and you crash if you try to retrieve it, or that there's just no guarantee it gets written to a file after x time? [00:22] jameshome_: the losing your data bit seems a bit blown out of proportion to me [00:22] devkorcvince has joined the channel [00:22] Aria: Nietecht: Or you kick the server's power cable and the data file is just corrupt. [00:22] s0enke: Nietecht, mongo has no journal at the moment [00:22] mjr_: xslasherx: I'd wager that redis or couch could handle similar numbers of concurrent connections. [00:23] s0enke: Nietecht, and it syncs the data only each x seconds to disk [00:23] Tim_Smart: Nietecht: There was a case where someone lost all their data because of some design decision in Mongo, and they cried about it. [00:23] evilhackerdude has joined the channel [00:23] xslasherx: but only mongodb lets you query into your dataset [00:23] Tim_Smart: There might have been a couple. [00:23] jameshome_: there was the 32 bit thing [00:23] creationix: talk about ease to the developer, nStore is just a single node library you include and instant, super-fast data (with a write-only data format) [00:23] xslasherx: but really, it all depends on task [00:23] jameshome_: that was bad [00:23] xslasherx: for web sites, mongodb wins [00:23] jameshome_: but documented [00:23] Nietecht: Aha, but as long as it's all up and running, it doesn't just disappear out of memory? That would be scary [00:23] xslasherx: for apps, perhaps /dev/null is the way to go [00:23] mjr_: creationix: doesn't nstore lose your data even if it doesn't crash? :) [00:24] creationix: mjr_: it's a feature ;) [00:24] xslasherx: redis/couch == meh [00:24] creationix: mjr_: but I'm talking about the potential [00:24] s0enke: ya it's by design. if you store your customer data, you probably don't wanna use it. if you wanna store e. g. blogs / comments, a disaster scenario would not be that evil [00:24] mjr_: creationix: the potential is huge [00:24] creationix: mjr_: I'm not sure the current version looses data, I just haven't had time to test the rewrite [00:24] s0enke: mjr_, that was couchdb 1.0 [00:24] s0enke: aka memcachedb :D [00:24] xslasherx: just run mongodb on SSD [00:25] creationix: xslasherx: that won't help, there are buffers even on ssd [00:25] creationix: power failure will break it [00:25] c4milo has joined the channel [00:25] xslasherx: ssd drives have backup battery generators [00:25] mjr_: I'm not actually in love with any database. They all make different tradeoffs. [00:25] creationix: what is it's in the os buffer and power fails? [00:25] creationix: or kernel panic [00:26] xslasherx: then you are SOL [00:26] mjr_: For most, I can see use cases where those tradeoffs are appropriate, but I just don't get mongo yet. [00:26] creationix: any system that's designed to not be in a consistent, recoverable state at ALL times is prone to data corruption eventually [00:26] jameshome_: what don't you get? [00:26] mjr_: I'm glad people are excited about their tech though, and that lots of them want to use node to talk to mongo. [00:26] xslasherx: personally, i use both Oracle and Mongod [00:26] zith_: VoltDB solves all of these problems! [00:26] xslasherx: anything that requires transaction, i send over to Oracle as my baackup [00:26] zith_: It's the answer to all our database prayers [00:26] creationix: I use PostgreSQL, CouchDB, Redis, and nStore [00:26] Aria: And adds the problem of needing Java ;-) [00:27] Tim_Smart: Java gtfo my house. [00:27] mjr_: zith_: are you saying I have to go and google voltdb to continue this discussion? [00:27] konobi: creationix, time to through riak in there too [00:27] zith_: no :) [00:27] zith_: but google it anyway [00:27] zith_: looks interesting to me [00:27] creationix: nah, riak is close enough to couchdb [00:27] xslasherx: i dont like voltdb, sounds dumb [00:28] dacc has joined the channel [00:28] mjr_: Yeah, I get riak also. If you have huge data and require certain reliability guarantees, take the per-request latency penalty and use riak. [00:28] stagas_ has joined the channel [00:28] Tim_Smart: They could probably make a movie about web developers fighting each other over their favorite database. [00:28] mjr_: I know, people get really emotional. [00:28] creationix: I wonder how coudant compares to riak [00:28] jameshome_: heehee [00:29] jameshome_: it's a really useful conversation for me [00:29] mjr_: It's fascinating. [00:29] s0enke: ACTION found www.clustrix.com some time ago - this is the solution to all our problems!!11 (cap theorem solving) [00:29] xslasherx: actually voltdb ... [00:29] mjr_: Ford vs. Chevy [00:29] xslasherx: doesnt seem so bad [00:29] eisd has joined the channel [00:29] creationix: mjr_: Toyota [00:29] jameshome_: it's a really interesting time [00:29] creationix: Piaggio ;) [00:29] jameshome_: now that it's not just postgres or mysql [00:30] mjr_: I guess that's a Michigan joke from like 30 years ago. [00:30] xslasherx: actually voltdb costs, $15,000 USD/year [00:30] xslasherx: thats even more than oracle [00:30] Aria: And postgresql just added k/v stores in 9.0 [00:30] jameshome_: few people seem to know much about more than one or two [00:30] Aria: Or it's open source. [00:30] creationix: yeah, postgres vs mysql was easy, postgres was better, mysql was more popular [00:30] creationix: Aria: is 9.0 out? [00:31] Aria: Yep. [00:31] zith_: xslasherx: but it's open source? [00:31] s0enke: mysql was company-backed. like mongo :D [00:31] Aria: Came out this week [00:31] xslasherx: if wordpress used postgres, postgress would be current mysql [00:31] creationix: woot! [00:31] Aria: Heh, so true, xslasherx [00:31] mjr_: It's good to have more than one of something that does almost the same thing. Multiple approaches can learn from each other. [00:32] Tim_Smart: Yeah, but at the end of the day, redis shall rule them all. /thread [00:32] Nietecht: Gets confusing for someone who doesn't know much about it when it comes to choosing though... (like me) [00:32] devkorcvince: The DB War [00:32] jameshome_: Nietecht: yep [00:32] mjr_: Tim_Smart: redis still has a pretty bad memory footprint compared to memcachedb. Supposedly this gets betterin 2.2 though. [00:32] Aria: Yeah, it's worth understanding the disaster scenarios, and the reliability guarantees, Nietecht. Not knowing how things fail, they look really similar [00:32] mjr_: Tim_Smart: so maybe you are right. [00:33] Aria: I like redis' approach. I just wish it were journalled and recoverable. [00:33] xslasherx: what do you guys use nosql for? [00:33] mjr_: Aria: yeah, same. The AOF stuff seems really new and untested. [00:33] zith_: xslasherx: it appears voltdDB has an open source community edition [00:33] Tim_Smart: I use AOF all the time. [00:33] zith_: xslasherx: do you know if they have gimped it in some way? [00:33] Aria: Well, I mostly use the filesystem, xslasherx. For all SORTS of data. [00:34] s0enke: irc is my only constant in dev-life [00:34] s0enke: ;) [00:34] Aria: I should totally write a web2.0-style website advertising 'the filesystem' as a database. [00:34] mjr_: I didn't think I cared about losing data either until I got hit by the couchdb 1.0 delayed_commits thing. [00:34] xslasherx: actually ima install voltdb [00:34] Aria: Complete with replication solutions [00:34] almaisan-away has joined the channel [00:34] xslasherx: lets see if this really is the KILLER OF ALL DATABASES [00:34] guybrush has joined the channel [00:35] creationix: http://www.postgresql.org/docs/9.0/static/hstore.html that's just strange and wonderful [00:35] jakob has joined the channel [00:35] Aria: Heh, isn't it? [00:35] s0enke: Aria, yap, nosql is gone - tree-databases ftw !!!111 [00:35] creationix: mongo as a data type [00:35] mjr_: Now they just need an HTTP interface to postgress. [00:35] Aria: Heh, yep. [00:35] Aria: Yes they do. [00:35] Aria: Man, I should write that. [00:35] konobi: there's also cache [00:36] xslasherx: seriously, anyone used voltdb yet? [00:36] creationix: Aria: write it in node [00:36] s0enke: phpPgAdmin ? [00:36] Aria: That's what I was thinking. [00:36] Aria: s0enke: Not to administer, to use as the protocol. [00:36] mjr_: JSON over HTTP is such a great protocol. [00:36] s0enke: Aria, yap was a joke, i fogot the /me hides [00:36] Aria: Hehe. [00:36] s0enke: :) [00:36] mephux has left the channel [00:36] xslasherx: in few years, someone will come up with JSHTML [00:37] xslasherx: where your entire HTML is replaced with JSON [00:37] xslasherx: just remember that you heard it here first .. [00:37] Aria: .oO(SELECT * HTTP/1.1\r\nFrom: ...) [00:37] creationix: xslasherx: nah, html is not terrible for markup [00:37] Aria: Yeah, really not. [00:37] creationix: that's about all xml is good at [00:37] Aria: json is almost as verbose, ending delimiters aside. [00:37] Aria: And a LOT harder to read. [00:37] inimino: JSONML is done already :) [00:37] blowery has joined the channel [00:37] Aria: (easier to parse...) [00:37] evilhackerdude has joined the channel [00:38] xslasherx: because at the end of the day, all websites are is, bunch of texts that needs to be readable by search engines [00:38] xslasherx: and json can excel in that [00:38] marek_z: no [00:38] creationix: markdown! [00:38] marek_z: json is great for serializing data, not great for marking up bunch of texts [00:39] xslasherx: marek_z: yeah but thats what she said [00:39] s0enke: well, xhtml was not THAT bad idea. namespaces etc. still make a lot of sense [00:39] Aria: Yeah... I kinda liked the namespacing. [00:39] creationix: my jsconf slides have at least one unicode character per section heading [00:39] creationix: :) [00:39] creationix: unicode is great [00:40] wereHamster has joined the channel [00:40] stepheneb has joined the channel [00:40] Tim_Smart: mjr_: I created a basic redis client pool. I wonder if it affects performance at all. [00:42] Tim_Smart: http://gist.github.com/590886 [00:42] Tim_Smart: ^--- generic pool thing [00:42] s0enke: now the x in html is gone again (because someone did not include document.write in Xhtml5 and the world depends on it ;) ) [00:42] mjr_: I'm sure it depends on the usage patterns and the latency between node and redis. [00:43] mjr_: Tim_Smart: a single pipelined connection is ideal for talking to redis over localhost because of the large MTU. [00:43] saikat: Tim_Smart: since redis pipelines, how would a pool help? [00:43] Aria: really, a parser that rejects many plausible documents isn't what you want on the web. [00:44] Aria: The HTML parser is robust enough to deal with reality. XML is nice ... but not. [00:44] xslasherx: doesnt this look dooable, http://paste2.org/p/997713 [00:44] creationix: Aria: I like how html5 has a spec for parsing malformed html [00:44] s0enke: Aria, and out comes the IE6 parser :P [00:44] Aria: ACTION laughs. [00:44] Aria: Which you can exploit well ;-) [00:45] Aria: Yeah, the spec is awesome. They outdid themselves. [00:45] mjr_: saikat: parallel connections are a win if you have any latency between client and server. [00:45] saikat: even if you just maintain the original connection? [00:45] saikat: or rather [00:45] malkomalko_: anyone see TypeError: Cannot read property 'prototype' of undefined when trying to hook up connect-redis? [00:46] saikat: are are you saying just that [00:46] mjr_: saikat: yeah, it still can be a win. Although for sure re-use connections. :) [00:47] mjr_: saikat: hmm, I wonder if it matters for very small responses. It might not. [00:48] xslasherx: btw, anyone here seen what stiqr.com did? [00:49] xslasherx: this guy is doing something pretty sick [00:49] xslasherx: soon enough, we might not even be using html [00:50] MattJ: Is "sick" good or bad? I'm assuming it's an American mis-adjective? :) [00:50] isaacs: MattJ: it can be eitehr one. [00:50] MattJ: Great [00:50] MattJ: That's sick [00:50] mjr_: yeah, you've got it [00:50] isaacs: MattJ: http://www.youtube.com/watch?v=8TH_dKfBI40 explains it pretty well [00:52] langworthy has joined the channel [00:52] mjr_: wow, that video's really sick today. [00:53] Atmoz has joined the channel [00:53] isaacs: yeah [00:53] isaacs: great remixes, too [00:55] mjr_: Apparently the korean english school is opposed to teaching english swears to both children and pregnant women. [00:55] xslasherx: and he must get paid to teach that [00:55] mjr_: Hilarious. [00:55] xslasherx: thats whats really sick about it [00:55] isaacs: mjr_: well, it's bad for their education [00:55] mjr_: the unborn child's? [00:55] isaacs: mjr_: um... yeah. [00:55] mjr_: heh [00:56] mjr_: man, I should really do more work [00:57] MattJ: :) [00:57] MattJ: ACTION should get to bed, early morning train journeys not good. [00:57] cloudhead has joined the channel [00:59] _o has joined the channel [01:03] Tobsn: the weather is sick. [01:03] Tobsn: hope it gets better soon. [01:03] devkorcvince has joined the channel [01:04] gsmcwhirter: anyone around that knows jade fairly well? [01:04] Tobsn: creationix, if( argument[0] ) - wouldnt that throw an error if its empty? [01:04] Tobsn: gsmcwhirter, jade looks pretty simple? [01:04] creationix: Tobsn: nope [01:04] creationix: just return undefined [01:04] Tobsn: k [01:05] Tobsn: browser side JS would crap out on that [01:05] creationix: Tobsn: it shouldn't [01:05] gsmcwhirter: Tobsn, it is... I was just wondering if there was some way to invalidate its cache of a string/file programmatically [01:05] Tobsn: mine always does [01:05] creationix: Tobsn: now arguments[0].foo will crap [01:05] Tobsn: gsmcwhirter, no idea ;) [01:05] creationix: because you can't access .foo on undefined [01:05] Tobsn: creationix, correct if would be? typeof != undefined? [01:06] ivong has joined the channel [01:06] creationix: arguments[0] && arguments[0].foo [01:06] Tobsn: i like the lose type handling of php better when its about that [01:06] creationix: you can access any property on any object [01:06] creationix: js is loose like that [01:06] Tobsn: hmm [01:06] Tobsn: k, thx [01:06] Tobsn: brb [01:11] marshall_law has joined the channel [01:12] Nietecht: Hm, is there some way to prevent implicit variable declaration? [01:13] Yuffster has joined the channel [01:13] matt_c has joined the channel [01:17] dnolen has joined the channel [01:20] creationix: Nietecht: what do you mean? [01:21] sstephenson: http://npm.mape.me/ seems not to list any packages whose names come after "spludo" alphabetically [01:21] Nietecht: creatonix: Basically, say x = something when is x hasn't been declared with var will assign something to the global x property. Is there something to make it throw an error or something if you try that? [01:22] creationix: "use strict" [01:22] isaacs: indeed [01:22] creationix: but it's not implemented in v8 yet [01:22] omygawshkenas has joined the channel [01:22] isaacs: Nietecht: in Node, you can also set NODE_MODULE_CONTEXTS=1 [01:22] isaacs: (in the env) [01:22] isaacs: Nietecht: that'll load each module in a child context [01:22] creationix: Nietecht: though static code checkers like jslint can usually find them [01:22] isaacs: ie, no shared global [01:23] Nietecht: Aha, will look into that, cheers [01:23] creationix: :D [01:23] kjy112 has joined the channel [01:24] halfhalo has joined the channel [01:24] matt_c has joined the channel [01:28] Tim_Smart: isaacs: Ah good catch. [01:28] Tim_Smart: (Patch) [01:29] isaacs: Tim_Smart: yeah, thanks :) [01:29] isaacs: Tim_Smart: i found it because it broke npm's test [01:29] Tim_Smart: Yay for tests I guess. [01:29] isaacs: it tries to include a file called "prog@1.0.0" [01:29] Tim_Smart: Heh. [01:29] isaacs: ok, time for not work [01:30] isaacs: g'nite noders [01:31] creationix: 'night [01:34] sprout has joined the channel [01:34] NemesisD has joined the channel [01:35] matschaffer has joined the channel [01:35] kjy112 has joined the channel [01:36] ajsie: do i use node.js on nginx or is node.js itself a server? [01:36] pgriess has joined the channel [01:36] Aria: Either. [01:36] Aria: Most front with nginx. [01:36] c4milo1 has joined the channel [01:36] ajsie: dont get it [01:37] sechrist: I ran out of fds once by fronting with nginx [01:37] ajsie: i can choose either option? [01:37] Aria: Yes. [01:37] sechrist: but I had like 20k concurrent users [01:37] Aria: Some people prefer to put the more time-tested code of nginx in front [01:37] sechrist: most people don't [01:37] Aria: Some prefer to put raw node out there. [01:37] Aria: I prefer the latter mysef. [01:37] ajsie: Aria: ok [01:37] ajsie: so if i choose the former [01:37] c4milo2 has joined the channel [01:37] ajsie: then i have 2 servers? [01:38] sechrist: the fear is that there are vulnerabilities in the http.server module, but none are known if there are [01:38] sechrist: well no [01:38] sechrist: you proxy requests to node [01:38] ajsie: okay [01:38] sechrist: but technically yes, two daemons [01:38] ajsie: could anyone answer this? [01:38] ajsie: http://stackoverflow.com/questions/3765693/non-blocking-io-with-ruby [01:39] ajsie: hmm .. sorry wrong channel =) [01:39] sechrist: non blocking and ruby in the same sentence? [01:39] ajsie: sechrist: :) [01:39] c4milo1 has joined the channel [01:39] ajsie: in the post i have the word eventmachine =) [01:40] pdelgallego has joined the channel [01:40] Yuffster has joined the channel [01:40] matt_c: Fashionably blocking? [01:40] sechrist: exactly [01:40] sechrist: can't have concurrency without threads [01:40] sechrist: must have threads [01:42] eisd has left the channel [01:43] charlenopires has joined the channel [01:47] falconair has joined the channel [01:47] Tim_Smart: A fun way to do inheritance http://gist.github.com/590973 [01:48] Tim_Smart: Came up in CoffeeScript issue tracker and is kinda cool. [01:49] Anti-X: var Animal = function Animal (name) { [01:49] Anti-X: ? [01:49] Me1000 has joined the channel [01:49] Tim_Smart: ? [01:50] Anti-X: animal twice? [01:50] Tim_Smart: Yeah, I like to make sure my functions are named. [01:50] Tim_Smart: So arguments.callee is never needed/ [01:50] Tim_Smart: s/\/// [01:51] tpryme has joined the channel [01:52] Nietecht: Tim_Smart: pretty sure Animal is still accessible from within the function without naming it? [01:52] Anti-X: you have a lot of free time.. not only do you name functions twice, but you also correct one-character typing mistakes by typing 6 more [01:52] steadicat has joined the channel [01:52] Anti-X: i have a lot of free time too, by pointing it out [01:53] Tim_Smart: Anti-X: That is why there is such thing as snipMate for vim. [01:53] Nietecht: I mean, either naming will work, as far as I know. [01:53] Anti-X: ACTION goes back to his corner [01:53] nwhite has joined the channel [01:53] Anti-X: i always wanted to learn vim, but i don't have THAT much free time [01:53] Tim_Smart: Hehe. [01:58] x_or has joined the channel [01:59] Anti-X: anyone know the max amount of objects (as in tags) in an html document? [01:59] Me1000 has joined the channel [02:00] cloudhead has joined the channel [02:01] Anti-X: was thinking about what the memory footprint of 1.6 million divs each representing a pixel on a 2048-resolution screen would be [02:05] Anti-X: not putting it into practice though, as viable an idea it may be [02:06] Anti-X: :p [02:06] Nietecht: Run a loop inserting divs into an empty document and find out? :) [02:06] Tim_Smart: Anti-X: The is pretty much SVG :p [02:06] Anti-X: i don't feel like rebooting atm [02:06] Tim_Smart: s/The/that [02:07] mjr_ has joined the channel [02:08] Aria: Bah. SVG so isn't. [02:09] Anti-X: Tim_Smart would be more like canvas actually [02:09] Anti-X: which stores each pixel separately [02:09] jakehow has joined the channel [02:10] Tim_Smart: Anti-X: I mean more in the fact of heaps of elements everywhere. [02:10] Tim_Smart: (SVG is just DOM elements) [02:10] Anti-X: i did a zoom experiment once using a HUGE canvas, and i left the page open for a few hours, switched back to the window, and it took about 20 seconds to refetch stuff from memory [02:11] Anti-X: probably stored it in the pagefile [02:11] zith_: i find it interesting how many people develop HTML5 apps when it's still so new and unstable [02:11] Anti-X: you mean canvas and websockets now probably [02:12] Anti-X: html5 in general can be applied to older browsers [02:12] zith_: i guess [02:12] Anti-X: using css resets and (on IE) DOM hacks [02:14] zith_: webapps using canvas and websockets then :) [02:14] c4milo1 has left the channel [02:15] Anti-X: strike websockets, because using socket.io you can emulate it using older techniques [02:15] Anti-X: :P [02:15] zith_: i just seem to run across a lot of new fancy sites these days that requires me to use safari or chrome [02:15] zith_: mostly demos, of course [02:15] zith_: but still, lots of things are being produced in that area [02:16] Anti-X: my audio library is supported by all the latest browsers [02:16] Anti-X: except ie8 [02:16] Anti-X: ie9 supports it, mp3-ically [02:16] zith_: what does this audio library offer? [02:16] Anti-X: ff, opera and chrome all got ogg support, only safari and ie falls back on mp3 [02:17] Anti-X: http://github.com/torvalamo/htmlaudio [02:17] Anti-X: don't use audio.js for anything yet, it's not even tested [02:17] konobi: ircretary: when was dannycoates here? [02:17] ircretary: konobi: when what now? [02:17] Anti-X: simpleaudio.js is tested though and should work like a friggin charm [02:18] zith_: cool [02:18] Anti-X: and it just ignores your calls if audio isn't supported [02:18] Anti-X: so you don't have to test [02:18] zith_: now i can add awesome background music to my site that works in every browser ;) [02:19] Anti-X: oh no don't do that [02:19] Anti-X: :P [02:19] Anti-X: well [02:19] Anti-X: as long as you supply a stop button [02:19] Anti-X: otherwise you might as well embed some midi on it, and make it work all the way back to IE3 [02:19] Anti-X: :p [02:20] zith_: good idea [02:20] matt_c: .mid fallback! [02:21] Anti-X: i hope they'll include an 8 bit synthesizer in html6 [02:21] Anti-X: :p [02:21] Anti-X: (not really) [02:22] zith_: will there even be a html6? [02:22] Anti-X: who knows [02:23] Aria: One would have to evaluate the trajectory after HTML5 is "done" or at least refers to a solid set of specs to even get a hint of that. [02:23] Anti-X: we'll see what the appletinis, the googligooks and the operettes come up with that they want to force upon the world through an html6 spec [02:24] zith_: i hate those guys [02:24] Anti-X: they hate you too [02:24] zith_: designing websites in frontpage express was so much easier [02:25] Anti-X: totally was [02:25] muk_mb: lol [02:25] Aria: Sure, but then the web looked like it was designed in frontpage express. [02:25] Anti-X: it was [02:26] Anti-X: what's your point? [02:26] Anti-X: :p [02:26] Aria: My eyes still bleed at random thanks to that. [02:26] Anti-X: now you're just making shit up [02:27] Anti-X: <# geocities [02:27] Anti-X: <3 even [02:27] zith_: a starfield background and red text was all i needed [02:27] zith_: to impress my friends [02:27] Anti-X: yellow text on red (#F00) background [02:27] creationix has joined the channel [02:27] Anti-X: accessibility ftw! [02:28] jesusabdullah: ugh [02:28] jesusabdullah: that sounds terrible [02:28] jesusabdullah: I rocked angelfire ;) [02:28] ngw has joined the channel [02:28] jesusabdullah: omigawd it's still around [02:29] zith_: i think they actually took the hosted sites down [02:29] zith_: and some people scrabled to get them all backed up [02:29] Anti-X: i remember talking to a friend who is colour blind, and i showed him some stuff and asked him what he could see, and it was a real eye opener (so to speak)... made me think better about contrasts and stuff when designing websites [02:29] jesusabdullah: *nod* [02:29] Anti-X: i cant imagine how colour blind people saw the web before [02:29] Anti-X: must have been horrible [02:30] Anti-X: :P [02:30] ryah: ACTION looks out from behind the corner [02:32] creationix: ryah: you in berlin yet? [02:32] zith_: ryah: lets re-implement GNU with node [02:33] zith_: you can travel around the world and get angry at people who refuses to use the (correct) terminology, NODE/Linux [02:34] jesusabdullah: lol [02:34] Anti-X: Nodix [02:34] jesusabdullah: It's NODE.JS/linux I'll have you know [02:34] jesusabdullah: It's fun to say that I did something "in node dot jay ess" like that makes it way more awesome than it would've been otherwise [02:34] jesusabdullah: With a head-bob and everything [02:35] Anti-X: it doesn't make it way awesomer, it makes YOU way awesomer! [02:35] jesusabdullah: I do feel pretty awesome [02:35] Anti-X: i bet you are [02:35] Anti-X: aren't you [02:35] jesusabdullah: aha [02:36] jesusabdullah: http://github.com/jesusabdullah/dynamics/blob/master/hw2/autocompile.js [02:36] jesusabdullah: That's the latest thing [02:36] jesusabdullah: Really stupid-easy, right? [02:36] jesusabdullah: But being able to say "in node.js" makes me feel special XD [02:36] jesusabdullah: It's nice that I can write something that watches and auto-compiles my latex on save so *easily*, though [02:37] Nietecht: Re-inventing the wheel and taking credit for it, or, why new technology attracts ;) [02:37] jesusabdullah: wat [02:37] Anti-X: i noticed i could watch directories too (it would notify when adding/removing files), so i could keep static files in memory :P [02:37] Anti-X: saves time on readfile [02:37] jesusabdullah: hmm [02:37] jesusabdullah: Cool :D [02:37] Anti-X: worked on cygwin anyways [02:37] Anti-X: dunno about lunatix [02:37] jesusabdullah: Neato :) [02:38] jesusabdullah: I've been thinking about making something God-esque for node [02:38] jesusabdullah: http://god.rubyforge.org/ [02:38] jesusabdullah: Problem is, I haven't actually *used* god [02:39] jesusabdullah: and idk ruby either [02:39] Aria: Well, ruby's not hard. And god is decent. [02:39] Aria: Though like all such tools, it can't decide whether it needs to become part of the OS or not. [02:39] jesusabdullah: Yeah, I know, but it's not python and therefore will confuse me! [02:39] aurynn: I still haven't learned ruby [02:39] jesusabdullah: Aria: Hah! [02:40] jesusabdullah: I think I decidedly want something that *doesn't* feel like part of the OS [02:40] jesusabdullah: I just want something that can watch things for me [02:40] jesusabdullah: Basically, I'd just like some handy module exports that I can use with node to make common file/process watching/handling easier [02:40] Aria: Fun. [02:40] trotter has joined the channel [02:41] Aria: This tends to lead to the 'rip out what the OS does and replace it' effect, though. Beware. [02:41] jesusabdullah: Care to elaborate? [02:41] Aria: Well, 'watch process' becomes 'watch and start and stop process' [02:41] Aria: Which becomes 'replace init on my OS' [02:41] jesusabdullah: Hmm [02:41] Nohryb has joined the channel [02:42] Nohryb: . [02:42] jesusabdullah: Speaking of, I should probably try, umm, shit [02:42] jesusabdullah: what's it called [02:42] jesusabdullah: upstart? [02:42] jesusabdullah: It's basically an init replacement [02:42] aurynn: Which becomes "I just rewrote launchd badly" [02:42] Aria: yeah. [02:42] Aria: upstart, sysv init, launchd, systemd, smf. [02:43] ryah: creationix: no [02:43] ryah: zith_: :) [02:43] jesusabdullah: Sound more involved than I want [02:43] Aria: Hehe. It's a worthy project and useful on its own [02:43] junya has joined the channel [02:43] Aria: (especially if it CAN deal with various OSes without ripping out and replacing) [02:43] jesusabdullah: I just want to write quick things like, "if this segfaults start it again" [02:44] jesusabdullah: and "compile my latex's when I save" [02:44] Aria: Indeed. Though the usual way to tell that is "start it, and check its return status" [02:44] jesusabdullah: Oh yeah, well [02:44] jesusabdullah: the segfaulting thing was an actual use case I had :( [02:44] prettyrobots has joined the channel [02:44] Aria: Hehe. Yeaaaah. It's an ugly one, too. [02:44] prettyrobots: Anyone using or used or the author of Promised-IO? [02:45] jesusabdullah: I saw an article on it the other day [02:45] jesusabdullah: but I don't remember where it was :( [02:45] Aria: None of the above, but it looked more like sugar over completion events, rather than true promises. [02:45] jesusabdullah: http://github.com/jesusabdullah/Panic/wiki was what I was thinking [02:45] Aria: (not that that's not useful -- but I tend to avoid such libraries) [02:45] prettyrobots: http://www.sitepen.com/blog/2010/09/20/promised-io/ [02:45] Anti-X: i read about that [02:46] prettyrobots: Aria: Okay. That was my first impression. Sugar. [02:46] jesusabdullah: Yeah, that's it prettyrobots [02:46] saikat has joined the channel [02:46] jesusabdullah: Didn't look like my cuppa...sugar [02:46] jesusabdullah: though :) [02:46] Aria: Replacement for daemontools in JS ++ [02:46] jesusabdullah: So I didn't pay close attention [02:46] prettyrobots: On top of Node.js. [02:46] jesusabdullah: Aria: Pretty untested [02:46] jesusabdullah: I had a program that kept segfaulting on a fedora 7 box [02:46] prettyrobots: What is a replacement for daemontools ? [02:46] jesusabdullah: that I needed to restart [02:46] jesusabdullah: http://github.com/jesusabdullah/Panic/ [02:47] jesusabdullah: Well, a replacement of a small part of daemontools [02:47] jesusabdullah: I wanted to actually use supervise, but I couldn't get it to compile [02:47] jesusabdullah: so I thought, if I could write something that did the same in node... [02:47] prettyrobots: Mother necessity. [02:47] jesusabdullah: ...and then I couldn't get node to compile either >_< [02:47] jesusabdullah: so I stuck with this really buggy bash script I had [02:47] prettyrobots: I use monit. [02:47] prettyrobots: It is an awesome tool. [02:47] jesusabdullah: I think I looked into using monit, too [02:48] jesusabdullah: the computer's stock stuff was so stale I had a hard time with pretty much everything [02:48] junya has left the channel [02:48] jesusabdullah: Funny enough, there are MORE stale cases--at least I had python 2.5 instead of 2.4 [02:49] Aria: (Also, freedt tends to be easier to compile than true daemontools) [02:49] Aria: (And, well, Free) [02:49] jesusabdullah: freedt? Hmm [02:49] jesusabdullah: wasn't actually aware of freedt [02:49] jesusabdullah: What's daemontools' license, anyway? [02:50] Aria: "It's mine, feel free to use it, but I'm DJB, therefore what I write is better than you." [02:50] Aria: "So don't you dare patch it and release it" [02:50] prettyrobots: Aria: Oh, that's why people don't like him. [02:51] prettyrobots: Avoid "God". [02:51] mjr_: Yeah, he's not interested in building any sort of community. [02:51] mjr_: He does write pretty tight software though. [02:51] prettyrobots: Ruby based Montessori-ware. [02:51] jesusabdullah: Montessori? [02:52] jesusabdullah: I've heard of montessori schools, but [02:52] jesusabdullah: montessori-ware? What do you mean by that? [02:53] prettyrobots: It is only of interest for the development of the author as programmer, not of interest to anyone else. [02:53] jesusabdullah: Ah [02:53] jesusabdullah: I see [02:54] prettyrobots: But, the author expects a lot of praise and head pats anyway. [02:54] jesusabdullah: If I actually rewrote Panic, I'd totally make it something I'd Actually Use [02:54] Aria: ACTION laughs.  [02:54] jesusabdullah: I mean [02:54] jesusabdullah: why write something if it's not something I want myself? [02:54] Aria: That's not terribly kind to Montessori sorts. But amusingly accurate. [02:54] prettyrobots: Node.js is small enough, you might actually get a process monitor out of it. [02:55] prettyrobots: You could burrow into the V8 source to find issues. [02:55] jesusabdullah: Node has most of the necessary tools already [02:55] jesusabdullah: at least, for basic child processes [02:55] prettyrobots: http://blog.bradgessler.com/use-monit-with-rails-not-god [02:55] prettyrobots: Anyway... [02:55] jesusabdullah: http://jesusabdullah.github.com/2010/08/04/node-the-supervisor.html [02:55] jesusabdullah: A crappy blog I wrote [02:56] Anti-X: of course you should always believe everything you write. people are never biased in any way [02:56] Anti-X: uhm [02:56] Anti-X: read [02:56] Anti-X: important distinction [02:57] jesusabdullah: read everything you write? Or believe everything read? [02:57] tav has joined the channel [02:57] Anti-X: guess [02:57] jesusabdullah: Both, clearly [02:57] jesusabdullah: :D [02:57] Anti-X: ha [02:57] ako has joined the channel [02:57] Anti-X: jesusabdullah++ [02:57] v8bot: Anti-X has given a beer to jesusabdullah. jesusabdullah now has 1 beers. [02:59] jesusabdullah: Hmm [02:59] prettyrobots: Anyone have any interest in a JSON path language? [02:59] jesusabdullah: What does that mean? [02:59] Anti-X: answer is no [02:59] prettyrobots: JSON query langauge? [03:00] Anti-X: json should be a data structure, not a catalog [03:00] prettyrobots: That is now I got to Promised-IO. [03:00] jesusabdullah: Also, what do people actually mean when they say "daemonized process?" Just that it's backgrounded, or what? Because I guess I think of daemonized processes as those that should already be process-monitored somewhere [03:00] prettyrobots: Anti-X: Uh, huh. [03:00] prettyrobots: So? Data structures get complicated. [03:00] jesusabdullah: Does that make sense? [03:01] Anti-X: daemonized means hidden yeah [03:01] jesusabdullah: Okay [03:01] jesusabdullah: because, yeah, I don't want to be watching something that already has start and stop trickery [03:01] jesusabdullah: Things that *maybe* would be backgrounded with an & [03:01] prettyrobots: Looking for a solution for getting the instance ID out of a JSON converted ressponse form EC2. [03:01] prettyrobots: http://bigeasy.github.com/node-ec2/ [03:02] jesusabdullah: Monit files actually look pretty nice [03:02] prettyrobots: The example call to "poll" makes me think a JSON query language would be useful. [03:02] jesusabdullah: for what monit can do [03:02] jesusabdullah: Anyways: [03:02] prettyrobots: jesusabdullah: It is nice. And it is really focused, and small. [03:02] zith_: jesusabdullah: daemonized processes to me are processes that are running on their own, without being attached to any shell [03:02] jesusabdullah: ACTION & friends [03:02] prettyrobots: I use it to watch Node.js. [03:02] jesusabdullah: I'll have to give monit a shot then [03:03] jesusabdullah: for personal use [03:03] jchris has joined the channel [03:03] prettyrobots: Anyway, that's why I asked about Promised-IO because the same person is at the helm of JSONPath now. [03:03] jesusabdullah: oh, monit has this check file thing too [03:03] jesusabdullah: I hear he's a smart dude, prettyrobots [03:03] jesusabdullah: orite, friends [03:03] prettyrobots: Mr. Promised-IO? [03:03] Anti-X: for personal abused [03:03] jesusabdullah: trivia night at the pub, wanna get a team together [03:03] Anti-X: -d [03:04] jesusabdullah: tssch ;) [03:04] jesusabdullah: PERHAPS >:P [03:06] prettyrobots: http://github.com/JasonSmith/jsonquery/blob/master/JSONQuery.js [03:06] prettyrobots: Interesting. [03:07] prettyrobots: Is there some simple way to Node.js ify something in the wild? [03:07] prettyrobots: I've had to just: [03:07] prettyrobots: module.exports.sprintf = sprintf; [03:07] prettyrobots: At the bottom of something I've downloaded from the web. [03:08] prettyrobots: I'm wondering if there is a better, npm sort of way to do this? [03:10] noahcampbell has joined the channel [03:13] eisd has joined the channel [03:16] prettyrobots has joined the channel [03:17] deepthawtz has joined the channel [03:18] ajpiano has joined the channel [03:19] cloudhead has joined the channel [03:20] ajpiano has joined the channel [03:21] ajpiano has joined the channel [03:23] ivong has joined the channel [03:23] ajpiano has joined the channel [03:26] aho has joined the channel [03:30] diorahman has joined the channel [03:36] iwasbiggs has joined the channel [03:40] bradleymeck has joined the channel [03:41] jbenesch has joined the channel [03:46] MikhX has joined the channel [03:46] benburkert has joined the channel [03:47] PyroPeter has joined the channel [03:49] ajpiano has joined the channel [03:55] jbenesch1 has joined the channel [04:00] galaxywatcher has joined the channel [04:02] benburkert has joined the channel [04:02] jbenesch has joined the channel [04:04] EyePulp has joined the channel [04:07] bpot has joined the channel [04:13] x_or has joined the channel [04:14] MikhX has joined the channel [04:18] benburkert has joined the channel [04:18] ryah: "Montessori-ware" hah. [04:18] ryan[WIN]: hurp [04:19] mjr_: I wish I knew enough about alternative education or programming languages to make some sort of waldorf or unschooling reference. [04:19] mjr_: But I don't. [04:20] ryah: i really like the http-parser, but doing major refactors to it is extremely painful [04:21] bpadalino: is that the super optimized one ? [04:21] creationix has joined the channel [04:21] ryah: i suppose [04:23] alcuadrado has joined the channel [04:23] bpadalino: working with the code base looks about as fun as a root canal (no offense) [04:23] ryan[WIN]: what, get all high on nitrous and you'll get through it [04:23] ryan[WIN]: but feel bad for a day or two [04:24] ryah: it's like pruning a bonsi tree [04:24] al-maisan: Hello, how do I run a particular test (test/simple/test-mkdir-rmdir.js) and turn on the console.log() messages while doing so? [04:24] ryah: al-maisan: mkdir test/tmp; ./node test/simple/test-mkdir-rmdir.js [04:25] al-maisan: ACTION tries that [04:25] bpadalino: i can barely trim my own sideburns .. a bonsai tree sounds like it would be a bonsai stump very quickly :( [04:26] bpadalino: the code actually reminds me a lot of fsms in vhdl [04:27] junya_ has joined the channel [04:28] sahazel has joined the channel [04:29] Yuffster_work has joined the channel [04:30] micheil has joined the channel [04:32] mjr_: ryah: what are you trying to get out of http parser? [04:33] al-maisan: ryah: that worked. I built node-v0.2.2 on Ubuntu 10.10 and two tests failed (because the "mkdir test/tmp" step was missing?): test/simple/test-mkdir-rmdir.js and test/simple/test-fs-symlink.js [04:33] marshall_law has joined the channel [04:45] mr_daniel has joined the channel [04:52] JimBastard has joined the channel [04:54] Tim_Smart has joined the channel [05:02] sechrist: creationix: ping [05:02] creationix: pong [05:03] sechrist: in Step, if I use multiple things with parallel() or group() that don't have the same output, will that work? [05:03] sechrist: it's not seeming to for me [05:03] creationix: as long as they all expect node style callbacks [05:03] sechrist: like I would assume that an array of the completed results would be passed to argument 2 of the next function [05:03] sechrist: they're all err, res [05:04] creationix: yes, with group you'll get a single array, and with parallel you'll get an entry for each result [05:04] creationix: sechrist: gist? [05:05] sechrist: creationix: https://gist.github.com/8f2884e644da2d116b82 [05:05] creationix: ahh [05:05] creationix: group needs to be called twice [05:05] creationix: group() is the callback [05:05] creationix: this.group() is the callback generator [05:05] sechrist: oooh [05:08] sechrist: did that, and it's not firing to the next one hmm [05:09] creationix: did you update the gist? [05:09] mikew3c_ has joined the channel [05:09] sechrist: yea [05:09] creationix: you still need to call group twice [05:09] sechrist: I also tried this.group().. none of them fired [05:09] sechrist: wait what [05:10] creationix: var group is the callback generator [05:10] creationix: so "var group = this.group()" holds a single place in the arguments of the next step and returns a callback generator [05:10] creationix: then you have to use group() for each callback [05:11] creationix: I would rename my variables, but I can't think of anything more meaningful that's not super long [05:11] MikhX has joined the channel [05:11] creationix: maybe change this.group() to this.getGroup() [05:12] creationix: or this.reserveGroup() [05:12] sechrist: ah gotcha.. working now [05:12] sechrist: then the arguments stack up [05:12] sechrist: I was expecting res to be an array, not more arguments [05:12] sechrist: working fine now [05:12] creationix: res should be an array [05:13] creationix: this.parallel() puts them as individual arguments [05:13] creationix: check the example at http://github.com/creationix/step/blob/master/README.markdown [05:14] sechrist: group is producing a "err, res, res2" [05:14] sechrist: instead of one array [05:14] creationix: gist please [05:14] sechrist: updated [05:14] creationix: ahh, that's because you're making two groups [05:14] creationix: is that what you intended? [05:15] sechrist: that's what I thought you meant by call group twice [05:15] sechrist: I did this.group() as both callbacks and it never fired [05:15] creationix: I meant this.group()() [05:15] sechrist: ohohohoh [05:15] creationix: what you have is good, just use the first group for both [05:16] sechrist: ah I see what I did, the two groups acted like parallel [05:16] creationix: so Step has three kinds of callbacks, they are "this", this.parallel()", and "this.group()()" [05:16] sechrist: thanks for clarification. [05:16] creationix: yeah, you're not the first to be confused [05:17] creationix: btw, it looks like parallel is what you're looking for here [05:17] creationix: unless you really want both results in a single array [05:17] creationix: usually group is for when there are N callbacks in a step [05:17] creationix: when there is a fixed number parallel is usaally better [05:17] creationix: but that's up to what you want [05:19] amerine has joined the channel [05:20] jbenesch has joined the channel [05:20] langworthy has joined the channel [05:21] sh1mmer has joined the channel [05:21] brianmario has joined the channel [05:21] sh1mmer: ryah: yt? [05:22] creationix: sh1mmer: wassup [05:22] sh1mmer: how's it going? [05:24] creationix: good, finishing my slides [05:24] creationix: sh1mmer: so you're in Berlin and it's morning now? [05:24] sh1mmer: no [05:24] sh1mmer: Atlanta tomorrow [05:24] sh1mmer: Berlin on Friday (Berlin time) [05:24] creationix: ahh, for some reason i thought you had already left [05:25] creationix: it's hard to keep track of you speaker types ;) [05:25] zomgbie has joined the channel [05:25] sh1mmer: pah [05:30] vhost- has joined the channel [05:34] dacc has left the channel [05:41] ajsie: so node uses an event loop for non-blocking IO..i wonder ..is that event loop in the same thread as the main thread for node.js? [05:41] aconbere has joined the channel [05:42] creationix: ajsie: yes, it's all one thread [05:42] creationix: the main thread is the event loop [05:42] creationix: there are thread pools for things like filesystem I/O however [05:43] creationix: anything that doesn't have an async api needs to run on a thread pool or get chopped into small enough chunks to not hurt the reactor [05:43] ajsie: creationix: okay get it [05:43] creationix: ajsie: it's the same model as javascript in the browser [05:44] sh1mmer: Tim do you know when the event loop contexts switches? is it per outer-most function or does it hold closures and switch during inner functions too? [05:44] ajsie: so the CPU can just run one request at the time? [05:44] ajsie: eg. 1 request == 1 thread cycle ? [05:45] ajsie: so it has to finnish 1 request as fast as possible to serve the other request? [05:45] creationix: sh1mmer: what do you mean? [05:45] creationix: ajsie: node can only use one core at a time (for the main logic) [05:46] creationix: but since I/O is non-blocking that could be 1,000 concurrent request all in I/O wait somewhere [05:46] sh1mmer: creationix: nevermind I think it was a dumb question, I just answered in my own head [05:46] sh1mmer: creationix: you have a stack of callbacks waiting to be fired in order [05:46] creationix: sh1mmer: something like that [05:46] sh1mmer: and the callbacks get fired once the current execution stops [05:46] creationix: I'm not sure exactely how it works, I just know it only runs one event at a time [05:47] sh1mmer: creationix: I'm going to have to ask Ryan some specific questions [05:47] creationix: have fun and let me know what you find out [05:47] sh1mmer: will do [05:47] creationix: I think it just works like select [05:47] sh1mmer: I was talking to an erlang guy about it [05:47] creationix: I know libev is a select abstraction [05:47] devkorcvince has joined the channel [05:47] sh1mmer: pretty interesting he had some great questions [05:48] sh1mmer: like killing "long running" functions [05:48] sh1mmer: etc [05:48] sh1mmer: to protect the server [05:48] creationix: ajsie: it's not about finishing the request as fast as possible, but finishing your small sync block of code as fast as possible [05:48] ajsie: creationix: okay [05:48] creationix: ajsie: A single http request can use several small chunks of code interleaved with long I/O waits [05:49] ajsie: creationix: okay [05:49] sh1mmer: ajsie: that's why the non-blocking thing is important [05:49] mytrile has joined the channel [05:49] sh1mmer: ajsie: because it means "slow" things can be deferred [05:49] peburrows-mobile has joined the channel [05:50] ajsie: creationix: so as i said, one thread at the time for one client only right? [05:50] peburrows-mobile has joined the channel [05:50] sh1mmer: ajsie: no [05:50] sh1mmer: ajsie: one thread for everyone [05:50] sh1mmer: ajsie: because you can "hold" a client while you are waiting for it's callbacks [05:50] ajsie: so if i have 100 lines of code .. i have to run from 1 till 100 before the next request could be served? [05:50] sh1mmer: ajsie: yes [05:51] ajsie: yeah thats what i meant [05:51] sh1mmer: ajsie: that's true, but typically in that 100 lines will be a callback function [05:51] ajsie: sh1mmer: yeah .. of course [05:51] sh1mmer: and that callback gets added to the stack [05:51] ajsie: maybe 5 callbacks for waiting 10 sec each [05:51] ajsie: ok [05:51] sh1mmer: so when it's ready it then calls the rest of the code [05:51] ajsie: sh1mmer: ok [05:52] ajsie: sh1mmer: so if i add "sleep 1" to it [05:52] sh1mmer: then yes [05:52] ajsie: then for every request they have to wait 1 second right? [05:52] sh1mmer: correct [05:52] ajsie: cool [05:52] sh1mmer: only we don't have sleep, we have setTimeout [05:52] ajsie: so it means. .. i have to go non-blocking all the way [05:52] ajsie: okay [05:52] sh1mmer: which is, of course, asyncronous [05:52] ajsie: ok [05:52] ajsie: cool =) [05:53] sh1mmer: so that client would wait 2 seconds but you can still server requests [05:53] ajsie: new way of thinking [05:53] sh1mmer: the main thing is to not tie up the main event loop [05:53] ajsie: ok [05:53] sh1mmer: ajsie: creationix and I will both be talking about this topic at jsconf.eu next week [05:53] ajsie: oh yeah [05:53] sh1mmer: you should look out for the slides/talks [05:53] matjas has joined the channel [05:53] ajsie: just watched 2009 one [05:53] ajsie: what is your name? so i recognize u when i watch it [05:54] sh1mmer: tom hughes-croucher [05:54] ajsie: ok [05:54] sh1mmer: I'm sh1mmer mostly everywhere [05:54] sh1mmer: easy to google :) [05:54] ajsie: okay great [05:54] ajsie: thanks for the answers .. really looking forward to node.js on backend too [05:55] creationix: ajsie: non-blocking is super cool [05:55] ajsie: yeah [05:55] creationix: fast single threaded code [05:56] creationix: that can handle massive concurrency [05:56] ajsie: it will take a long time though for other languages to adopt [05:56] ajsie: and coders especially [05:56] ajsie: look at all tutorials on internet =) [05:56] creationix: yeah, luckilly js coders from the browser are used to it already [05:56] ajsie: gonna take 10 years [05:56] ajsie: yeah [05:56] creationix: and the c people have been doing it for a while (the high performance ones) [05:57] creationix: but yeah, it's going to take a while [05:57] ajsie: creationix: yeah [05:57] ivanfi has joined the channel [05:58] creationix: so yeah, there are going to be three talks about this talk at jsconf [05:58] ajsie: just thought it was a pity leaving rails =) [05:58] ajsie: creationix: great [05:58] creationix: http://jsconf.eu/2010/speaker/techniques_for_a_single_stack.html, http://jsconf.eu/2010/speaker/techniques_and_tools_for_tamin.html, and http://jsconf.eu/2010/speaker/dont_write_spaghetti_code_in_s.html [05:59] ajsie: it was 2009 jsconf that started it all right when the creator showed us his work? [05:59] creationix: that's when it started getting really popular [05:59] creationix: I had started with node a little before that because I really liked the purity and simplicity of it [05:59] ajsie: yeah .. just 1 year [05:59] ajsie: 300 members here in node.js channel .. really awesome [05:59] creationix: node was started spring 2009 [06:00] creationix: and by jsconf.eu 2009 it was almost usable for real apps [06:00] ajsie: creationix: ok [06:00] creationix: now there is a "stable" branch [06:00] junya has joined the channel [06:00] ajsie: are you using any other scripting language for backend [06:00] creationix: nope [06:00] creationix: Used to do a lot of php/python/ruby [06:01] ajsie: how is the library djungle for it on the backend side? [06:01] creationix: the library work is where I work mostly, and it's still maturing [06:01] ajsie: is there a xml parser for example? [06:01] ajsie: ok [06:01] creationix: a couple [06:01] creationix: and a database driver for almost anything [06:01] ajsie: which database are u using? [06:02] creationix: I think in total there are about 1,000 modules for node of varying maturity [06:02] ajsie: cool [06:02] creationix: I use PostgreSQL, CouchDB, Redis, and my home-grown nStore [06:02] ajsie: ok [06:02] creationix: there is a lot of beta quality code out there [06:02] ajsie: love all the tutorials too .. simple to follow .. yet so powerful [06:03] creationix: :D [06:03] mjr_: creationix: are you copying the node KO blog articles over to howtonode? [06:04] creationix: I was, but got busy [06:04] creationix: mjr_: why, want to help? [06:04] mjr_: Oh, I dunno. Mostly just wondering. [06:04] creationix: it just takes pandoc's html to markdown converter and lots of manual editing [06:04] creationix: I figured finishing my slides was more important [06:05] mjr_: We really need good docs. I can't tell if writing more articles is the most helpful thing, or if working on the main node docs themselves is more important. [06:05] mjr_: yeah, you should, of course, get your slides and demo ready first. [06:06] creationix: mjr_: I still think a repo of canned code could help [06:06] creationix: and smaller how-to's [06:07] creationix: almost small enough to inline in the node docs [06:07] creationix: (if the node docs were not a single page we could) [06:07] mjr_: yeah, I think smaller bits of referenceable things is good [06:07] mjr_: We have a lot of articles that are great, but probably too long. [06:07] mjr_: Hard to get good and relevant search hits. [06:09] nwhite has joined the channel [06:10] creationix: yeah [06:10] creationix: I put all my slide decks on the node wiki the other day [06:10] creationix: not sure if google has picked those up yet [06:10] creationix: we need small things like "how to parse http POST 'parameters'" [06:11] mjr_: how do you forcibly close a client [06:11] mjr_: how do you do keepalive [06:11] mjr_: The list goes on and on. [06:13] jacobolus has joined the channel [06:15] creationix: yep [06:15] mjr_: I just learned that redis has blpop, a blocking list pop, and that lots of clients can all be blocked on the same thing, and redis will hand the next value to only one. [06:15] mjr_: Super cool. [06:15] creationix: nice [06:16] creationix: so sort of like transactions [06:16] mjr_: So you can jam blocks of work into it, and have multiple workers all pulling from the queue. [06:16] creationix: yeah, super useful [06:16] mjr_: you can stick in small things or large binary chunks. [06:18] benburkert has joined the channel [06:27] SamuraiJack has joined the channel [06:28] MikhX_ has joined the channel [06:29] JimBastard: man, tests, man [06:29] JimBastard: getting broodmother 100% covered, so many fucking tests [06:30] Tim_Smart: Usually you write tests first :p [06:30] Tim_Smart: Well I do anyway. [06:30] JimBastard: ahaha, yeah we are doing a rebuilding now with tests [06:30] JimBastard: all the core logic works, its just not tested [06:31] JimBastard: all the subsystems have tests for the most part [06:31] JimBastard: like http://github.com/nodejitsu/node-cloudservers/tree/master/test/ [06:31] JimBastard: its just, soo many tests [06:31] JimBastard: and not easy ones either [06:33] SamuraiJack has joined the channel [06:35] ajsie: i want to do some server push ... if i use node.js .. do i still need to use rabbitmq and such messaging systems? [06:36] V1 has joined the channel [06:37] JimBastard: ajsie: no [06:38] mbrochh has joined the channel [06:38] mbrochh has joined the channel [06:38] JimBastard: you can just not fire response.end() until you are ready [06:38] JimBastard: for httpServer [06:39] ajsie: JimBastard: ok [06:41] ph^ has joined the channel [06:41] ajsie: JimBastard: what is AMQP compared to node.js? [06:41] ajsie: and could node.js replace that? [06:42] JimBastard: The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for Message Oriented Middleware. [06:43] JimBastard: Node.js is an evented I/O framework for the V8 JavaScript engine. It is intended for writing scalable network programs such as web servers. [06:43] JimBastard: define: replace [06:47] mape: Bah, what happened to connect :( [06:47] creationix: mape: what do you mean? [06:47] mape: Just updated it and it broke a ton of stuff [06:47] creationix: api changes? [06:48] mape: Probly [06:48] mape: Where are those documented? [06:48] creationix: I think tj recently made a release [06:48] creationix: I've been removing stuff [06:48] creationix: I hope it wasn't a minor point release, because that would be misleading [06:48] creationix: mape: tj usually documents everything in the changelog [06:49] saikat: also creationix fwiw, ivan's fixes to node-compress seem to be working well so far, though it's just been a day [06:49] creationix: saikat: cool [06:49] saikat: in case you still wanted gzipping for connect [06:49] V1: connect didn't become "famous" because it has killer documentation ;) [06:51] mape: creationix: 1.0.0 / 2010-07-21 seems to be the latest in History.md [06:51] creationix: that's strange [06:52] creationix: I didn't know there was a 1.0.0 release [06:52] mape: Probly better I talk to tj since express broke app.use(connect.staticProvider(__dirname + '/public')); as well [06:52] mape: and the assetmanager is totally broken [06:52] creationix: ovely [06:52] mape: http://github.com/senchalabs/connect/blob/master/History.md [06:52] jbenesch has joined the channel [06:52] creationix: I'm afraid I'm busy prepping for jsconf, or I'd help out [06:52] diorahman: Oh no! [06:54] FuzzYspo0N has joined the channel [06:54] prettyrobots: Does gzip work on streams or does the entire file have to be present? [06:54] mape: At least it is easy to step back in versions with npm :) [06:55] creationix: mape: that's good [06:55] creationix: it can work on streams [06:55] mape: So is the gzip thingys less bad in connect now? [06:55] prettyrobots: That's what I thought. [06:56] prettyrobots: Thank you. [06:56] mape: creationix: Any idea when tj usually gets online? [06:56] prettyrobots: Humm... [06:56] creationix: he doesn't always get on irc, but is almost always on github [06:56] prettyrobots: Okay. So, is there a nice evented library to gzip available? [06:56] creationix: mape: file a ticket and he'll probably respond [06:57] creationix: though it's almost midnight at his house [06:57] creationix: prettyrobots: I just feed chunks to gzip in a child process [06:57] mape: Hmm k, guess I'll look at it after work [06:57] creationix: prettyrobots: I'm not sure about the other options [06:57] prettyrobots: And gzip feeds you chunks back when it gets some squishing done? [06:58] ivong has left the channel [06:58] adambeynon has joined the channel [06:58] V1: Is anyone here running a large scale Socket.io application? [06:58] ajsie: JimBastard: I mean, if I want to create live web applications could I use node.js/express entirely for that or am I gonna need AMQP/RabbitMQ too? [06:59] ajsie: that's what I meant with replace [07:01] creationix: prettyrobots: I assume so [07:01] digitalspaghetti has joined the channel [07:01] prettyrobots: I'll sort it out with Google. [07:02] prettyrobots: ajsie: You can use whatever acronyms you like. [07:02] prettyrobots: I always use at least a dozen acronyms in my web applications. It makes them more Serious. [07:03] ph^ has joined the channel [07:03] JimBastard: ajsie: you can just use node [07:03] JimBastard: you'll be fine [07:03] JimBastard: for "live" web applications [07:04] creationix: ajsie: there is nothing wrong with using existing libraries if they work [07:04] creationix: but node is capable of about anything [07:04] creationix: with enough writing [07:04] ajsie: creationix: okay [07:04] prettyrobots: I always use JSON, XML, HTTP, TCP/IP, AJAX, and NoSQL or SQL. And then I only have a half dozen more to be acronym compliant. [07:04] prettyrobots: ajsie: The nice thing about Node.js is that you can get a lot done with a really short stack. [07:05] JimBastard_ has joined the channel [07:05] prettyrobots: You end up using a lot fewer frameworks. [07:05] JimBastard_: i just tell people my startup does "node.js cloud hosting" [07:05] ajsie: prettyrobots: what do you mean by acronym? [07:05] JimBastard_: thats enough buzzwords to make you shit your pants [07:06] prettyrobots: ajsi: I'm being a dick. [07:06] prettyrobots: If you really need a message queue, well, you really need a message queue. [07:06] prettyrobots: But, you sure as hell can build a web application without one. [07:09] peol_ has joined the channel [07:09] creationix: ajsie: I know ryah was working on a node bindings for AMQP or something a while back [07:10] creationix: I don't really understand it all other than it's more complicated than it should be [07:10] creationix: (AMQP that is) [07:10] ajsie: creationix: ok [07:10] ajsie: im reading about it now to get a good pic of it and why i should want to use it [07:10] JimBastard_: ajsie: for making real-time web apps [07:11] JimBastard_: or reusing javascript code [07:11] JimBastard_: really, services too [07:11] JimBastard_: tcp services [07:12] Tim_Smart: Just make node.js RESTful JSON api, with a HTML5 front-end backed with a NoSQL database. [07:12] Tim_Smart: lolwut? [07:13] JimBastard_: http://github.com/marak/webservice.js [07:13] JimBastard_: thats part of it [07:13] JimBastard_: :-D [07:13] Tim_Smart: I just felt like putting awesome words in a awesome sentence. [07:15] jesusabdullah: blah blah HTML5 Web workers blah blah web 3.0 asynchronous [07:17] jesusabdullah: blah blah comet cloud blah blah [07:17] mies has joined the channel [07:24] Nohryb has joined the channel [07:24] nwhite_ has joined the channel [07:24] prettyrobots: http://bigeasy.github.com/node-tar/ [07:24] freeall has joined the channel [07:25] SamuraiJack has joined the channel [07:26] mjr_: evented tar reader. Cool. [07:27] prettyrobots: I'm using nginx in front of Node.js processes monitored by Monit and connecting to MongoDB. [07:27] prettyrobots: Running on Webbynode with mirroring of MongoDB to EC2. [07:27] prettyrobots: ajsie: It is cheap and powerful. [07:28] prettyrobots: mjr_: Yup. At 74 lines of CoffeeScript, now. [07:28] prettyrobots: http://github.com/bigeasy/node-tar/blob/master/src/tar.coffee [07:28] prettyrobots: I don't have all of the header parsed yet. [07:29] prettyrobots: Hmm... [07:29] rnewson has joined the channel [07:30] ryah: prettyrobots: parsing tar? [07:30] ryah: cool [07:30] prettyrobots: Yes [07:30] ryah: you should do it in js [07:30] ryah: so people can use it :) [07:30] JimBastard_: !tweet @nodecore we got one, its called nStore http://github.com/creationix/nStore [07:31] prettyrobots: ryah: Really? I asked around here and people said CoffeeScript was cool. [07:31] ryah: it is - yes [07:31] prettyrobots: The API is documented in JavaScript. [07:31] prettyrobots: http://bigeasy.github.com/node-tar/ [07:31] virtuo has joined the channel [07:31] konobi: ryah: hey... on the other side of the pond? [07:32] ryah: konobi: no - still here [07:32] TomsB has joined the channel [07:32] konobi: ah... just missed ya today =0) [07:32] konobi: when are you headed? [07:33] ryah: been under a shell trying to fix something - thrusday [07:33] pdelgallego has joined the channel [07:33] konobi: ryah: ah... heh [07:34] prettyrobots: ryah: Well, thanks for the FUD. [07:35] delapouite has joined the channel [07:35] ryah: once we get js compiled into elf, im going to start using coffeescript a lot more :) [07:36] prettyrobots: I'm using it for everything. [07:36] ryah: atm i don't like the dependency [07:36] prettyrobots: There is no dependency if you compile it to JS. [07:37] ryah: yeah, i suppose that's true [07:37] tpryme has joined the channel [07:37] prettyrobots: Install from npm, document the API in JavaScript, provide a node_modules branch with the generated JavaScript checked in. [07:38] konobi: coffeescript seems to be more layers to add to strange debugging [07:38] konobi: oh... this coffeescript only seems to compile to javascript that creates reference cyclic closures... fun [07:38] FuzzYspo0N: whew [07:39] JimBastard_: we dont really use CF here [07:39] JimBastard_: it adds overhead to our current workflow [07:39] JimBastard_: but it makes sense for a lot of things [07:39] ryah: it looks cute, that's for sure :) [07:39] konobi: DSLs are dangerous [07:40] JimBastard_: all our developers has a lot of JS experience, but if new people with experience were going to come on, i might make them use CF [07:40] JimBastard_: without [07:40] JimBastard_: damn im flailing [07:40] konobi: for example, perl has 3 DSLs... and they're _highly_ domain specific... ruby... how many frameworks do you wanna play with... cos it's just another DSL to learn [07:40] JimBastard_: need to sleep [07:41] prettyrobots: konobi: I'm sure any problems will get sorted. [07:41] prettyrobots: I'm able to write better code faster. [07:41] konobi: better coffeescript perhaps... doesn't guarantee that it's better javascript [07:42] hellp has joined the channel [07:42] prettyrobots: It is easier to audit the generated JavaScript and adjust the CoffeeScript, than it is to write the JavaScript. CoffeeScript is far more expressive and it makes annoying things easier. [07:42] konobi: until you start bundling things on top... coffeescript for cutting around certain javascript languages, etc. etc. [07:42] konobi: *libraries [07:43] prettyrobots: Huh? [07:43] FuzzYspo0N: im having some interesting timing issues with v8 hrmhrm. If i call a function repeatedly it doesnt seem to be stable at times. [07:43] konobi: coffeescript "syntax" that gets added for dealing with socket.io, [07:43] konobi: then dnode on top of that, then xyz on top of that [07:43] ryah: ACTION goes back under his shell. [07:43] ryah: ACTION away [07:43] konobi: ryah: =0) [07:44] konobi: ttfn [07:44] konobi: ryah: can you drop me an email for scrum please [07:45] prettyrobots: konobi: I'm looking at the JavaScript that comes out of CoffeeScript, and I don't see a problem. [07:46] FuzzYspo0N: haha ry i just saw the v8 mailing list post [07:46] FuzzYspo0N: thats trippy [07:46] konobi: prettyrobots: not right now [07:46] konobi: but it's like your crack dealer giving you your first hit for free [07:46] prettyrobots: That's bullshit. [07:47] prettyrobots: Now your arguing that you'll be right eventually. [07:47] prettyrobots: But, let's just agree that you're wrong now. [07:47] ajsie: are you using expressjs for creating web applications? [07:48] konobi: prettyrobots: heh... been through this scenario 2-3 times before... same shit different day [07:48] prettyrobots: So long as we agree. [07:49] konobi: really, you can use it as much as you want, doesn't affect me... but these things have a habit of spiralling out of control [07:49] prettyrobots: I don't know what you are on about. [07:50] konobi: *shrug* [07:50] prettyrobots: Really, I'm looking at the JavaScript that CoffeeScript generates, and it is complicated as I've made it in CoffeeScript. [07:50] prettyrobots: You can write bad JavaScript as easily in JavaScript. [07:51] prettyrobots: CoffeeScript makes it easier to get some of the idioms right. [07:52] konobi: ircretary: when was dannycoates here? [07:52] ircretary: konobi: when what now? [07:52] konobi: ircretary: when did you see dannycoates? [07:52] ircretary: konobi: when what now? [07:52] konobi: humbug [08:02] jetienne has joined the channel [08:03] dipser has joined the channel [08:08] derencius has joined the channel [08:13] spetrea has joined the channel [08:17] GarethAdams|Work has joined the channel [08:17] GarethAdams|Work has left the channel [08:19] TobiasFar has joined the channel [08:22] kjeldahl has joined the channel [08:23] nroot7 has joined the channel [08:29] Throlkim has joined the channel [08:32] V1: ^_^ I got a183 active socket.io clients connected atm fun stuff. [08:34] Tim_Smart: V1: To what? [08:34] Tim_Smart: Make that, what for? [08:35] digitalsatori has joined the channel [08:36] ooooPsss has joined the channel [08:37] V1: Tim_Smart: http://speedo.no.de :) [08:37] V1: 190 active clients atm [08:38] saikat: V1: nice [08:38] TomY has joined the channel [08:38] markwubben has joined the channel [08:39] V1: It's gonna be fun seeing it scale [08:40] V1: My memory is rather stable atm and goes up and down based on the amounts of clients connected to the service [08:40] V1: But at night my memory sky rockets to 1 gig [08:40] V1: Which would be about 800 active users [08:41] V1: Gonna be fun to my server explode under that presure :) [08:41] Tim_Smart: What about CPU? [08:41] jetienne: V1: do you know what consume this memory ? [08:42] V1: jetienne: I have no clue atm, it really hard to see. But It's probably something socket / socket.io related [08:42] V1: as that is the only part that is spinning like a mad man [08:42] jetienne: this is like 12.5 mbyte per connections, it seems a lot [08:42] V1: CPU is rather stable only 0.1% CPU Tim_Smart [08:42] V1: At this point [08:43] Tim_Smart: Yeah that is a lot of memory for 800 clients. [08:43] dipser: *surprised* [08:43] V1: Yeah and I have virtually NO CLUE what is goin on there [08:43] jetienne: compared to the http parser (26byte per connection) :) [08:43] V1: jetienne: Those are not persistent connections [08:44] V1: there are [08:44] stagas has joined the channel [08:44] V1: these are* [08:44] neptun3 has joined the channel [08:44] Tim_Smart: It probably is socket.io [08:44] Tim_Smart: I managed to make one of my servers use 3x less memory by just doing a refactor. [08:45] jetienne: maybe there arent all in websocket... V1 do you know the ratio websocket thru socket.io. compared to other fall back [08:45] jetienne: Tim_Smart: oh and you published ? [08:46] V1: 80% flash socket, 10% websocket 9% polling 1% other [08:46] jetienne: oh in itself this is nice to know. websocket is far from being deployed, even for very modern stuff [08:46] kjy112 has joined the channel [08:48] dipser: would be cool to know if it has to do with one of theres protocols? or if it is another problem [08:49] V1: It would indeed be cool to know :p [08:50] dipser: just kill all flashsocket connectors to see ;) [08:50] caolanm has joined the channel [08:50] Tim_Smart: You can just drop the transport in the client code. [08:50] jetienne: it can be benched against socket.io quite easily. if someone for time/will to test [08:51] viktors has joined the channel [08:57] omarkj has joined the channel [09:01] q_no has joined the channel [09:03] xla has joined the channel [09:10] prettyrobots: Now reading entire USTAR formatted tar archive. [09:10] prettyrobots: http://bigeasy.github.com/node-tar/ [09:11] AAA_awright: Are there any auto-documenting programs for Javascript source? [09:12] mape: Websockets work lovely on the ipad <3 [09:12] MikhX has joined the channel [09:12] prettyrobots: http://github.com/visionmedia/dox [09:12] prettyrobots: Haven't used it myself. [09:12] AAA_awright: prettyrobots: Wow thanks [09:16] omarkj: mape: Are they working on mobile Safari ? [09:16] omarkj: Are you using the developer preview of iOS? [09:17] adambeynon has joined the channel [09:18] agnat has joined the channel [09:19] prettyrobots: Is there a native PostgreSQL client in Node.js? [09:19] prettyrobots has left the channel [09:19] Tim_Smart: prettyrobots: http://github.com/ry/node_postgres http://github.com/creationix/postgres-js [09:20] Tim_Smart: >.> [09:20] Tim_Smart: He obvious didn't really want an answer. [09:20] Tim_Smart: s/obvious/obviosuly/ [09:20] diorahman has joined the channel [09:20] Tim_Smart: s/u/// [09:20] SamuraiJack has joined the channel [09:21] mbrochh has joined the channel [09:21] diorahman has left the channel [09:24] omarkj: Hah. [09:30] FuzzYspo0N: s///// [09:31] sahazel has joined the channel [09:33] mytrile has joined the channel [09:36] mikeal has joined the channel [09:40] herbySk has joined the channel [09:41] MikhX has joined the channel [09:42] mape: omarkj: Yeah [09:42] mape: on 1.4.2 [09:42] omarkj: Oh yeah, that's excellent news. [09:43] mape: and the latency was awsome then I tried my websocket stuff out [09:43] omarkj: Awesome good I hope. [09:44] omarkj: Well, looking forward to that update. [09:47] mytrile has joined the channel [09:53] ph^ has joined the channel [09:54] Gruni has joined the channel [09:55] V1: O? websocket ipad [09:55] V1: naice [09:56] matjas: hmm, the homebrew formula for node.js hasn't been updated since node.js v0.1.99 [09:56] matjas: npm is out of date too [09:57] AAA_awright_ has joined the channel [09:58] jdevesa has joined the channel [09:58] omarkj: No, I've got 0.2.0 from homebrew here. [09:59] omarkj: No, 0.2.2. [10:03] mikeal: waht time is it [10:03] mikeal: where ry is ? [10:04] Nohryb has joined the channel [10:05] Tim_Smart: mikeal: 3am I think (SF?) [10:06] Tim_Smart: Cool Userscript for Github: http://userscripts.org/scripts/show/76422 [10:06] mikeal: damn [10:06] mikeal: i need to talk to him about this patch [10:06] Tim_Smart: (Userscript works on Chrome aswell) [10:08] mytrile has joined the channel [10:12] path[l] has joined the channel [10:14] evanpro has joined the channel [10:20] Tim_Smart: v8: 'test' [10:20] v8bot: Tim_Smart: "test" [10:20] Tim_Smart: v8: var test, test2; [test, test2] = [1, 2]; [10:20] v8bot: Tim_Smart: "ReferenceError: Invalid left-hand side in assignment" [10:20] Tim_Smart: :/ Not yet. [10:22] TomsB has joined the channel [10:24] mytrile has joined the channel [10:30] aubergine has joined the channel [10:31] zomgbie has joined the channel [10:32] prettyrobots has joined the channel [10:40] Tasser has left the channel [10:43] ivanfi has joined the channel [10:59] aliem has joined the channel [11:01] ekidd has joined the channel [11:02] fermion has joined the channel [11:03] d0k has joined the channel [11:05] elliottkember has joined the channel [11:05] stagas has joined the channel [11:06] elliottkember has left the channel [11:11] zorzar_ has joined the channel [11:17] mikew3c has joined the channel [11:24] hassox has joined the channel [11:28] hassox has joined the channel [11:30] c4milo has joined the channel [11:34] alexb_ has joined the channel [11:54] aliem_ has joined the channel [11:55] mikeal has joined the channel [11:55] V1: Tim_Smart: I doubt it will even be implemented in V8, its Mozilla stuff [11:56] Tim_Smart: Oh right. I thought it was ECMA stuff [11:56] alexb_: Does http request cache dns info? [12:00] s0enke: Tim_Smart, http://gist.github.com/590973 << where is the inheritance? ;-) [12:01] Tim_Smart: s0enke: That is just extending the prototype [12:01] Tim_Smart: s0enke: Inheritance: Animal.prototype = Object.create(Parent.prototype); [12:01] d0k has joined the channel [12:02] s0enke: Tim_Smart, yes. ok, we think the same here :) [12:02] SamuraiJack has joined the channel [12:03] s0enke: btw is there any howtos out for avoiding async/callback spaghetti/ "fir tree" programming? [12:04] s0enke: (hot topic i guess) [12:04] Tim_Smart: There are several ways of doing it. [12:05] FuzzYspo0N: 1) logic [12:05] FuzzYspo0N: >:3 [12:05] Tim_Smart: Here is a way without using a library http://gist.github.com/560231 [12:07] bpadalino: does that have scope implications ? [12:08] bpadalino: where even though you are using the function in one scope, it is defined outside of that current scope? [12:09] bcg has joined the channel [12:10] Tim_Smart: bpadalino: You run into scope problems if you want to pass more than the error and results. [12:11] bpadalino: is it generally bad practice to want to pass more than the error and results ? [12:12] Tim_Smart: Nope, right now I'm making a ORM that ran into the same problem. I'm using prototypes to get around it. [12:12] Tim_Smart: (Unless you nest closures in a function, which is bad for the GC) [12:12] guid has joined the channel [12:14] bpadalino: interesting [12:14] s0enke: Tim_Smart, any example code yet? ;) [12:15] Tim_Smart: For? [12:15] s0enke: Tim_Smart, the passing of more vars, do it via prototypes [12:16] Tim_Smart: Oh. I can show you one I did a while ago in CoffeeScript [12:16] s0enke: that's be great [12:16] Nohryb has joined the channel [12:16] Tim_Smart: http://github.com/Tim-Smart/nodudio/blob/master/src/service.coffee#L17-181 [12:17] Tim_Smart: I used a EventEmitter [12:19] bpadalino: hrm .. does this translate into the callback spaghetti in js tho ? [12:19] s0enke: awesome. at the first look i tought it's ruby :P [12:20] Tim_Smart: bpadalino: Nope. It compiles to http://github.com/Tim-Smart/nodudio/blob/master/build/service.js#L23-270 [12:21] stagas_ has joined the channel [12:21] bpadalino: thanks [12:23] s0enke: ok, now reading coffeescript and eventemitter. nuff for now ;) [12:24] Tim_Smart: I was using nested functions beforehand, but it used 3-4x more memory. [12:31] javajunky has joined the channel [12:31] javajunky: lo [12:31] mikeal has joined the channel [12:31] skampler: Tim_Smart: are ou using event emitters as an alternative to nested calllbacks? [12:32] c4milo: I use events as an alternative for callbacks :) [12:32] Tim_Smart: In that case a EventEmitter / prototype approach, as it seemed to fit the application well. [12:32] c4milo: s/callbacks/nested callbacks/ [12:32] skampler: oh that sounds interesting! [12:32] diorahman has joined the channel [12:33] javajunky: is it possible to tell a running node process which version of a given npm package to use ? [12:33] Tim_Smart: javajunky: You have to make sure it is installed first, but require('package@version') [12:33] javajunky: or does it happen magically by configuring it in the package.json ? [12:33] javajunky: ty :) [12:34] javajunky: I know I should have known, but someone asked me and I realised I didn't ;) [12:36] jchris has joined the channel [12:37] xla has joined the channel [12:39] dnolen has joined the channel [12:42] ysynopsis has joined the channel [12:49] aliem has joined the channel [12:49] niemeyer has joined the channel [12:50] jherdman has joined the channel [12:50] ctp has joined the channel [12:52] TomsB has joined the channel [12:53] matschaffer has joined the channel [12:58] siculars has joined the channel [12:59] trotter has joined the channel [13:01] niemeyer_ has joined the channel [13:05] bcg has joined the channel [13:08] aho has joined the channel [13:10] waka has joined the channel [13:12] Nietecht has joined the channel [13:14] davidwalsh has joined the channel [13:16] bcg has joined the channel [13:16] gthb has joined the channel [13:16] christophsturm has joined the channel [13:18] matschaffer has joined the channel [13:20] Damian1 has joined the channel [13:21] hsuh has joined the channel [13:21] zmbmartin has joined the channel [13:21] Damian1: sa [13:27] davidsklar has joined the channel [13:31] matschaffer has joined the channel [13:31] matschaffer has joined the channel [13:35] CrabDude has joined the channel [13:38] jakehow has joined the channel [13:41] CrabDude has joined the channel [13:46] pgriess has joined the channel [13:47] matschaffer has joined the channel [13:47] k_unit has joined the channel [13:48] k_unit: hello everyone; is anyone familiar with the Express web framework? [13:49] matschaffer has joined the channel [13:50] adambeynon has joined the channel [13:50] xla has joined the channel [13:50] ben_alman has joined the channel [13:51] aheckmann has joined the channel [13:52] herbySk has joined the channel [13:53] bradleymeck has joined the channel [13:54] femtoo has joined the channel [13:54] ehaas has joined the channel [13:54] TomsB has joined the channel [13:54] TomY has joined the channel [13:56] evanpro has joined the channel [14:03] hellp has joined the channel [14:03] Anti-X has joined the channel [14:03] TomsB has joined the channel [14:06] hpoydar has joined the channel [14:07] davidwalsh has joined the channel [14:10] k_unit has left the channel [14:11] okuryu has joined the channel [14:13] TomsB has joined the channel [14:13] evanpro has joined the channel [14:14] EyePulp has joined the channel [14:15] tobiassjosten has joined the channel [14:15] dpritchett has joined the channel [14:16] mw_ has joined the channel [14:17] diorahman has left the channel [14:18] rololololo has joined the channel [14:19] matt_c has joined the channel [14:20] SamuraiJack_ has joined the channel [14:24] damian: ll [14:27] jchris has joined the channel [14:27] loincloth has joined the channel [14:30] mif86 has joined the channel [14:33] bradleymeck has joined the channel [14:33] creationix has joined the channel [14:36] adambeynon has joined the channel [14:39] aconbere has joined the channel [14:44] galaxywatcher has joined the channel [14:48] sprout has joined the channel [14:48] pwrfail has joined the channel [14:49] neytema has joined the channel [14:49] hansek__ has joined the channel [14:50] ThePub has joined the channel [14:54] quirkey has joined the channel [14:54] matt_c_ has joined the channel [14:55] ajpiano has joined the channel [14:55] wattz: hahha [14:56] wattz: any mongo fans in here? [14:56] V1: fans or users [14:56] wattz: http://nosql.mypopescu.com/post/1016320617/mongodb-is-web-scale [14:56] V1: Thats so 1996 [14:56] matt_c_: wattz: chances are there are at least two mongo fans here... [14:59] Me1000 has joined the channel [15:00] zemanel has joined the channel [15:01] ph^ has joined the channel [15:02] bcg_ has joined the channel [15:03] ph^ has joined the channel [15:03] FuzzYspo0N has left the channel [15:03] FuzzYspo0N has joined the channel [15:05] Yuffster has joined the channel [15:05] bcg has joined the channel [15:08] s0enke: do you know any git-hook that does jslint check (pre-commit, pre-receive) [15:08] bradleymeck: pre-commit is pref [15:09] s0enke: yep [15:09] bcg has joined the channel [15:09] s0enke: but developers can disable pre-commit :D [15:09] bradleymeck: well then do both if you dont trust, then again i dont like jslint, but just grab a cli jslinter and exit 1 if it fails [15:10] s0enke: bradleymeck, any tips instead of jslint? [15:10] sahazel has joined the channel [15:10] bradleymeck: not really, i just write code that makes linters cry generally [15:12] caolanm: s0enke: If you don't trust your devs your in a hole jslint probably can't get you out of ;) [15:13] technoweenie has joined the channel [15:13] ivanfi has left the channel [15:13] s0enke: well it's not about trust, but about "i don't wanna argue about coding standards". devs could disable the hook by accident etc. [15:14] s0enke: git hooks require at least symlinking .git/hooks to a place of shared hooks [15:14] creationix: s0enke: can't you just reject the commit on the server side when they try to push it [15:15] caolanm: think thats the idea [15:15] caolanm: plus a client side check [15:15] caolanm: ? [15:15] creationix: it's not as good as checking on the local repo, but easier [15:15] halfhalo: I wonder how hard it iwll be for me to stick in http basic auth in express.... [15:16] creationix: halfhalo: I'm pretty sure there is a module or two for that already [15:16] creationix: look on the connect wiki [15:16] tj has joined the channel [15:16] creationix: speaking of express ;) [15:16] s0enke: creationix, "pre-receive" states: This hook is invoked by git-receive-pack on the remote repository, which happens when a git push is done on a local repository. Just before starting to update refs on the remote repository, the pre-receive hook is invoked. Its exit status determines the success or failure of the update. [15:16] s0enke: a i read it wrong [15:17] tjholowaychuk: what lol [15:17] sudoer has joined the channel [15:17] s0enke: it was a question, not a statement. [15:17] creationix: tjholowaychuk: halfhalo was wanting http basic auth for express [15:17] s0enke: creationix, yes i can do that :) [15:17] tjholowaychuk: ohh [15:17] tjholowaychuk: basic auth is like 8 lines [15:17] tjholowaychuk: does connect not have middleware out there? [15:17] tjholowaychuk: for that [15:17] tjholowaychuk: something that small should be in core IMO [15:17] creationix: I'm pretty sure there is at least one [15:17] s0enke: creationix, the question was more if anyone is aware of git-hooks receipes around javascript/jslint [15:18] creationix: agreed [15:18] creationix: s0enke: sorry, I've only done that with svn, my git hooks are for things like re-push to github [15:18] creationix: (I store my primary repos on my own servers) [15:18] ajpiano has joined the channel [15:19] halfhalo: Yeah, 8 lines will be easy. But I think thats going to wait for another day, since I have to finish the other portion of mah feeder first [15:19] s0enke: creationix, aight [15:19] creationix: halfhalo: yeah, there are a few http://wiki.github.com/senchalabs/connect/ [15:20] tjholowaychuk: s0enke: let me know if / when you need that I think we have a middleware laying around [15:20] tjholowaychuk: just not published anywhere [15:22] halfhalo: sweet, then it won't be hard at all. Now I just have to finish every other part of the app... [15:22] s0enke: tjholowaychuk, that'd be great (gist, email or whatever) :) [15:24] x_or has joined the channel [15:24] tjholowaychuk: s0enke: https://gist.github.com/051b8594eb43bedd0744 [15:24] s0enke: uh that's basic auth not git hook :D [15:25] halfhalo: ACTION wants that [15:25] tjholowaychuk: oh i thought that is what we were talking about [15:25] tjholowaychuk: haha [15:25] s0enke: nope. but thanks anyway ;-) [15:25] tjholowaychuk: s0enke: what were you wanting to do with git hooks? [15:26] s0enke: tjholowaychuk, the question was if anyone is aware of git-hooks receipes around javascript/jslint [15:26] halfhalo: although screw returning 400's, its 404's or gtfo [15:26] halfhalo: except the 401, thats needed [15:26] jakehow has joined the channel [15:27] tjholowaychuk: s0enke: oh haha wow, not sure where I got basic auth from all this [15:27] tjholowaychuk: but nope [15:27] halfhalo: ACTION was asking bout it [15:27] s0enke: tjholowaychuk, i guess because of two concurrent threads [15:27] s0enke: ;) [15:28] bradleymeck: is there a way to emulate .apply on a new operator? [15:28] halfhalo: SOMEONE can't multiproceOHSHINYOBJECT [15:28] bradleymeck: guess i could do an extremely hacky Function... but ewwww [15:28] s0enke: ACTION passes the holy semaphore to halfhalo  [15:28] agnat has joined the channel [15:30] Anti-X: Hacky Function(tm) [15:31] SubStack: ™ [15:31] Anti-X: black square [15:31] SubStack: utf8! [15:32] nefD: ☠ [15:32] halfhalo: ACTION goes back to coding for hjs real job [15:32] nefD: ⚑ FTW ⚑ [15:32] spetrea: I have node.js 0.1.4 compiled&installed from the .tar.gz on the site (http://nodejs.org) , how do I install 0.2.2 on the same machine ? do I just untargz & ./configure & make & make install ? [15:33] caolanm: nefD: like the flags :) [15:33] SubStack: Real jobs! I wonder what those are like. [15:33] nefD: caolanm: :D [15:33] SubStack: but I don't wonder enough to go out and get one [15:34] halfhalo: well, not a real real job, but a real enough job to be a first job [15:34] caolanm: spetrea: provided you don't mind replacing your 0.1.4 copy [15:34] caolanm: oh right... job... [15:35] s0enke: spetrea, ./configure --prefix=/your/desired/path/to/0.2.2 [15:35] malkomalko has joined the channel [15:35] halfhalo: weeee being a student assistant! makes it easier to shift all blame upwards! [15:35] spetrea: s0enke: ok, can I have it replace my old stuff ? [15:35] SubStack: ACTION considers using step for this nasty bit of async code [15:35] s0enke: ah it should replace the old stuff [15:35] spetrea: caolanm: if it replaces it I hope it's ok [15:35] spetrea: s0enke: ah then it's ok [15:36] SubStack: the sync version is pretty straight forward, but to do it async I'm having to manage multiple work queues [15:36] caolanm: spetrea: yeah, it'll be fine [15:36] s0enke: spetrea, upgrades 0.1.0 -> 0.2.0 -> 0.2.0 worked seamless here wituh ./configure && make && make instal [15:36] SubStack: aha yes step will make this much easier from the looks of it [15:37] s0enke: s/wiuth/with [15:37] spetrea: what should I install for use_openssl ? [15:37] s0enke: which os? [15:37] spetrea: ubuntu [15:37] spetrea: karmic [15:38] s0enke: libssl-dev [15:38] s0enke: (apt-get install libssl-dev) [15:39] brianmario has joined the channel [15:39] steadicat has joined the channel [15:41] spetrea: why do I get this in my ./configure of 0.2.2 http://gist.github.com/591908 ? [15:41] spetrea: and what are those needed for , and how do I install them ? [15:44] benburkert has joined the channel [15:44] s0enke: spetrea, just install build-essential debian package. [15:44] s0enke: then you get the common tools for building/compiling [15:44] ryanfitz has joined the channel [15:45] wink_ has joined the channel [15:45] matt_c has joined the channel [15:45] ehaas has joined the channel [15:46] cloudhead has joined the channel [15:46] FuzzYspo0N: any c++ game developers : Id like some feedback if anyone is interested : http://blog.centrc.net/boostconfusion [15:46] jchris has joined the channel [15:47] SubStack: I don't see anything in the api docs about how NODE_PREFIX affects require() precedence [15:48] creationix: SubStack: it doesn't [15:48] Egbert9e9 has joined the channel [15:48] creationix: it's based on the physical location of the executing node binary [15:48] SubStack: how does require() know where 'sys' points? [15:48] creationix: which in a default setup is PREFIX/bin [15:49] bradleymeck: its statically built in for native modules [15:49] creationix: sys (and the other built-in libaries) are in the node binary itself [15:49] prettyrobots has joined the channel [15:49] SubStack: hmmm [15:49] tjholowaychuk: SubStack it will look ../lib/node relative to the binary [15:49] jpld has joined the channel [15:49] jpld has joined the channel [15:49] spetrea: FuzzYspo0N: about your post, I don't think portability is such a big issue when writing games.. people write games for some particular platforms and then maybe they port them to other platforms .. [15:50] spetrea: FuzzYspo0N: like for example trying to write a game that would run on both PC and playstation would probably not be easy [15:51] nerdEd has joined the channel [15:51] creationix: SubStack: just type require.paths in the repl [15:52] sprout has joined the channel [15:52] FuzzYspo0N: spetrea: not true in fact [15:52] creationix: move the binary and do it again [15:52] SubStack: creationix: I've got that part down [15:52] FuzzYspo0N: spetrea: it seems that if my game can run on windows, mac, iphone, iPad, Linux all with the same code, you would be foolish to say no right? [15:52] SubStack: creationix: I'm writing a little script that browserifies node modules [15:53] stephank has joined the channel [15:53] creationix: neat [15:53] SubStack: and some of the core libs would be handy to have browser versions of, like querystring, without having to ship that with the dist [15:53] creationix: FuzzYspo0N: html + js + css [15:54] amerine has joined the channel [15:54] FuzzYspo0N: creationix: ever made a 3d game using that? [15:54] FuzzYspo0N: ever made any game by that statement ;) [15:54] amerine has joined the channel [15:55] creationix: I've made a few games, yes [15:55] creationix: performance sucks [15:55] nsm has joined the channel [15:55] SubStack: I think I'll have an optional param nodeSource and fallback to reading process.env.NODE_SOURCE [15:56] bradleymeck: without hacks its almost impossible to get a decent game (im not talking farmville) [15:57] Egbert9e9 has joined the channel [15:57] zith_: i still think flash is a much better web game platform than html + js + css [15:58] creationix: mjr_: where is your redis client [15:58] creationix: (you've been working on one right?) [15:58] FuzzYspo0N: creationix: the problem on any 3d game is resources. Can a webpage load a massive amount of 3d assets and textures into ram without destroying the OS? [15:58] bradleymeck: zith_ agreed, however i hate its odd frame system [15:58] SubStack: zith_: once IE9 gets traction it won't be so bad though [15:58] FuzzYspo0N: or the browser* [15:58] FuzzYspo0N: and keep in mind mobile [15:58] jarfhy has joined the channel [15:58] zith_: i havnt really done that much in flash.. a game or two [15:58] FuzzYspo0N: the slightest change can destroy performance [15:58] zith_: but i liked developing for it [15:59] creationix: well, then design the game to not be a resource hog [15:59] creationix: if you want it cross platform [15:59] FuzzYspo0N: creationix: thats a really interesting comment because, all 3d is a resource hog. [15:59] creationix: 3d isn't required for fun games [15:59] creationix: in fact is often makes it harder to design fun gameplay [15:59] FuzzYspo0N: never said it was but you are choosing a subset of pixel are games [15:59] s0enke: does anyone use multinode in production? (http://github.com/kriszyp/multi-node) [16:00] FuzzYspo0N: rather, a subset of all games and saying the rest is rubbish [16:00] creationix: FuzzYspo0N: I'm not arguing, just saying that's what I'd do [16:00] FuzzYspo0N: yea, i agree im just furthering the discussion so people dont get easily misled lol [16:00] creationix: not rubbish, just hard to implement cross platform with the same code base [16:00] FuzzYspo0N: not true [16:00] creationix: things like sdl go a long ways though [16:00] creationix: and opengl apis [16:01] FuzzYspo0N: you see the interesting thing, my engine runs on win/mac/linux/pc/iPad/iPhone/ and likely android (didnt get to it yet) and its all the same code base [16:01] FuzzYspo0N: literally. [16:01] FuzzYspo0N: and the fun part about it is the engine is javascript driven [16:01] bradleymeck: yea, i need work to wind down again so i can finish sfml :( [16:01] bradleymeck: then we can throw canvas ontop [16:01] prettyrobots: icrsecretary: [16:02] FuzzYspo0N: and the UI is all web code anyway , html + css + js [16:02] FuzzYspo0N: so you can write a game in js, and run on any of those platforms [16:02] FuzzYspo0N: and the underlying code is the same (using boost under that) [16:02] prettyrobots: icrsecretary: [16:02] prettyrobots: ircecretary: [16:02] creationix: FuzzYspo0N: sounds like an ambitious project [16:02] prettyrobots: ircretary: [16:02] ircretary: prettyrobots: I'm not sure what to do with that command. Ask for help in PM and I'll tell you what I can do. [16:03] ajsie: are there hosting providers for node.js apps? [16:03] ajsie: i have to host my node.js app very soon and heroku has nothing ready yet [16:03] creationix: ajsie: anything that lets you compile your own stuff works great [16:03] FuzzYspo0N: still waiting to see that bradleymeck, get cracking :p [16:03] FuzzYspo0N: and creationix its not alone theres thousands like it [16:03] FuzzYspo0N: :) [16:03] creationix: FuzzYspo0N: cool [16:03] ajsie: creationix: what do you mean? i need hosting provider to host my node.js on the cloud [16:04] creationix: ajsie: what do you mean "cloud" that term often means several different things [16:04] prettyrobots: ajsie: I'd suggest building your own Webbynode. [16:04] prettyrobots: I do this, with Monit watching my Node.js instances. [16:04] ajsie: creationix: taking care of mongodb, uptime, caching and so on so i can only focus on the app logic [16:04] creationix: if you just want something hosted on the internet, then ec2, slicehost, rackspace, linode, etc, all work [16:05] halfhalo: linode ftw [16:05] FuzzYspo0N: creationix: its already usable btw, not too ambitious. 1) embed v8, 2) embed a webkit type system , 3) connect them [16:05] FuzzYspo0N: just, use code that makes the platform layer agnostic [16:05] FuzzYspo0N: i dont make complex layers, i just open a file using boost::filesystem , and no matter what platform, its the same [16:05] FuzzYspo0N: yea i use webbynode, it rocks [16:05] FuzzYspo0N: windows ftw! [16:05] FuzzYspo0N: oh wait, its one of those. [16:05] halfhalo: no, all the windows hosts are down due to windows updates :p [16:05] creationix: ajsie: I don't know of any hosting provider in production that does all that for node yet [16:06] ajsie: creationix: ok [16:06] ajsie: webbynode looks like something [16:06] creationix: heroku started to offer service, but kinda dropped the ball, Joyent will have something soon, nodejitsu supposedly has something [16:06] creationix: I haven't looked at webbynode, what's that? [16:06] prettyrobots: asjie: Node.js is pretty simple and performant. It doesn't require the kind of hosting support that Ruby on Rails does. [16:06] ajsie: creationix: like vps with services =) [16:07] halfhalo: ACTION does rails and node on the same server easily [16:07] prettyrobots: I use Webbynode, but I just publish to my own Ubuntu 10.04. [16:07] spetrea: FuzzYspo0N: well if you can make it run on all those platforms with very little code changes lucky you :) [16:07] prettyrobots: But, I do not use their Node.js stack. I use my own. [16:07] spetrea: FuzzYspo0N: I tried making a widget framework in C++ for Linux/Windows on top of SDL and I had all sorts of problems .. [16:08] ajsie: what is nodejitsu [16:08] ajsie: looks..empty =) [16:08] evilhackerdude: technoweenie: hey, any idea when riak-js/coffee will become master? [16:08] evilhackerdude: i couldnt find frank on irc so far [16:08] prettyrobots: (Maybe I should do a Node.js hosting business.) [16:08] technoweenie: evilhackerdude: i dont know, most of it is up to him, the protobuf stuff isr eady [16:08] technoweenie: evilhackerdude: he says in the next couple weeks though. he's been busy on startup stuff [16:08] evilhackerdude: cool, i think he's still updating documentation [16:08] ajsie: prettyrobots: yeah [16:08] ajsie: or no [16:08] evilhackerdude: most of the stuff that is on the site or came bundled is outdated iirc [16:09] ajsie: heroku is doing it at the moment =) [16:09] technoweenie: plus he lives in amsterdam so his hours are the opposite [16:09] evilhackerdude: hehe, fits me ;-) [16:09] ajsie: creationix: what do you mean that heroku kinda dropped the ball [16:09] technoweenie: node/websockets dont really jive w/ herokus setup right now [16:09] ajsie: creationix: u mean for node.js or in general? [16:09] creationix: ajsie: just for node [16:09] technoweenie: node works great on heroku if you dont have any websockets or long polling [16:09] ajsie: ok [16:09] ben_alman has joined the channel [16:09] ajsie: technoweenie: hmm .. i will use websockets [16:10] creationix: they were the first with node support, and then never changed much for many months [16:10] ajsie: creationix: r u sure? [16:10] jpld has joined the channel [16:10] rwaldron has joined the channel [16:10] ajsie: maybe the changes werent visible [16:10] halfhalo: If webbynode has a datacenter near CA I would use them [16:10] boaz has joined the channel [16:10] evilhackerdude: sad :/ i imagine they have a lot of ruby/rails work to do atm [16:10] halfhalo: for now though, its linode [16:10] figital has joined the channel [16:11] ajsie: looked at joyent ... they don't seem to offer addons like heroku? [16:11] creationix: ajsie: well, I use it for one of my sites, the node version was way behind for months, the node version finally got updated, but the stack around it is still nginx and varnish and has so many layers that you can't take advantage of node's strengths [16:11] technoweenie: joyent gives you a server, basically [16:11] creationix: well, most the heroku addons don't work with node last I checked [16:11] technoweenie: and a git deployment thing [16:11] creationix: also with heroku you can't ssh in and compile stuff [16:11] creationix: so no native modules [16:11] evilhackerdude: btw, does everybody still recommend to put node behind nginx if i don't need websockets? [16:12] halfhalo: ACTION is using linode + cherokee webserver+ thin webserver + rails 3 + node.js +php5-fcgi [16:12] creationix: evilhackerdude: only if you need ssl or virtual hosting [16:12] technoweenie: evilhackerdude: nginx is still best for serving files [16:12] ooooPsss has joined the channel [16:12] gerred has joined the channel [16:12] halfhalo: I am weird when I say screw nginx [16:12] technoweenie: node leaks like crazy if you stream big files [16:12] creationix: ACTION high fives halfhalo  [16:12] creationix: technoweenie: that's probably true [16:12] ajsie: evilhackerdude: but dont websockets work with nginx? [16:12] technoweenie: well i havent tried 0.2.x yet [16:12] creationix: I don't stream big files so I wouldn't know [16:12] SubStack: creationix: more here later about browserify: http://github.com/substack/node-browserify [16:12] ajsie: i guess it will [16:12] halfhalo: cherokee-project is just as fast if not faster, and is MUCH easier to set up [16:13] creationix: ajsie: not the latest websocket draft [16:13] evilhackerdude: thanks, i will proxy the app with nginx then [16:13] technoweenie: creationix: yea the archive downloader thing i wrote was unusable on the current version of node [16:13] technoweenie: even now the process explodes to around 140MB and dies [16:13] technoweenie: though it takes about a week [16:13] evilhackerdude: sad :-( [16:13] creationix: oh for github? [16:13] technoweenie: yea [16:13] ajsie: was so simple with rails ... code it ... then just upload it =) [16:14] mjr_: creationix: http://github.com/mranney/node_redis [16:14] halfhalo: you could use cap with node you know.... [16:15] creationix: mjr_: thanks [16:15] creationix: ajsie: right, node isn't anywhere near as mature as ruby [16:16] bradleymeck: anyone got node to daemonize yet? [16:16] ajsie: creationix: but i guess that will change [16:16] creationix: but it's growing and maturing at an amazing rate [16:16] ajsie: yeah .. i feel it [16:16] ajsie: the force [16:16] creationix: ajsie: I'd say what you want will be common place within a year [16:16] ajsie: yupp me 2 [16:17] karboh has joined the channel [16:17] ajsie: i guess i can use all the heroku addons externally in my own vps [16:20] creationix has joined the channel [16:21] bpot has joined the channel [16:23] ajsie: someone that has looked into this: http://www.joyent.com/technology/smartplatform/ [16:23] ajsie: says something about node.js [16:24] skampler has joined the channel [16:24] Validatorian has joined the channel [16:25] ajsie: someone that has a heroku account for node.js? [16:26] pydroid has joined the channel [16:27] skohorn has joined the channel [16:28] prettyrobots has joined the channel [16:28] kjeldahl_ has joined the channel [16:30] q_no has joined the channel [16:31] mbrochh has joined the channel [16:31] mbrochh has joined the channel [16:33] rnewson has joined the channel [16:34] zmbmartin: Is there a channel for expressjs? [16:34] tjholowaychuk: zmbmartin: nope [16:34] zmbmartin: or should I just ask questions in here? [16:34] xslasherx has joined the channel [16:34] tjholowaychuk: you can ask me :) [16:35] tjholowaychuk: there is always the mailing list as well [16:35] TomsB has joined the channel [16:35] zmbmartin: tjholowaychuk: I am messing with the form-connect but I get an error with this in jade -> form(method="post" enctype="multipart/form-data") [16:35] zmbmartin: How do I do multipart with jade [16:35] tjholowaychuk: zmbmartin: you just need a comma after "post", [16:35] tjholowaychuk: form(method="post", enctype="multi... [16:36] zmbmartin: Wow I feel stupid [16:36] zmbmartin: ;) Thanks [16:36] tjholowaychuk: np [16:36] vmthehut has joined the channel [16:39] sechrist: morning noders [16:39] tjholowaychuk: morning [16:40] ben_alman has joined the channel [16:40] claudiu__ has joined the channel [16:41] zmbmartin: Does mongoose provide access to gridfs? [16:41] sechrist: If anybody in here uses Meebo, I just released my adium project that connects to it: http://github.com/sechrist/PurpleMeebo [16:43] claudiu_ has joined the channel [16:43] sechrist: zmbmartin: it doesn't appear to [16:43] sechrist: it does a sort of model/view kind of thing [16:43] zmbmartin: Yeah that is what I though [16:45] mikeal: mongoose scares me a little [16:45] mikeal: i think it scares the 10gen guys too [16:45] tjholowaychuk: doh a read stream of start: 0 does not work [16:45] ben_alman has joined the channel [16:45] tjholowaychuk: fs.createReadStream(path, { start: 0, end: 100 }) is valid right? [16:45] mikeal: nobody has ever used a mongo client that wasn't just a binding to the C lib [16:46] sechrist: until LB made mongoose [16:46] sechrist: :) [16:46] mikeal: and the protocol and BSON are both not verry well defined [16:46] jashkenas has joined the channel [16:46] mikeal: well, when you control the client and server and protocol [16:46] mikeal: you can get kinda lazy about validation [16:47] mies has joined the channel [16:47] mikeal: remember how different vesions of oracle and mysql would corrupt each other if you had different client and server versions [16:47] mikeal: like back in the day [16:47] sechrist: yep [16:47] mikeal: mongo doesn't have the best consistency track record [16:47] langworthy has joined the channel [16:47] mikeal: i wouldn't be surprised if they were pretty lazy [16:48] papyromancer has joined the channel [16:48] sechrist: mikeal: you're captain of the mongodb slander team [16:48] sechrist: hehe [16:48] mikeal: the biggest reason we use JSON in CouchDB and refuse to consider anything else like even native erlang terms is because using JSON gives all the validation we'll ever need to protect from poison pills [16:48] sechrist: but yeah [16:48] mikeal: i mean, i told them about mongoose and mike made a face [16:48] sechrist: my document based DB has been couch so far, but I need to read more about it [16:49] sechrist: and pick up some erlang [16:49] mikeal: you don't need to know erlang to use couch [16:49] mikeal: like ever [16:49] mikeal: you only need to know erlang if you wanna hack on couchdb internals [16:49] sechrist: oh I know, but I want to understand what's going on [16:49] sechrist: not in couch, but erlang. [16:49] sechrist: I look at it and I go wtf [16:49] mikeal: haha, the syntax is from another planet [16:49] tjholowaychuk: couch is a lot more awesome with these hosted solutions [16:49] tjholowaychuk: not having to compile beam [16:50] tjholowaychuk: erlang is awwwwwesome wish I had more time to learn it [16:50] sechrist: mikeal: what's your favorite couch client for node? [16:50] mikeal: yeah, we made it insanely simple and fast to get a free couchdb on couchone.omc [16:50] sechrist: other than just http.client [16:50] mikeal: sechrist: well, i know the HTTP API really well, so I'm most comfortable just using my request http library [16:50] shockie has joined the channel [16:50] technoweenie: felixge has one that looks good [16:50] technoweenie: http://github.com/felixge/node-couchdb [16:50] mikeal: i have mixed feelings on it [16:51] sechrist: mikeal: btw there's an unresolved memory leak in http.client's autogeneration of SSL credentials [16:51] mikeal: it's the oldest lib, and felix is good about taking patches [16:51] sechrist: so you might want to edit request to reuse a crypto credentials instance [16:51] mikeal: but that was written for Promises [16:51] sechrist: I patched request for myself to do that [16:51] mikeal: before we had buffers [16:51] mikeal: like, node changed a lot and that library just patched to adapt [16:51] mikeal: it never went through a re-write [16:52] mikeal: i feel the same way about that lib as i do the redis client [16:52] sechrist: I think there's several people working on new redis clients [16:52] mikeal: it's a great and appreciated effort but without a rewrite it's never gonna feel great [16:52] mikeal: mjr's looks great [16:52] mikeal: he got pub/sub support in so he wins :) [16:52] tjholowaychuk: yeah his is really slick [16:52] tjholowaychuk: very clean [16:52] technoweenie: fictorials had pub/sub when it was added to redis [16:52] mikeal: sechrist: SSL is just broken in node until pquerna finishes his new stuff [16:53] sechrist: yeah but I have production code using http.client with ssl [16:53] sechrist: I had to do something [16:53] sechrist: :) [16:53] sechrist: so I got out a profiler and went :O [16:53] mikeal: also, stream support would be nice, i don't know if mjr's has it yet [16:53] SubStack: dnode has pub/sub too by way of event emitters [16:53] papyromancer: I've spent a couple weeks away from the node development, it was a horrible experience ;) in that same time I switched from Arch to Ubuntu, and now that I am back at the node development, I'm getting Error: ECONNREFUSED, Connection refused at IOWatcher.callback (net:854:22) at node.js:757:9 ( I'm running node 0.2.2 ) [16:54] tjholowaychuk: mikeal: i think he is working on that [16:54] sechrist: papyromancer: you have a db or service not running? [16:54] sechrist: doesn't sound like a node problem [16:54] mikeal: papyromancer: you're connection to something that isn't up [16:54] mikeal: wrong port or host maybe [16:54] papyromancer: thanks sechrist I'll keep commenting out code blocks till it works [16:54] sechrist: nice [16:56] papyromancer: I'd like to catch up on the couch / mongo / (mongoose) debate that started before I joined the channel today, anyone care to pastebin that for me, pretty please? [16:56] mattly has joined the channel [16:57] tjholowaychuk: papyromancer: nodejs.debuggable.com [16:57] sechrist: how old is couchdb 0.11? [16:57] CrabDude has joined the channel [16:57] sechrist: I probably should build a new one [16:57] aubergine_ has joined the channel [16:57] ajpiano has joined the channel [16:58] papyromancer: tjholowaychuk: thanks, I misread the date and looked at the first log on that page *facepalm* [16:58] sechrist: "The 1.0.0 release has a data-loss bug in its default configuration." ffffff [16:58] claudiu__ has joined the channel [16:58] ph^ has joined the channel [16:58] tjholowaychuk: papyromancer: :D [16:59] stagas has joined the channel [17:00] skampler has joined the channel [17:01] noahcampbell has joined the channel [17:01] dilvie has joined the channel [17:02] sahazel has joined the channel [17:02] vnguyen has joined the channel [17:03] ngw has joined the channel [17:03] norviller has joined the channel [17:04] alexb_ has joined the channel [17:04] ysynopsis1 has joined the channel [17:04] wink_: bradleymeck: are you around? this isnt a horrible question i promise :) [17:06] papyromancer: i like redis for session storage, mongo for documents, and couch for backups that you want to do map/reduce on [17:06] papyromancer: so I haven't gotten to play with couch much yet [17:07] papyromancer: and the webservices that provide easy access to those dbs are killer :) (there's my two cents) [17:07] niemeyer_ has joined the channel [17:07] creationix has joined the channel [17:07] wink_: anyone around that can help with a node-waf question? [17:08] isaacs has joined the channel [17:08] wink_: im having issues building my binding, it's not finding some of my shared libs for some reason [17:08] stephenjudkins has joined the channel [17:08] wink_: isaacs, what excellent timing, do you have a sec to help me sort out a silly build issue [17:09] isaacs: wink_: sure, what's up? [17:09] EyePulp: papyromancer: what makes you use redis for sessions and mongo for docs? why not one or the other for both? (just curious) [17:09] mjr_ has joined the channel [17:09] mikew3c_ has joined the channel [17:09] benburkert has joined the channel [17:09] wink_: so my binding is linking against libmongoc, but for some reason when i build, it isnt able to resolve the library paths, i dunno what i've hosed up [17:09] ivong has joined the channel [17:09] CrabDude: not node, but does anyone know of any solid solutions for sanboxing JSONP requests? [17:09] Egbert9e9 has joined the channel [17:10] wink_: let me get a pastebin real quick [17:10] sechrist: sandboxing jsonp eh? [17:10] scnd has joined the channel [17:10] sechrist: you mean like a remote source? or your own? [17:10] CrabDude: remote source [17:10] CrabDude: thus the sandboxing ;) [17:10] alexb_: Is there a http request library that will limit the number of simultaneous http requests to the same host? [17:10] sechrist: sounds like a massive pain unless you do something like fbjs [17:10] sechrist: or run on a separate domain in an iframe or something [17:10] sechrist: so that cookies aren't accessible [17:10] stephenjudkins has joined the channel [17:10] isaacs: wink_: k [17:11] prettyrobots: isaacs: http://bigeasy.github.com/node-tar/ [17:11] isaacs: wink_: in my experience, that's often an issue with the LIBRAY_PATH env [17:11] CrabDude: sechrist sure, but is there any other solution to secure jsonp? [17:11] prettyrobots: Half done for USTAR format tar files. [17:11] sechrist: CrabDude: not without having your own server do it [17:11] CrabDude: it's either that or proxy all the data server side, a major bottleneck [17:11] prettyrobots: Have a reader. [17:11] wink_: isaacs: http://pastebin.com/LpLQFEYk [17:11] sechrist: CrabDude: well that's how jsonp works.. it's a hack anyway [17:11] isaacs: prettyrobots: thanks :) [17:11] CrabDude: haha [17:11] mikeal: sechrist: 1.0.1 has been out for a while [17:12] wink_: the lib builds just find, but when i require it, it chokes on not being able to locate the .so's [17:12] mikeal: and it included a recovery tool that got all the lost data [17:12] isaacs: prettyrobots: tar looks like a fun format to parse. i might still write one if i get bored this weekend. [17:12] niemeyer__ has joined the channel [17:12] isaacs: prettyrobots: but now that you have one, just using that will be very tempting :) [17:12] mikeal: we were still writing it to the file it just got in to a state where it wouldn't write the header [17:12] sechrist: without handling the jsonp request yourself you can't sanitize it since the browser has to embed it with a script tag verbatim [17:12] wink_: that is my directory structure, my wscript, and ldd's output on the built binding [17:12] sechrist: just uh, check your sources [17:12] tjholowaychuk: ryah: small bug fix http://github.com/visionmedia/node/commit/f867493b8ef4efd14aa324d8d89347602c33bbe5 [17:13] prettyrobots: isaacs: If you're not interested in using it, it dies. [17:13] isaacs: hahahh [17:13] isaacs: WOW, way to make me feel responsible! [17:13] prettyrobots: I have no use for it. [17:13] isaacs: this poor littlelibrary is hanging under the axe! [17:13] papyromancer: EyePulp: redis is faster than mongo, imho, and it does more realtional type stuff, mongo is great to save to and cache from (and redis is too expensive for persistent storage) [17:13] prettyrobots: I wrote it for use with npm. [17:13] CrabDude: sechrist sure, that's why using an iframe is necessary for the sandboxing. this is the best solution I've seen, but was just wondering if anyone else had come up with something better: http://beebole.com/en/blog/general/sandbox-your-cross-domain-jsonp-to-improve-mashup-security/ [17:13] sechrist: that's all I'm aware of [17:13] isaacs: prettyrobots: cool, i'll probably give it a look over and maybe send you a pull req with some interface changes or whatever. thanks for doing the guts of it, though, that's the hard part. [17:14] sechrist: I didn't know people ACTUALLY did that, but that's the only idea I have with my knowledge of browser security [17:14] EyePulp: papyromancer: interesting. I'm looking to do session and storage with mongo, but was wondering if I had missed something crucial [17:14] prettyrobots: There are 20+ years of file format discrepancies to wade through, and I'm not going to do that an exercise. [17:15] papyromancer: EyePulp: here's where I'm going http://github.com/papyromancer/memetec [17:16] mjr_: EyePulp: I think redis is ideal for session storage. If you care about getting your data back, I'd use couchdb or a sql database. [17:16] isaacs: wink_: where's the code? [17:16] isaacs: wink_: github? [17:16] wink_: not yet :< [17:16] isaacs: wink_: !! [17:16] wink_: i'll get it there shortly [17:16] mikeal: if you're storing session data make sure you turn off the default "fire and forget" write [17:16] isaacs: wink_: you should do that first! [17:16] wink_: its just a bunch of stubs right now [17:16] mikeal: with mongo [17:16] wink_: i was just trying to get everything set up to build properly [17:16] wink_: and then start wiring it all up [17:16] mikeal: EyePulp: ^^ [17:17] neptun3 has joined the channel [17:17] wink_: it looks like the other mongo binding is statically linking against the mongo libs, i dunno anything about waf though [17:17] isaacs: wink_: yeah, from this, i dunno. i'mnot really an addon expert, i've only written a few. [17:17] EyePulp: mikeal: how come? (sorry if that's a dumb question) [17:17] wink_: is there a way via the wscript config to statically link against the libs instead of using the .so's? [17:17] isaacs: wink_: why not fork the other one and just change/add what you think it lacks? [17:17] CIA-77: node: 03isaacs 07master * rdff1b5a 10/ (3 files in 3 dirs): Don't try to run extension loaders unless they're actually functions - http://bit.ly/bvw16I [17:17] CIA-77: node: 03Mikeal Rogers 07master * rcc1d61c 10/ (2 files in 2 dirs): [17:17] mikeal: if you store session data under load you'll return a token to the client for that session before you can actually access it in mongodb [17:17] CIA-77: node: HTTP: close connection on connection:close header. [17:17] CIA-77: node: rnewson found a good bug in keep-alive. we were only using the request [17:17] CIA-77: node: headers we send to enable/disable keep-alive but when the server sends [17:17] CIA-77: node: Connection: close we need to close down the connection regardless. [17:17] CIA-77: node: I wrote up a patch the Robert verified makes all his test client code work [17:17] CIA-77: node: now and I also added a new unittest for it. - http://bit.ly/aNJBLC [17:18] wink_: isaacs: because i tried that, there is a bug i cant find/fix so im just rewriting it from scratch :p [17:18] wink_: although i stole most of his build env [17:18] mikeal: sweet, my patch is in [17:18] wink_: :> [17:18] isaacs: sweet, me too :) [17:18] mjr_: mikeal: I'm surprised nobody noticed that keepalive issue before. [17:18] mikeal: mjr_: well, it's a timing thing [17:18] mikeal: if they close the socket before you do another request on that object it'll be fine [17:19] mikeal: i think [17:19] mikeal: maybe not [17:19] mikeal: actually not, nevermind [17:19] mikeal: i guess servers just don't force connection: close a lot :) [17:19] beawesomeinstead has joined the channel [17:19] mjr_: I wonder why I never noticed that. I'm using node's http client to talk to node http server, and doing keepalive. [17:19] beawesomeinstead has joined the channel [17:19] [[zz]] has joined the channel [17:20] wink_: isaacs: except for the filenames my build is identical to the original that works, or at least it should be, obviously it isnt working though :p [17:20] mikeal: i'm starting to think that readyState needs to be smarter [17:20] rnewson: mikeal: I think not a timing thing. node definitely misbehaved in this case. [17:20] mikeal: rnewson: no, a timing thing in order to trigger the bug [17:20] mikeal: valid bug, most definitely [17:20] mjr_: Totally valid bug. I'm just wondering why we never noticed it. [17:20] mikeal: but i think there were cases where it wouldn't throw and it would just reconnect the socket for the next request [17:21] mikeal: mjr_: how many servers do you know that force connection: close? [17:21] mjr_: I dunno. I have one though. :_ [17:21] mjr_: That's why I'm curious why I never saw it. [17:21] sechrist: is building OTP supposed to take a long time? geeze [17:21] jchris has joined the channel [17:21] CIA-77: node: 03Ryan Dahl 07master * re227441 10/ (73 files in 10 dirs): Upgrade V8 to 2.4.5 - http://bit.ly/9vWMDM [17:21] mikeal: sometimes [17:21] mikeal: actually, yes, always, it's slow :) [17:21] isaacs: sechrist: erlang makes you wait to build it so that you'll appreciate its performance once it runs [17:21] rnewson: mikeal: again, I think not, you need a server that supports keep-alive for a while and then returns Connection:close. [17:21] sechrist: huh huh [17:22] isaacs: otp is gigantic [17:22] tjholowaychuk: sechrist: yes lol it will take quiteee a while [17:22] mikeal: rnewson: you *should* be able to trigger it just by trying to do keepalive with a server that says close [17:22] isaacs: sometimes on those cold winter nights, i brew a nice cup of hot cocoa, kick off an OTP "make clean install", and curl up with my warm laptop [17:22] mikeal: maybe readyState is smarter than I think [17:23] sechrist: isaacs: :) [17:23] mikeal: isaacs: i just run a Python script [17:23] mikeal: any Python script [17:23] isaacs: mikeal: ha! [17:23] mikeal: it'll eventually use an entire core for no good reason [17:23] rnewson: mikeal: yes, I guess so. [17:23] ryah: tjholowaychuk: thank you [17:23] CIA-77: node: 03Tj Holowaychuk 07master * r893ebe7 10/ (lib/fs.js test/simple/test-fs-read-stream.js): Fixed fs.ReadStream() start: 0 bug - http://bit.ly/cVuGYq [17:23] rnewson: mikeal: anyway, it's a good fix and it really saved me today. [17:23] tjholowaychuk: ryah: np [17:23] path[l] has joined the channel [17:24] mikeal: ryah: is master 0.2.x or 0.3.x? [17:24] ryah: mikeal: 0.3 [17:24] mjr_: Oh, it looks like my server ends up re-using the connection even after I told the client to close it, and that doesn't cause any error. [17:24] mjr_: Whoops. [17:24] mikeal: ok, how do i get my fix in to the branch for the next 0.2.x? [17:24] sechrist: man compiling software is the only thing I'd consider upgrading my mbp for [17:24] tjholowaychuk: shit yeah I need mine too [17:24] ryah: mikeal: i'll merge it when i do the next release there [17:24] sechrist: since I went to 8gb of ram nothing is taxing the c2d but compilers [17:25] mikeal: oh i see, you just merge stuff you want in, you don't keep a branch around all the time for it [17:25] ryah: mikeal: v0.2 is the branch [17:25] mikeal: ok [17:26] mikeal: ryah: question about .readyState [17:26] mikeal: so, it's basically "close" once .fd is null [17:26] mikeal: is the *only* thing that triggers setting the fd to null the .close() method [17:27] ryah: mikeal: not sure if that's exactly true [17:27] ryah: but yes [17:27] mikeal: like, are there socket errors that could be handled, the underlying socket closed, but the readyState would still not be "close" because nobody called the .close() method [17:28] ryah: mikeal: i don't think so [17:28] sechrist: mikeal: how does couchdb auth work? [17:28] ryah: readyState=='closed' means the socket is closed [17:28] mikeal: sechrist: you can create users in futon [17:28] mikeal: then just use basic auth [17:29] sechrist: that makes sense [17:29] mikeal: there is a _users database that you can replicate around if you want other couches to have the same users [17:29] isaacs: sechrist: check out the "adduser" stuff in npm's code [17:29] isaacs: (we should probably take this to #couchdb) [17:29] mikeal: ryah: ok, i was looking at the code and it's just a getter that checks if this.fd is null [17:30] isaacs: prettyrobots: ok, looking over the API, there's definitely some stuff i'm going to want to change. [17:30] mikeal: ryah: also, what do you think about adding an error handler to the parser that closes the socket when an error is emitted? [17:31] ryah: i think that's done already [17:32] ryah: mikeal: http://github.com/ry/node/blob/893ebe72305ea599c32c99e3ca4fda050ae7c983/lib/http.js#L767 [17:32] mjr_: I kinda wish it'd emit an error event instead of just silently closing the connection. [17:32] mikeal: i don't see it in http.js [17:32] ryah: ? [17:33] mikeal: ah ha [17:33] mikeal: i was looking for an error event [17:33] mjr_: it for sure closes the connection on parser error [17:33] mikeal: will destroying the socket like that cause an error event [17:33] mikeal: ? [17:34] ryah: mikeal: no [17:34] ChrisPartridge has joined the channel [17:34] ryah: but you can give an Error object argument to "destroy" [17:34] ryah: and it will [17:34] ryah: http://github.com/ry/node/blob/893ebe72305ea599c32c99e3ca4fda050ae7c983/src/node_http_parser.cc#L287-290 [17:34] ryah: ^-- parse error is returned from parser.execute() [17:34] mikeal: we should do that [17:34] mikeal: er, use that, in this line, i like mjr's idea [17:35] ryah: mikeal: ok [17:35] ryah: oh hm [17:35] ryah: it is given an argument to destroy()... [17:35] sh1mmer has joined the channel [17:35] papyromancer: woot, changed my dev environment to not try connecting to redistogo, working code works again [17:35] mjr_: I didn't know that about the destroy arg though. That's useful. [17:35] mikeal: https://gist.github.com/7585e72292bfcc377a3a [17:35] ryah: http://github.com/ry/node/blob/893ebe72305ea599c32c99e3ca4fda050ae7c983/lib/net.js#L992 [17:35] mikeal: so, where the fuck is that coming from [17:36] neptun3 has joined the channel [17:36] bradleymeck: wink_ pong [17:37] mjr_: mikeal: oh man, I hate that error [17:37] ryah: mikeal: not caught by 'error' event? [17:37] mikeal: is `var ret = parser.execute(d, start, end - start);` just causing an exception [17:37] mikeal: it's not an error event, if it was it would have the emitter in it's stack [17:38] mjr_: Are you sure? I thought uncaught error events sometimes had that impossibly small stack. [17:38] mikeal: the throw is from inside the eventEmitter [17:38] ryah: mikeal: it's thrown from a nextTick i think [17:39] ryah: (man, we need long stacks...) [17:39] mikeal: no doubt [17:39] bradleymeck: we got a daemonize current pid in node? [17:39] mikeal: i've been putting off actually tracking this down until we have them but i was in that code today so i figured i'd look again [17:39] mjr_: Why emit on nextTick? [17:39] ryah: hm [17:39] mikeal: i mean, that looks like something is thrown from `var ret = parser.execute(d, start, end - start);` [17:39] ryah: mjr_: yeah, nevermind [17:40] ryah: mikeal: im pretty sure that doesn't throw anything [17:40] ollie has joined the channel [17:40] mikeal: i wonder if we should put that in a try/catch that will emit error [17:40] ryah: or.. [17:40] ryah: im not sure [17:40] mikeal: i mean, there are only 4 function calls in Client.ondata [17:41] mikeal: and that's the only one I would think could case a Parse Error [17:41] uvacav has joined the channel [17:41] mikeal: s/case/cause [17:42] mikeal: of course i have no empirical evidence until we get big traces :) [17:42] mjr_: So isn't "Parse Error" from node_http_parser.cc:287 in response to an http parser's internal callback encountering some problem? [17:42] mjr_: like, a problem parsing HTTP? [17:42] MikhX has joined the channel [17:43] mjr_: Or is that in response to the parser calling back out to an ondata or whatever, and the ondata callback threw, so this is percolating back up through line 287. [17:43] mikeal: hrm.......... [17:43] mikeal: so, this is definitely an emitted error [17:43] mjr_: do you follow me on that, mikeal? [17:44] mikeal: throw arguments[1] [17:44] femtoo has joined the channel [17:44] sh1mmer: ryah: I have a question about the event loop if you have a minute [17:44] mjr_: The string "Parse Error" is in the C++ bindings to the http parser. [17:44] mjr_: And nowhere else. [17:45] deepthawtz has joined the channel [17:45] sh1mmer: or anyone else for that matter. [17:45] sh1mmer: does node run top to bottom and then fire event [17:45] mjr_: So that error originates, as far as this stack is concerned, on 287. [17:45] mikeal: so [17:45] sh1mmer: run top to bottom and then get the next available event? [17:45] mikeal: who calls ondata and what is the d argument? [17:46] mjr_: mikeal: iowatcher gets woken up by epoll, then it calls ondata. Ondata calls binding.execute(chunk) [17:46] mikeal: are you use? [17:47] mikeal: i'm seeing net.js call it [17:47] mikeal: with the pool as the first argumetn [17:47] pgriess has joined the channel [17:47] dipser: am i right, that if i want to use redis, i have to save my object like that: "USERS:ID" and "USERS:NAME" as keys? when i want to make it related? or is there a better way? [17:47] mjr_: hmm. OK, maybe I'm confused. [17:47] agnat has joined the channel [17:48] pgriess has joined the channel [17:48] mjr_: mikeal: there is a socket ondata property that the iowatcher invokes. That, in turn runs the http parser, which might emit data events. [17:48] mjr_: So there are multiple "on data" definitions. [17:48] mikeal: how is the error getting emitted, and to who [17:48] mjr_: dipser: you could use redis hashes. [17:49] mikeal: is the real question [17:49] dipser: mjr_: but its the normal way how i described it or? [17:49] mjr_: mikeal: yeah, that is the real issue. But in this case, it looks to me that http parser is parsing some incoming data from the network, then went to invoke a callback, and caught an error while doing so. [17:49] tjholowaychuk: dipser: hset User1: name tj [17:50] zmbmartin: tjholowaychuk: I am getting errors when trying to use connect-form and mongoose. Is there an example for uploading an image and handling form data? [17:50] tjholowaychuk: dipser: hset User:1 name tj [17:50] tjholowaychuk: typo [17:50] tjholowaychuk: dipser: hset User:1 email tj@vision-media.ca [17:50] tjholowaychuk: etc [17:50] tjholowaychuk: zmbmartin: express has a multipart form example using connect-form [17:50] tjholowaychuk: ./examples/multipart [17:50] ivong has joined the channel [17:50] mjr_: dipser: the memecache "normal" way is to do what you had at first. Redis gives you more flexibility, but you can just do complex keys if you like. [17:51] zmbmartin: tjholowaychuk: but that is only for an image isn't it. Not a form with an image upload and other input fields? [17:51] mjr_: sh1mmer: I'd have to look at the source to answer your question. I think ryah may be the only one who knows that from memory. [17:51] mikeal: i wish i had a solid repro case [17:51] tjholowaychuk: zmbmartin: anything, an image upload is just a regular file [17:51] tjholowaychuk: like anything else [17:51] mikeal: all i have are exceptions from production instances [17:51] tjholowaychuk: but i dont use mongoose in the example [17:52] path[l] has joined the channel [17:52] mjr_: mikeal: I get that from time to time. Next time i get a tricky exception situation, I'll distill it down to a test case. I have this kind and I also have the silently ignored kind. [17:52] mikeal: we need to find some junk that will cause exception in the http parser [17:53] prettyrobots has joined the channel [17:53] mikeal: so that we can just use a tcp server to reproduce [17:53] mjr_: mikeal: my experience is that invalid HTTP gets handled pretty reliably by the http parser. [17:53] dipser: ok thank you tjholowaychuk and mjr_ [17:53] mikeal: yeah, i know, that's why this is so hard :) [17:53] mjr_: mikeal: but what gets confusing is when http parser emits events that you handle in your user code, and then what if they emit events, and what if those second generation event handlers throw? [17:54] mjr_: Shit gets weird. [17:55] mjr_: I'm starting to think that a better pattern might be to plumb through some sort of error callback to this sort of thing. Given that the stack unwinds all the time, it's hard to imagine where all of these exceptions would go anyway. [17:55] mikeal: ok, i gotta eat and drink and sleep now [17:55] mikeal: so [17:56] mikeal: emitter doing error, and handler throwing an error, provided it's not in a callback and is just in that function, will have a good trace [17:56] mikeal: wait [17:56] mikeal: eventSource will even capture it if it's in a callback tho [17:57] mjr_: maybe we should just wait for eventSource and reassess then. [17:57] mytrile has joined the channel [17:57] nwhite has joined the channel [17:58] Eber has joined the channel [18:00] mikeal: i think so too [18:03] nefD: anyone seen felix lately? [18:04] Guest30206 has joined the channel [18:05] mjr_: I haven't seen him much lately. He posts to the ml every now and then. [18:05] mjr_: It's like he has a job or something. [18:05] prettyrobots_ has joined the channel [18:05] skampler: :P [18:05] sh1mmer: mjr_: I think it's an important question [18:05] aconbere has joined the channel [18:05] sh1mmer: mjr_: I'm currently trying to create a deadlock [18:06] sh1mmer: there are also some performance tuning questions about 'runaway' code tying up the event loop [18:06] mjr_: sh1mmer: yeah, part of node's contract is that there is no locking so there is no possibility for a deadlock. [18:06] ChrisPartridge has joined the channel [18:06] sh1mmer: mjr_: I was thinking of a loop or something like that which didn't allow for the detection in the change of state via events [18:07] mjr_: v8bot: while(1) {} [18:07] v8bot: mjr_: Use v8: to evaluate code or "`v commands" for a list of v8bot commands. [18:07] sh1mmer: mjr_: right, but even something less silly than that [18:07] mjr_: v8 while(1) {} [18:07] v8bot: mjr_: Error: Timeout [18:07] mjr_: I wonder how v8bot does timeout there. [18:08] mjr_: basically the same problem. [18:08] sh1mmer: mjr_: I'm thinking like while(condition) { //emit } [18:08] aconran__ has joined the channel [18:08] sh1mmer: it seems like the event tied to that emit gets called before the loop goes for a second iteration [18:09] sh1mmer: but knowing how the event loop is important to code optimization, which is why I'm trying to understand it [18:09] mjr_: eventemitter runs through all of the listeners for an event as part of the emit. [18:09] sh1mmer: right [18:09] prettyrobots: Is there a native PostgreSQL driver for Node? [18:09] bradleymeck: holy edge cases batman, i think i found an error in v8 lol [18:09] sh1mmer: but if we only have a single thread when does emit get called? [18:10] prettyrobots: bradleymeck: Do tell. [18:10] mjr_: sh1mmer: all of the event listeners run to completion before the outermost loop runs again [18:10] v8bot has joined the channel [18:10] sh1mmer: next experiment is: while(condition) { setTimeout(function(){ee.emit('foo'), 500) } [18:10] mbrochh]2 has joined the channel [18:11] sh1mmer: mjr_: ok, but what about inner loops? [18:11] sh1mmer: oh [18:11] sh1mmer: nm [18:11] sh1mmer: so that's interesting [18:11] mjr_: you could jsut replace all ee.emit('foo') with fn() [18:11] nerdEd has joined the channel [18:11] mjr_: ee.emit() is a synchronous operation, if you like. [18:12] sh1mmer: mjr_: but it's significant that it gets inserted inbetween loop cycles [18:12] inimino: mjr_ ⋱ it runs in a separate process [18:12] sh1mmer: that's _really_ important [18:12] mjr_: inimino: a separate process? [18:12] inimino: mjr_ ⋱ It runs v8 with the code in a separate process and waits N seconds for the answer, then kills it. [18:12] sh1mmer: prettyrobots: btw there is a postgres driver not sure if it's latest look on the Github wiki module page [18:13] saikat has joined the channel [18:13] mjr_: inimino: oh right, v8bot [18:13] sh1mmer: mjr_: haha I missed that context too [18:13] sh1mmer: ok I gtg board a plane [18:13] inimino: ACTION replies asynchronously [18:13] sh1mmer: later y'all [18:13] nerdEd has joined the channel [18:15] bradleymeck: seams function.bind does not like to have .apply called on it [18:15] saikat_ has joined the channel [18:15] ben_alman has joined the channel [18:17] fizx has joined the channel [18:17] stephenjudkins has joined the channel [18:17] ekidd has joined the channel [18:17] mattly: is there a separate channel for connect? [18:17] Anti-X has joined the channel [18:17] [[zz]] has joined the channel [18:17] claudiu__ has joined the channel [18:18] ysynopsis has joined the channel [18:18] isaacs: bradleymeck: really? [18:18] prettyrobots: Found the native postgress driver. Thank you. [18:18] isaacs: bradleymeck: like, Function.prototype.bind.call(myFunction, someObject)? [18:18] bradleymeck: i got some random error unexpected ']' that i found fixed with a manual bind [18:18] isaacs: crazy [18:21] aubergine has joined the channel [18:22] bradleymeck: is there someway to show the current error in the repl? [18:22] jashkenas has joined the channel [18:23] evanpro has joined the channel [18:24] javajunky: mattly: I don't think so, and the most often used mailing list seems to be the express one. [18:24] mattly: hm [18:24] mattly: thanks [18:24] nefD: hm [18:27] mattly: basically i'm wondering what the general approach is for testing connect apps [18:27] Damian1 has joined the channel [18:28] x_or1 has joined the channel [18:28] tjholowaychuk: mattly: anything really [18:28] tjholowaychuk: assert module [18:28] tjholowaychuk: vows [18:28] tjholowaychuk: expresso [18:28] tjholowaychuk: expresso makes http assertions simple though [18:29] mattly: eh i should just dig into the code in there [18:29] tjholowaychuk: the connect tests are before I wrote assert.response [18:29] tjholowaychuk: so it has its own little helper [18:29] tjholowaychuk: that is less flexible [18:29] tjholowaychuk: and more ugly [18:30] TooTallNate has joined the channel [18:30] TooTallNate: Hey all, could somebody give me a RegExp that can .test for a string like: "fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'" [18:31] TooTallNate: Thanks in advance! [18:31] ThePub: ^.*$ [18:31] ThePub: not very practical of course... [18:32] TooTallNate: I mean, test for: 'fatal: Path: ' +something ambiguous + ' does not exist in ' + 40-chars [18:32] ysynopsis has joined the channel [18:33] path[l]: replace something ambiguous by .* [18:33] antares_ has joined the channel [18:33] ThePub: pretty much [18:33] path[l]: I dunno if : needs to be escaped [18:33] ThePub: appears to be delimited by ' too? ([^']+) [18:33] path[l]: but that's about it [18:33] mbrochh has joined the channel [18:33] mbrochh has joined the channel [18:33] path[l]: oh right [18:34] isaacs: TooTallNate: /^fatal: Path '([^']+)' does not exist in '[0-9a-f]{40}'$/ [18:34] TooTallNate: Sweet isaacs, thanks! [18:34] isaacs: js> "fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'".test(/^fatal: Path '([^']+)' does not exist in '[0-9a-f]{40}'$/) [18:34] gbot2: isaacs: Error: TypeError: "fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'".test is not a function [18:34] isaacs: js> "fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'".match(/^fatal: Path '([^']+)' does not exist in '[0-9a-f]{40}'$/) [18:34] gbot2: isaacs: ["fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'","articles/robots.txt"] [18:35] visnup has joined the channel [18:35] isaacs: TooTallNate: do you want the hash captured too? [18:35] s0enke: for the lazy: fatal: Path '(.*?)' does not exist in '(.*?)' [18:35] s0enke: ;) [18:35] isaacs: js> "fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'".match(/^fatal: Path '([^']+)' does not exist in '([0-9a-f]{40})'$/) [18:35] gbot2: isaacs: ["fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'","articles/robots.txt","dbc2ec41609583ce92243936415a772966570ed1"] [18:35] TooTallNate: it's not necessary [18:36] isaacs: then you can pull out [1] for the failed path, and [2] for where it was not found [18:36] isaacs: if you dont' care about the captures, then s/[()]//g [18:36] TooTallNate: I just need to determine the kind of error it was, but ya sure, that would be better [18:36] isaacs: js> "fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'".match(/^fatal: Path '[^']+' does not exist in '[0-9a-f]{40}'$/) [18:36] gbot2: isaacs: ["fatal: Path 'articles/robots.txt' does not exist in 'dbc2ec41609583ce92243936415a772966570ed1'"] [18:37] stephenjudkins has joined the channel [18:37] sprout1 has joined the channel [18:37] gerad has joined the channel [18:38] hannesw_ has joined the channel [18:38] papyromancer has joined the channel [18:38] sprout has joined the channel [18:38] Nietecht: Can you do a require() with a path relative to whatever place node was executed in? [18:39] bradleymeck: cwd or initial exec? [18:40] Nietecht: Sorry, don't know what cwd is, but I'm guessing initial exec [18:40] ThePub: "current working directory" [18:40] Nietecht: Hm... [18:41] ThePub: idk, but seems to accept full paths and it's able to require using relative paths at least up. [18:41] wink_ has joined the channel [18:42] ThePub: er.. higher in the structure, idk about lower though. if it's using path then probably not since I think it mashes any ".." into nothingness. [18:42] bradleymeck: require(require("path").join(process.ENV.PWD /*or process.cwd*/,"foo.js")) [18:42] bradleymeck: should work for any normal situation [18:43] Nietecht: Right, I'll experiment with those, thanks [18:43] wink_: bradleymeck: can you help me with my wscript/waf ignorance real quick? [18:43] Nietecht: Just getting tired of all the require('../../..')'s :) [18:43] bradleymeck: mmm [18:44] wink_: :p [18:44] bradleymeck: why not require.paths.unshift [18:44] bradleymeck: wink_ whats up [18:44] sprout1 has joined the channel [18:44] Nietecht: Actually, that's a good idea... [18:44] bradleymeck: ACTION wonders if he could get hired just to be a node support guy [18:45] wink_: bradleymeck: so im working on rewriting the mongo binding, i've got my stubs in place but for some reason when i build using the same script its using the shared mongo libs and failing to find them instead of statically linking against the .a's like the actual lib appears to [18:45] isaacs: Nietecht, bradleymeck: process.env.PWD is not as reliable as process.cwd() [18:45] wink_: bradleymeck: http://pastebin.com/LpLQFEYk [18:45] wink_: also, i'd totally hire you ;> [18:45] bradleymeck: true isaacs, but they are slightly diff [18:45] isaacs: bradleymeck: right, once is the actual cwd ;) [18:45] isaacs: and guaranteed [18:46] wink_: im not sure why it's not statically linking, nor am i sure how to make it do so [18:46] isaacs: if you're started in a child process, or something, then you can set env.PWD to something other than the actual pwd, but process.cwd() will always give it toyou [18:47] isaacs: PWD is such an odd name for that env, anyway. i mean $(pwd) makes sense, since it's "print working directory". but shouldn't the env be env.CWD? [18:47] isaacs: "current working directory" [18:47] bradleymeck: i thought it was process working dir [18:48] bradleymeck: wink thats kinda funky way to do that [18:48] bradleymeck: sec [18:48] PyroPeter has joined the channel [18:48] cognominal has joined the channel [18:48] wink_: bradleymeck: i stole the build env from orlandov's binding, i know zero about waf :p [18:49] wink_: essentially all i've done is renamed the source files being built [18:49] vvsh has joined the channel [18:49] zmbmartin: What do I pass to the mongodb-node driver to write to gridfs from connect-form. I tried files but I am getting a null error [18:50] TooTallNate has joined the channel [18:51] prettyrobots has joined the channel [18:51] bradleymeck: wink_, instead of actually messing with the env use in configure ("conf.check(lib='foo', uselib_store='FOO',libpath='./bar')") and it will put the right lib in to the FOO that you can use during build, ie: obj.uselib = ["FOO","BIZZ"] [18:52] prettyrobots: isaacs: Does NPM produce RPMs or some such? [18:53] Eber has joined the channel [18:53] sprout has joined the channel [18:53] wink_: bradleymeck: ok let me make that edit and see what i break :D [18:55] boaz has joined the channel [18:55] wink_: bradleymeck: like so? http://pastebin.com/N7pfPHJi [18:57] WALoeIII has joined the channel [18:58] bradleymeck: yea looks ok on glance [18:58] wink_: it fails to find the lib, yet ./mongo-c-driver/libmongoc.so exists :< [19:00] ivong has joined the channel [19:01] bradleymeck: ask in #waf ? < wink_ [19:01] wink_: ok, thanks [19:03] stepheneb has joined the channel [19:04] fizx has joined the channel [19:06] programble has joined the channel [19:11] melpad has joined the channel [19:11] creationix has joined the channel [19:14] wink_: what a nightmare this is :p... [19:15] bradleymeck: waf can be, not sure why thats not working though [19:15] Anti-X: life? [19:16] smullen has joined the channel [19:17] wink_: i think it may be working now, im getting an unresolved symbol, but i think thats my fault [19:17] bradleymeck: need to write up some simple stuff on waf [19:18] bradleymeck: mac os and waf are not best buds [19:18] wink_: i can imagine :p [19:18] aubergine has joined the channel [19:19] bpot has joined the channel [19:20] smullen: I have a question about how node deals with long running processes. [19:20] smullen: How do requests stack up? [19:21] Tobsn has joined the channel [19:21] bradleymeck: stack up? mmm? http requests? are they being held onto? no not unless someone holds a reference to them [19:21] Tobsn: mornin [19:21] mjr_: smullen: it depends on a great many things. Are you not servicing them as fast as they are coming in? [19:21] smullen: I'm not doing anything yet. I just want to know. [19:22] smullen: Let's say I have a process for mangling PDF's to jpgs. It's going to take a bit to do that. [19:23] mjr_: smullen: so your question is, where do all of the HTTP requests go while that is happening? [19:23] creationix: TooTallNate: keep the patches coming :) [19:23] smullen: Um, yeah. [19:23] smullen: I mean, if you want to be succint about it. [19:24] mjr_: smullen: your PDF converter is in node, or is it some child process that you feed data into? [19:24] tjholowaychuk: creationix / ToTallNate : damn good thing we did not go with Range (yet) there was a nasty bug in fs.ReadStream [19:24] bradleymeck: they just sit around and wait, they still live in js land but they wont be doing anything unless the async callbacks from c get fired [19:25] creationix: tjholowaychuk: nice [19:25] smullen: So, can a client just dump off a bunch of requests or does it need to stay connected for each request? [19:25] mjr_: smullen: the common case, and what node is really good at, is accepting a ton of connections, then hanging on to them for a while until something else happens. [19:25] bradleymeck: it needs to stay connected if it wants a response [19:25] creationix: TooTallNate: have you tried wheat with the latest connect release and do you use npm? [19:25] isaacs: prettyrobots: no, npm just uses tarballs for everything [19:26] isaacs: prettyrobots: tgz [19:26] mjr_: smullen: the cost of keeping a connection open in node is very low. [19:26] isaacs: prettyrobots: find $(npm config get root)/.npm/.cache -name package.tgz [19:26] smullen: I thought that since node was single process, it only handled a single request. [19:26] prettyrobots: isaacs: I [19:27] mjr_: smullen: oh no. node can handle gigantic shitloads of requests. That's what it is really good at. [19:27] micheil: isaacs: does npm/nod still have issues with brew? [19:27] isaacs: micheil: probably [19:27] micheil: k' [19:27] altamic has joined the channel [19:27] creationix: smullen: that's the beauty of it, it can handle thousands of concurrent requests with a single thread! [19:27] prettyrobots: isaacs: I'm thinking that Node RPM would be nice thing to have, to publish to Ubuntu on EC2. [19:27] creationix: micheil: somone mentioned the other day that it works now [19:27] creationix: not sure though [19:27] prettyrobots: micheil: I use NPM with brew no problem. [19:27] isaacs: smullen: use separate processes if you need to compute primes or digits of pi or somethign [19:28] micheil: okay [19:28] prettyrobots: It installs executables out of the path, but I adjust my path when I work with node. [19:28] prettyrobots: brew + npm is easy [19:28] isaacs: i should really just patch brew so that it works, and if mxcl doesn't like my change, then whatever, noders can use my brew fork. [19:29] isaacs: saying "clone my brew fork" is probably more palatable than "don't use brew" [19:29] smullen: Thanks, everyone. You gave me the answers I was looking for. [19:29] rkieffer has joined the channel [19:30] mif86 has joined the channel [19:30] jbenesch has joined the channel [19:31] micheil: isaacs: max is a pretty decent guy though. [19:31] BrianTheCoder has joined the channel [19:31] isaacs: micheil: i'm sure, he definitely seems very friendly in all my interactions with him. [19:31] isaacs: we just have differing opinions about the role of npm/brew in the node experience. [19:31] micheil: ah [19:32] isaacs: package management authors are all really friendly until you start talking about package management. then they're dicks. [19:32] isaacs: i mean, i can relate. [19:33] Aria has joined the channel [19:33] ChrisPartridge has joined the channel [19:33] isaacs: you get a thousand people saying, "oh, why don't you just and then you wouldn't have to " [19:33] TooTallNate: @creatonix: yes and yes, why? [19:34] cferris has joined the channel [19:34] isaacs: and the worst is someone who's written a package manager, because they have these really super strong opinions. [19:35] isaacs: i'm sure i'll dig into it and find that what they're doing isn't so odd, in teh context of all the other things brew has to do. [19:35] isaacs: but from the outside, it's easy to just complain and be annoyed, because brew != npm [19:35] isaacs: and vice versa, i'm sure. [19:35] TooTallNate: @creatonix: and the RegExp to detect when the file doesn't exist seems to only work on Git >v1.7. They changed the error message it seems between releases [19:35] isaacs: still, it would be fun to write an OS-level packager that runs on node instead of ruby [19:36] isaacs: maybe we could get rid of dependency hell at the ld level, too [19:36] micheil: yeah, the issue was that express was install with npm, shown in npm ls installed [19:36] micheil: but node couldn't find it [19:37] isaacs: micheil: yeah, `npm config get root` should be in your require.paths [19:37] isaacs: otherwise all bets are off :) [19:37] micheil: pengwynn: ^^ [19:37] isaacs: unless, of course, you write a package.json, add "express" as one of your deps, and npm install your code. then your code will find "express", guaranteed. [19:37] prettyrobots: micheil: I always... [19:38] ThePub: I hate C :( [19:38] prettyrobots: NODE_PATH=/opt/lib/node node [19:38] prettyrobots: Or more so: [19:38] pengwynn: micheil: thanks [19:38] prettyrobots: NODE_PATH=/opt/lib/node /opt/bin/node [19:38] prettyrobots: And it works just fine. [19:38] isaacs: prettyrobots: put some : between them, there [19:38] isaacs: oh, nvm, that's an env [19:38] isaacs: baderp [19:39] isaacs: prettyrobots: i think if node lives at /opt/bin, then /opt/lib/node will be in the NODE_PATH by default, though, no? [19:39] prettyrobots: isaacs: Would an NPM to RPM converter be possible? [19:39] prettyrobots: Guess, so. After NPM has built the thing, it is all there, ready to be turned into RPM. [19:39] isaacs: prettyrobots: well, i mean, npm's format is so dead simple. i dunno. go nuts. [19:40] isaacs: it's just a gzipped tar file with a folder in the root that has a package.json [19:40] isaacs: that's it [19:40] isaacs: all the magic is in the package.json [19:40] isaacs: you could probably even bundle npm and a package and have a little "install this thing" program. [19:40] prettyrobots: Does't NPM have to build bindings on the host though? [19:40] micheil: isaacs: it's npm config set root PATH [19:41] micheil: right? [19:41] isaacs: micheil: yeah [19:41] isaacs: prettyrobots: yeah [19:41] isaacs: but in the $root/.npm/.cache/name/version/package.tgz, that's a pristine copy of the pacakge as originally installed. [19:42] prettyrobots: Okay. I'll probably do Node RPM after I'm done with Node Tar. [19:42] micheil: isaacs: yeah.. npm root was set to the node install directory [19:42] isaacs: $root/.npm/name/version/package is the working dir for the package, as installed and running now. build scripts, bindings, etc. [19:42] mytrile has joined the channel [19:42] prettyrobots: (Which implies Node CIPO.) [19:42] stagas has joined the channel [19:43] delapouite has joined the channel [19:44] jashkenas has joined the channel [19:44] markwubben has joined the channel [19:46] prettyrobots has left the channel [19:46] gerred has joined the channel [19:48] rauchg_ has joined the channel [19:48] c4milo has joined the channel [19:49] ironfroggy_: what dpes [19:49] ironfroggy_: "Error: No such native module test" mean when calling require() on a .js module? [19:50] stagas has joined the channel [19:51] c4milo has joined the channel [19:56] hassox has joined the channel [19:56] sahazel has joined the channel [19:56] TooTallNate: @creatonix: 1 more patch for ya [19:56] isaacs: ironfroggy_: it means that you're a few commits behind ry/master [19:59] isaacs: ironfroggy_: and that you're in the repl, where that was broken a while ago [19:59] Me1000 has joined the channel [19:59] loinclot_ has joined the channel [19:59] ironfroggy_: thats what i get for working off HEAD [19:59] isaacs: ironfroggy_: :) [19:59] ironfroggy_: ok i'll update [19:59] isaacs: git pull --rebase ry master [19:59] isaacs: make install [20:00] ph^ has joined the channel [20:01] ph^ has joined the channel [20:02] cloudhead has joined the channel [20:02] wink_: bradleymeck: can you look at http://github.com/w1nk/wink-mongodb and help me figure out what i've done wrong? its quite simple at the moment, but when i require the module im receiving this: http://pastebin.com/ZNzGQ9WF im sure its something silly [20:02] ironfroggy_: O_O i am always worried when its suggested i need to use rebase [20:03] cadorn has joined the channel [20:03] ysynopsis has joined the channel [20:03] ironfroggy_: hmmm i am still getting the same thing [20:04] loincloth has joined the channel [20:05] stagas has joined the channel [20:05] dpritchett: ironfroggy_: heres the commit that fixed it http://github.com/ry/node/commit/4962702e4a06e3b986cbf1d1042a29c35ef7105d [20:06] dpritchett: doublecheck your version with node -v ? [20:06] ironfroggy_: oops was building v0.2.2 tag instead [20:07] ironfroggy_: but master is failing to build with: Build failed: -> task failed (err #2): \n {task: libv8.a SConstruct -> libv8.a} [20:10] thejefflarson has joined the channel [20:11] stagas has joined the channel [20:14] fizx has joined the channel [20:15] bradleymeck: wink_ looks like the dynamic linking cant find the library [20:15] wink_: it's not being dynamically linked, i thought the unresolved symbol was coming out of my code [20:15] wink_: it's not even calling into the mongo libs there [20:16] stagas has joined the channel [20:16] bradleymeck: no includes for mongo headers even? [20:17] wink_: i do have the .h's included, but that mangled name is my class's name, let me rename it real quick to make sure... [20:17] wink_: i got it to link statically ( at least i thought so ) [20:19] wink_: yeah, the unresolved symbol is definitely out of my Mongo class [20:20] wink_: not the external libs [20:20] wink_: i just renamed it from Mongo to WTF and the unresolved symbol is now: _ZTV3WTF [20:21] hassox has joined the channel [20:22] zhesto has joined the channel [20:23] jakehow has joined the channel [20:23] wink_: ACTION shoots himself [20:25] saikat has joined the channel [20:26] ashleydev: i'm having no luck getting nojs running on AWS ec2 basic linux instance. It won't ./configure saying it can't find a program for g++ or c++ (though I have installed gcc) [20:26] altamic has joined the channel [20:28] wink_: bradleymeck: i added a simple test.js that'll reproduce the dump [20:28] wink_: im not sure what i malformed, but something in my class isn't what node is expecting [20:33] bradleymeck: ill try and build it [20:34] eisd has joined the channel [20:36] wink_: i'll love you forever [20:36] tjholowaychuk: ryah: who can/should I talk to at joyent about those binaries? [20:37] bradleymeck: how did you compile that driver as a shared lib [20:37] ysynopsis has joined the channel [20:37] adambeynon has joined the channel [20:38] EyePulp: any simple module or solution for serving an array of files as a combined object? Just thinking of a streamlined way to combine JS calls from a page we don't control that they're willing to make a single call to us. [20:38] wink_: bradleymeck: i didnt, i statically linked it [20:39] wink_: im not sure why git didnt seem to add that directory [20:40] wink_: bradleymeck: git clone git://github.com/orlandov/mongo-c-driver.git [20:40] wink_: that'll give you the c-driver [20:40] pedrobelo has joined the channel [20:40] bradleymeck: yea, im trying to get it to link right, this env stuff isnt too portable [20:40] bradleymeck: *or i dont know how* [20:41] herbySk has joined the channel [20:41] ChrisPartridge has joined the channel [20:46] MikhX has joined the channel [20:46] mjr_: ashleydev: apt-get install build-essential [20:50] hassox has joined the channel [20:50] ajsie: anyone that uses express js? [20:51] micheil: hmm? [20:51] tjholowaychuk: ajsie: yup [20:51] micheil: tjholowaychuk: I'd think you'd more then use it ;P [20:51] ajsie: tjholowaychuk: what r ur thought about is? [20:51] ajsie: it [20:51] micheil: haha [20:51] tjholowaychuk: haha [20:51] tjholowaychuk: um [20:51] ajsie: tjholowaychuk: u r the creator? [20:51] tjholowaychuk: yeah [20:51] micheil: yes, he is [20:51] ajsie: :) [20:51] ajsie: i could have smelled it in the air =) [20:51] tjholowaychuk: basically it is light-weight, takes care of boring usual crap, while not being opinionated [20:52] ajsie: tjholowaychuk: i just came from Rails .. highly opionionated haha [20:52] micheil: tjholowaychuk: I still think the routing in it's slightly wrong [20:52] tjholowaychuk: and by light-weight I mean your node hello world vs express hello world will be nearly identical [20:52] tjholowaychuk: ajsie: ah yes, I hate rails lol [20:52] ajsie: tjholowaychuk: one thing i noticed was that i have to write everything from scratch [20:52] micheil: ajsie: most node frameworks are more sinatra [20:52] tjholowaychuk: micheil: how so? (not disagreeing, there are things I want changed there too) [20:52] ajsie: tjholowaychuk: you havent thought about generators? [20:53] tjholowaychuk: no I HATE generators [20:53] tjholowaychuk: absolute hate [20:53] micheil: tjholowaychuk: I'm thinking due to the array thing (does it still do that?) [20:53] tjholowaychuk: by far the worst way to approach that problem [20:53] ajsie: tjholowaychuk: what is the best approach then? [20:53] tjholowaychuk: micheil: array thing? [20:53] ajsie: to write everything form scratch? =) [20:53] micheil: tjholowaychuk: for the storage of routes [20:53] tjholowaychuk: ajsie: modules or "packages" or whatever you want to call them [20:53] ajsie: how could you do that in express? [20:53] micheil: you were doing something were you had like three indexes in an array: regex, keys, callback [20:54] tjholowaychuk: ajsie: express is still a framework framework. since it does not ship with a db it cant do opinionated things like migrations, auth etc [20:54] tjholowaychuk: but middleware handles most [20:54] tjholowaychuk: and honestly the rest is pretty easy stuff [20:54] ajsie: okay [20:55] micheil: yeah, using mongodb with express is pretty easy, once you work out the mongodb driver [20:55] ajsie: have u planned on anything in the future? [20:55] ajsie: any visions? [20:55] tjholowaychuk: for example I have a CMS built on express [20:55] tjholowaychuk: with modularity [20:55] tjholowaychuk: *not* generators [20:55] tjholowaychuk: lol [20:55] tjholowaychuk: because generators fail [20:55] ajsie: how do generators fail? [20:55] micheil: tjholowaychuk: by the way, if a variable's undefined in Jade, what's the best way to do a check? eg, - if(variable == undefined){ [20:55] tjholowaychuk: micheil: oooo! there was an off-by-one type of bug at nodeko [20:55] tjholowaychuk: but I fixed it [20:55] micheil: fails [20:55] tjholowaychuk: with visnu [20:55] micheil: yeah [20:55] tjholowaychuk: finally found it after staring for a while [20:56] micheil: I'm thinking that an array of objects would be better, no? [20:56] tjholowaychuk: micheil: id go with mape's suggestion of if (locals.variable) [20:56] isaacs: tjholowaychuk: what's this? i'm always excited about easy errors and the ways to prevent htem [20:56] micheil: :/ [20:56] visnup: whoo hoo! [20:56] tjholowaychuk: micheil: it is an array of objects now [20:56] micheil: tjholowaychuk: okay, cool [20:56] micheil: because I rewrote part of it for an app I'm working on with adamstac [20:56] micheil: gotta run though, bbl. [20:56] mape: tjholowaychuk: did you change stuff in express? Now all my projects are broken because the static provider messes with the template rendering [20:56] tjholowaychuk: isaacs: it was the dumbest thing, originionally I had done next(++index) internally in connects router [20:57] tjholowaychuk: instead of next(index + 1) [20:57] isaacs: oic [20:57] isaacs: and now you just have an array doing forEach or some such? [20:57] tjholowaychuk: really stupid bug [20:58] tjholowaychuk: mape: messes with the template rendering? what do you mean [20:58] jameshome_: I am starting to think not having a ruby background is a huge advantage when picking up node. [20:58] mape: tjholowaychuk: if I have app.use(connect.staticProvider(__dirname + '/public')); in app.configure it tries to serve the file [20:58] mape: not the path [20:58] mape: if I remove it, everything works like it did before the update [20:59] jameshome_: some kind of uncanny valley situation [20:59] mape: But if I add it again (at the very last line of configure) it breaks again, trying to serve as static [20:59] hassox has joined the channel [20:59] davidwalsh has joined the channel [20:59] tjholowaychuk: hm [21:00] tjholowaychuk: that is weird.. [21:00] tjholowaychuk: the staticProvider got some refactoring [21:00] tjholowaychuk: but that is not in the latest connect [21:00] mape: Well latest connect broke my assetmanager so there is always something ;) [21:00] margle has joined the channel [21:01] tjholowaychuk: and Express has nothing to do with serving so that seems odd [21:01] margle: is there a channel for connect? [21:01] margle: and, is it still not recommended to run node without a proxy? [21:02] tjholowaychuk: mape: do you get some kind of reasonable exception or response? [21:02] mape: tjholowaychuk: 1sec [21:02] tjholowaychuk: I have not noticed anything wrong with the latest connect yet, but I can take a look [21:02] margle: tjholowaychuk: I don't have any problems with connect, just wanted to talk about it. [21:04] tjholowaychuk: margle: sorry that was for mape [21:04] ajsie: tjholowaychuk: there is no file structure and no MVC? [21:04] mape: tjholowaychuk: http://nodejs.se/ [21:04] margle: tjholowaychuk: oh, sorry! [21:05] mape: tjholowaychuk: and now with the line removed [21:05] tjholowaychuk: ajsie: nothing forced on you, you can roll what you need. view ./examples/mvc if you want that sort of structure [21:05] tjholowaychuk: ajsie: if oyu want something rails-like then id suggest looking at geddy [21:05] tjholowaychuk: or just use rails :p [21:05] ajsie: tjholowaychuk: i want javascript on backend [21:06] tjholowaychuk: mape: OH! I just ran into that but it was due to 3.x for some reason [21:06] tjholowaychuk: didnt look into it [21:06] tjholowaychuk: so I re-compiled 0.2.2 [21:06] tjholowaychuk: and went with that [21:06] tjholowaychuk: instead of 3.x-pre or whatever [21:06] tjholowaychuk: ajsie: give http://geddyjs.org/ a run [21:06] mape: tjholowaychuk: node? [21:06] ajsie: okay [21:07] tjholowaychuk: mape: yeah what --version are you running? [21:07] MikhX has joined the channel [21:07] mape: Yeah 3.0.0 pre [21:07] mape: guess I'll go back to stable [21:07] tjholowaychuk: try 0.2.2 [21:07] tjholowaychuk: sorry [21:07] tjholowaychuk: just hard to keep up [21:07] tjholowaychuk: with both [21:07] tjholowaychuk: ive been sticking to stable stuff for now [21:07] mape: Nah my fault, should stick to stable stuff [21:08] aliem has joined the channel [21:08] wink_: bradleymeck: if you cant get it, i can always tunnel you to my machine :P [21:08] mape: just used to having the latest from github [21:08] bradleymeck: wink_ nah, i got work just piled onto me [21:08] wink_: ah ok, fair enough :> [21:08] wink_: i'll keep flailing at it, maybe i'll get lucky ;> [21:09] papyromancer: anyone know if node_redis supports any kind of authentication? [21:10] ryah: is it just me or is the latest v8 not building? [21:11] steadicat has joined the channel [21:11] ryah: tjholowaychuk: binaries - we're discussing internally how to do it [21:11] tjholowaychuk: ryah: great! thanks man [21:12] ajsie: is it suitable to create big applications with node? [21:12] ajsie: like eg. basecamp? [21:12] satori_ has joined the channel [21:12] ryah: tjholowaychuk: it's not something we'll have soon - maybe in a few weeks [21:12] tjholowaychuk: ryah: no worries, I just think it would be really helpful in the long run [21:12] ryah: me too [21:13] tjholowaychuk: ajsie: geddy? [21:13] ajsie: no i mean node in general [21:13] tjholowaychuk: ajsie: our app LearnBoost is bigggg and runs on Express [21:13] tjholowaychuk: of course [21:13] tjholowaychuk: as long as you accept callbacks n such [21:13] ajsie: i read that people are using it for real time things, statistics etc [21:14] tjholowaychuk: takes a little getting used to [21:14] ajsie: ok [21:14] ashleydev: mjr_: it's the basic amazon AMI, and it uses yum... so that's not working [21:14] ajsie: great [21:14] tjholowaychuk: lots of people are using it for sites too, javascript is just nice to work with [21:14] mjr_: ashleydev: I've only ever used Ubuntu images on EC2, so I dunno what the RPM equivalent is. [21:15] mjr_: ashleydev: must be a pretty common thing though. I don't think this is a node-specific issue. [21:15] ashleydev: mjr_: do you have a suggested image? [21:15] ajsie: tjholowaychuk: yeah .. fun to not have to think in 2 languages and have 2 code bases [21:15] mjr_: ashleydev: I've been using Ubuntu 10.04 with pleasing results. [21:15] ajsie: only one to maintain [21:16] zemanel has joined the channel [21:16] mjr_: papyromancer: node_redis sends the auth method, but I've never actually tested it. I guess I should. [21:16] ashleydev: mjr_: 081038934311/ghc-ubuntu-10.04-x86_64 [21:16] ashleydev: ? [21:17] jameshome_: ajsie: it's still pretty new. the patterns and the modules are solid, but still evolving. you're going to have to do more on your own than you would with another approach, or if you wait six months or a year. I'm building a full size web app with it anyway, because it's a lot more fun and seems more right than any of the other options do. [21:17] ajsie: do you guys use couchdb or mongodb? [21:17] jbaron has joined the channel [21:17] ryah: gdb is a nice program [21:18] vvsh has joined the channel [21:18] dpritchett: Long thread "Which DB best fits node.js" from 11 days ago; http://groups.google.com/group/nodejs/browse_thread/thread/d571f5fda41fcc63/ [21:18] ajsie: jameshome_: yeah i know. i have taken that into consider. im giving it a shot right now .. so i dont need to switch later..im sure it's ecosystem will keep growing ;) [21:18] dpritchett: @ ajsie [21:18] MikhX has joined the channel [21:19] ajsie: jameshome_: exciting to watch JS conf 2010 in just some days .. i bet they will talk about node [21:19] ajsie: dpritchett: thanks [21:19] jameshome_: ajsie: I don't doubt it! [21:19] tjholowaychuk: ajsie: things are still very hack-oriented in the community tho, so if you do not like to investicate other sources of code, or write lots of your own it might not be the perfect fit ATM [21:19] tjholowaychuk: but if you can handle a fast growth and such [21:19] tjholowaychuk: then its awesome [21:19] wink_: bradleymeck: i got it, it was my constructor definition [21:20] bradleymeck: well i got it compiling without that env nonsense hehe [21:20] wink_: send me the wscript, i'll use it instead :D [21:21] ajsie: tjholowaychuk: yeah im pretty much investing time to dig deeper into javascript, amqp/rabbitmq, mongodb, sproutcore and much more .. so still in the learning process [21:21] mjr_: ashleydev: that one seems fine, I guess. I never bothered to figure out the subtleties between different EC2 images with the same distro version number on them. [21:21] wink_: im gonna can that repository so i can get the mongo driver stuff in there properly [21:21] ashleydev: mjr_: cool, thx! [21:21] tjholowaychuk: ajsie: cool man well good luck, everyone here is helpful so just ask if you have questions about node/js/frameworks [21:22] ajsie: yeah sure =) [21:22] ryah: ajsie: you have to be comfortable with getting your hands dirty [21:22] ajsie: node is really awesome .. think how one guy could change it all [21:22] mjr_: ajsie: couchdb has an API that is very natural to work with in node. I found talking to couchdb from node to be a very satisfying experience just to learn more about node and HTTP. [21:22] ryah: a little bit - not a bad as it was a few months ago [21:22] ajsie: ryah: i already am =) [21:23] ryah: i think almost everyone who makes a node app ends up having to patch it somehow [21:23] ryah: but less and less [21:24] ajsie: mjr_: yeah i have actually looked into that one too besides mongodb, i really love the rest thing since it doesnt require any driver, but i do hate having to create every view by myself [21:24] ajsie: in mongodb i have ready to go functions for a lot of things in ajvascript [21:25] mjr_: ajsie: yeah, that's a pretty big tradeoff. The way I look at it, you have to fiddle with the view building less often than you fiddle with the view using. [21:25] skampler has joined the channel [21:25] mjr_: Unless you don't. [21:25] ajsie: mjr_: yeah [21:25] ryah: http://github.com/ry/http-parser/blob/event_stream/http_parser.h#L249-253 [21:25] c4milo has joined the channel [21:25] ajsie: i sure give it a try after i have evaluated mongodb .. i like the versioning thing too =) [21:25] Guest64800 has joined the channel [21:26] ajsie: and that its master-master [21:26] ryah: ACTION is hoping http-parser refactor will not only solve the pause issue [21:27] ryah: but also speeed up thing by allowing fewer jumps between c++ and js [21:27] ryah: it'll also be good for people doing coroutine libs with http-parser [21:27] mjr_: ryah: That'd be awesome, given how apparently expensive it is to make a lot of trips back and forth. [21:28] ryah: so now the parser doesn't make callbacks - it just returns an array of data points [21:28] ajsie: how long do you think it takes for javascript to be as mature as ruby? [21:29] mjr_: JavaScript is arguably far more mature than ruby. [21:29] ryah: [HTTP_REQ_MESSAGE_START, HTTP_PATH, HTTP_VERSION, HTTP_HEADER_FIELD, HTTP_HEADER_VERSION, ...] [21:29] ajsie: mjr_: i mean the ecosystem in backend [21:29] mjr_: ajsie: but node, on the other hand, has a lot of growing up to do. [21:29] mjr_: But kids, they grown up so fast! [21:29] ajsie: libraries, frameworks, mature packaging system etc [21:29] ajsie: :) [21:29] ryah: ajsie: 2 years [21:29] ajsie: yeah 2 years seem fair amount of time [21:30] ajsie: i hope that too [21:30] ajsie: have you thought about one thing [21:30] benburkert has joined the channel [21:31] ajsie: traditional applications are using SQL/tables (db) <-> php/ruby/python/java(backend) <-> javascript(frontend)...3 different languages [21:31] ajsie: while we are using javascript the whole stack .. even in database with mongodb =) [21:32] ajsie: just hit me today .. so simple =) [21:32] aubergine_ has joined the channel [21:32] mjr_: It's a lot less of a context switch to work on different parts of the system, for sure. [21:32] Tobsn: #news is back online [21:33] Tobsn: and #redditstream [21:33] ajsie: yeah , instead of tables/columns/rows and sql .. you think about what you do in frontend and backend already: json objects and javascript [21:34] Tobsn: http://www.thinkgeek.com/gadgets/cellphone/e66e/?cpg=140H&head [21:34] Tobsn: lol. [21:34] ajsie: and only use one set of libraries (test tools, parsing etc) both for frontend and backend .. also you could use your code everywhere .. mobiles .. desktop .. web ..all tiers ..amazing=) [21:34] ChrisPartridge has joined the channel [21:34] jameshome_: I work on a project called Freebase which is a large public repository of free structured data. our API is JSON based, so it's not only front end/back end/db, but also web service APIs to other sites that can be js based [21:34] ajsie: i think that its huge now .. but we cant even imagine how huge it really will be in the future [21:35] mjr_: ryah: I notice that fs.write() has a callback. Is that the "callback means it's safe to re-used the buffer" callback we talked about forever ago? [21:35] ajsie: jameshome_: cool [21:35] tjholowaychuk has left the channel [21:35] tjholowaychuk has joined the channel [21:35] tjholowaychuk has left the channel [21:36] tjholowaychuk has joined the channel [21:38] ryah: mjr_: well - that's what the callback means [21:38] ryah: but we were talking about that in the context of tcp streams [21:38] mjr_: oh, ok [21:39] ryah: but yes, when the callback of fs.write is made, it's safe to use the buffer again [21:39] mjr_: so does fs.write hang on to those buffers for it's own write queue? [21:39] ryah: yes [21:39] jpld: ajsie: you store JSON in your DB then or you use one of those document-based DBs like mongo? [21:39] mjr_: ok, thanks [21:40] ryah: so if you change the buffer after fs.write() but before the callback - what is written is undefined [21:40] ajsie: jpld: i use MongoDB [21:40] mjr_: ryah: yeah, exciting undefined possibilities. [21:40] stephenjudkins has joined the channel [21:40] ryah: :) [21:41] ajsie: you store data as json objects and you create map-reduce functions with javascript functions [21:41] ajsie: pretty sweet deal [21:41] ryah: it'd be good to somehow be able to lock the buffer [21:41] ryah: if it could be done cheaply [21:41] jpld: ajsie: ahh, yeah i've heard it does well with JSON - i'll have to read about it a bit. i'm pushing for my project to use JSON through the whole stack rather than XML which gets parsed at pretty much every level. [21:41] MikhX has joined the channel [21:41] ryah: so that buffer[x] = y would throw while locked [21:42] ryah: (to help find race conditions) [21:42] mjr_: ryah: that seems like a reasonable thing to do. [21:42] ajsie: jpld: yeah [21:42] jpld: ajsie: yeah, i'm really gonna have to read about mongodb then… [21:42] ajsie: jpld: you even query using json =) [21:42] ajsie: instead of having to learn sql [21:42] cardona507 has joined the channel [21:42] jpld: sounds unreal, i'm gonna have to do that… today then (0: [21:42] ajsie: jpld: its awesome [21:42] jpld: i quite like JSON even in other languages, objc, python [21:43] jpld: not sure what XML really affords us currently anyways except from lots of parsing errors and strange catch conditions [21:43] ajsie: jpld: yeah i love json over xml [21:43] papyromancer: mjr_: I'm digging into node redis, thanks :) [21:43] ajsie: but unfortunately the html is in xml like syntax [21:43] mjr_: papyromancer: cool, let me know if you run into any issues. [21:44] jpld: ajsie: yeah, but i'm willing to look past that - kinda MVC style right [21:44] ajsie: and other tools may use xml [21:44] ajsie: yeah [21:44] mjr_: papyromancer: I'm new to redis myself, so I haven't exercised it in all of the possible ways yet. [21:44] ajsie: i know xml .. just dont want to work with it =) [21:44] ajsie: maybe im gonna to use it for providing data thorugh API to others [21:45] jpld: ajsie: it can be really quite clumsy when compared to JSON [21:45] konobi: "Node KO contestants... you're apps are going to be down for a little while. We need to feed the server creatures" [21:45] papyromancer: mjr_: works perfecly in dev, worked on production (which requires auth) up until recently, mad props for an awesome lib :) [21:46] mjr_: cool, thanks [21:46] pdelgallego has joined the channel [21:46] ajsie: jpld: yeah .. but especially so inconvienent to work with [21:46] x_or has joined the channel [21:46] ehaas has joined the channel [21:47] ajsie: something you just feel comfortable to work with eg json objects: person.username [21:47] ajsie: so natural oop =) [21:47] dpritchett: konobi: are you quoting yourself? [21:47] jpld: absolutely, cheers for the mongodb nudge, i'll give it a look tonight and see if i can throw something together with heroku/node [21:48] dpritchett: it's too late to get into the heroku node beta isn't it? [21:48] aconbere has joined the channel [21:49] ajsie: jpld: yeah .. should take u not too long to get started with [21:49] ajsie: they have good doc [21:49] jpld: dpritchett: not sure actually, they aren't allowing any new individuals in the beta or aren't allowing any new project creates? [21:49] dpritchett: Heroku blog said they weren't allowing any new beta members until 2011 [21:49] dpritchett: http://blog.heroku.com/archives/2010/9/20/an_update_on_heroku_node_js_support/ [21:49] ajsie: dpritchett: yeah .. im too late too :( [21:50] mattly has joined the channel [21:50] ajsie: maybe we could appeal to someone to share with us? [21:50] ajsie: :) [21:51] dpritchett: i *applied* before they closed the gate, i just didn't get in [21:51] dpritchett: there's always ec2 if you want to get started right away [21:51] jpld: heh, someone could add you as a collaborator [21:51] ajsie: yeah =) [21:51] ajsie: its okay for me to wait 6 months [21:51] dpritchett: i spent the weekend playing with node.js on Amazon EC2 for 37 cents. [21:51] ajsie: just not longer [21:51] zemanel has joined the channel [21:52] BrianTheCoder has joined the channel [21:52] jpld: dpritchett: oh thats not bad either [21:52] ajsie: read something about node.js on joyent [21:52] ajsie: someone tried that one? [21:52] dpritchett: konobi is representing joyent's not-released-to-the-public-yet no.de service in this channel i believe [21:52] dpritchett: they hosted Node Knockout but that's all afaik [21:52] ajsie: okay [21:53] jpld: ahh [21:53] ekidd has joined the channel [21:53] BrianTheCoder: has anyone used node-imagemagick? [21:54] zemanel: tweetirc #nodeko code is now public at http://github.com/nko/celestial-being [21:54] zemanel: not that it's groundbreaking [21:54] saikat: is it possible for packets to get lost on a websockets connection without the connection itself dying? [21:54] jpld: hmm, you'd hope not [21:55] jpld: but packets can get lost in any socket connection no? [21:55] jpld: its the TCP layer that is supposed to handle resending [21:55] saikat: yeah [21:55] saikat: that's what i thought too [21:55] Wandrewvious has joined the channel [21:56] saikat: i'm just seeing what seems to be my client-side messages never making it to the server, but not entirely sure what's causing it [21:56] saikat: could be any number of things [21:56] jpld: can you monitor the network interfaces on both machines to see if they are really being sent/received? [21:56] saikat: yeah [21:57] saikat: that's what i'm doing [21:57] saikat: or well [21:57] saikat: i'm monitoring the server [21:57] saikat: to see if they are getting received [21:57] jpld: i would have thought that the server would acknowledge receipt as well, so it seems like the socket would know if stuff isn't making it [21:57] saikat: and i'm doing some tracking to detect if clients are getting message timeouts [21:57] saikat: and more clients than i would have expected are getting timeouts (the timeouts are set pretty high and many of them are not on slow connections) [21:58] saikat: and the few times i've been able to follow the thread, the server doesn't seem to be getting their updates at all [21:58] mjr_: saikat: you can use my http_trace program to decode websocket traffic off the wire. [21:59] mjr_: It's quite possible that TCP packets are getting dropped, but they'll all be retransmitted before the receiving application sees anything. [21:59] mjr_: It's not possible for TCP messages to be delivered out of order. [22:00] mjr_: It is possible for the websocket code on either end to have bugs than end up dropping messages, on account of websocket is so new. [22:00] codetonowhere has joined the channel [22:00] saikat: mjr_: yeah, i think i will try to debug a bit more [22:00] saikat: in the short term, i might just implement my own message guaranteeing to fix the problem for most users [22:00] saikat: and just resend on client-side timeouts [22:00] saikat: my server is idempotent [22:00] saikat: so it shouldn't be too hard [22:01] saikat: or rather, my message processing on the server is idempotent [22:01] saikat: also sorry mjr_ i keep forgetting your github handle [22:01] mjr_: mranney [22:01] saikat: i should probably bookmark it since you are making a few interesting things =) [22:01] saikat: thanks [22:01] jpld: ahh, so maybe you could try a different browser with a different websocket implementation to see if it occurs there as well? [22:01] saikat: i don't see http_trace there? [22:02] saikat: jpld: unfortunately, this is already production code and the issue is one that i'm not having as much as about 10-20% of my users are having [22:02] saikat: and it seems like [22:02] jpld: ahh [22:02] saikat: it's an even split between chrome and firefox [22:02] saikat: though FF is XHR-polling [22:02] jpld: socket.io? [22:02] saikat: and chrome is websockets - i kind of would expect firefox to have some problems, but chrome is strange [22:02] saikat: yeah [22:03] mjr_: saikat: it's part of node_pcap. I need to split it out into its own project. [22:03] jpld: yeah, somehow i too would have guessed that google's networking code would be pretty decent [22:03] Tobsn: http://www.thinkgeek.com/gadgets/cellphone/e66e/?cpg=140H&head [22:03] jpld: maybe the socket.io server isn't up to snuff or the websocket spec doesn't handle failures well, or define how they are to be handled [22:04] saikat: yeah, i'll have to debug a bit [22:04] mjr_: saikat: looks like my websocket decoder prints the draft76 auth jumble in each message. Whoops. [22:05] saikat: thanks for the suggestions though mjr_ and jpld [22:05] pdelgallego has joined the channel [22:06] konobi: dpritchett: indeed [22:06] konobi: dpritchett: though it's isaacs, ryah and myself really [22:07] dpritchett: time to go home. i'll try to figure out how to get npm to install geddy without requiring sudo... tomorrow [22:07] isaacs: dpritchett: lmk if you need any help with that [22:07] slpsys has joined the channel [22:07] ircretary has joined the channel [22:07] dpritchett: this appears to address it directly... the answer is probably "pull from github and give up on using the current npm package" http://github.com/mde/geddy/issues/unreads#issue/34 [22:09] isaacs: dpritchett: seems like mde fixed it in HEAD. you should just bug him to publish the change to npm's registry [22:09] isaacs: i disagree with his reasoning here about not having root-owned files when installed with root [22:09] isaacs: imo, if you'er root, you SHOULD install root-owned stuff [22:10] dpritchett: i just like where he ends up with "it should also work now when being installed without sudo." [22:11] isaacs: dpritchett: seems like that task should be unnecessary with npm anyhow. [22:12] hassox has joined the channel [22:12] isaacs: ah, uninstall will still require sudo, though [22:13] samsonjs has joined the channel [22:13] saikat has joined the channel [22:13] ph^ has joined the channel [22:14] samsonjs has joined the channel [22:15] sh1mmer has joined the channel [22:16] mjr_: sh1mmer: did you see isaacs' ml post about emitted event, observer pattern, etc? It's pretty relevant to what you were talking about earlier. [22:16] isaacs: mjr_: what's this? [22:16] sh1mmer: no, but I did make a deadlock test case on the plane [22:16] mjr_: neat [22:16] sh1mmer: 1 sec [22:16] mjr_: isaacs: something you said on the list a while back, I can't remember the subject of the thread. [22:17] mjr_: I went and caught up on the list today. Just skipped over hundreds and hundreds of messages without reading them. [22:17] isaacs: i see [22:17] isaacs: oh, that old haw about "emit should be async"? [22:17] sh1mmer: http://gist.github.com/592695 [22:17] isaacs: yeah. [22:17] mjr_: that's the one [22:17] isaacs: emit should very very much NOT be async. [22:17] isaacs: if emit is async, then the http server breaks. [22:17] isaacs: baaaaaaderp [22:17] isaacs: no [22:18] sh1mmer: mjr_: the emit function forces node to look for events [22:18] sh1mmer: if you put emit in a settimeout the event never gets evaluated [22:18] sh1mmer: or rather it does, but only once the current execution path has finished [22:18] sh1mmer: so I could produce the deadlock above [22:19] isaacs: sh1mmer: that SHOULD deadlock [22:19] mjr_: Are you sure it doesn't just fill up the setTimeout queue with so much work that node locks up? [22:19] sh1mmer: isaacs: well that's an area of debate [22:19] sh1mmer: isaacs: in the current architecture it certainly does [22:19] hannesw__ has joined the channel [22:19] isaacs: sh1mmer: i'm not sure i'ts an area of debate, really. nodejs is single-threaded for a lot of great reasons. [22:20] sh1mmer: mjr_: yes, because the first timeout should be called quick enough to stop the while from firing [22:20] isaacs: sh1mmer: i mean, what you're suggesting is a form of shared-state concurrency [22:20] sh1mmer: isaacs: I know, I get that [22:20] isaacs: sh1mmer: run that code in a browser. same behavior. [22:20] mjr_: sh1mmer: I don't think it works that way. [22:20] mjr_: lemme try it [22:20] isaacs: setTimeout provides a *minimum* timeout value, not a maximum [22:20] sh1mmer: isaacs: I know [22:20] isaacs: then what's the debate? [22:21] HAITI has joined the channel [22:21] sh1mmer: isaacs: I think the issue is that if events don't "break in" to execution then a long execution path can have bad consiquences [22:21] ph^ has joined the channel [22:21] ryah: whew. http-parser works now. [22:21] isaacs: ryah++ [22:21] v8bot: isaacs has given a beer to ryah. ryah now has 2 beers. [22:21] sh1mmer: and that has code architecture implications [22:21] sh1mmer: big ones [22:21] sh1mmer: yay [22:21] sh1mmer: ryah: what did you think to mnot's patches? [22:21] isaacs: sh1mmer: yeah, but "breaking in" means shared state concurrency [22:22] ryah: sh1mmer: not sure i saw them? [22:22] sh1mmer: isaacs: indeed [22:22] isaacs: sh1mmer: you must not be able to interrupt a tight loop like that, or else you have raptors randomly attacking you [22:22] jbenesch has joined the channel [22:22] isaacs: sh1mmer: if you want to ensure that a program doesn't run forever, kick it off in a sub process, and kill it after a certain time. [22:22] mjr_: sh1mmer: http://gist.github.com/592698 [22:22] isaacs: sh1mmer: indidentally... [22:22] isaacs: js> while (true) ; [22:22] sh1mmer: ryah: http://github.com/mnot/node/commits/master [22:22] gbot2: isaacs: Timeout. [22:22] isaacs: voila [22:22] sh1mmer: isaacs: right, I agree [22:22] sh1mmer: isaacs: I'm saying that has implications on code architecture [22:23] isaacs: sh1mmer: ok, maybe i'm being dense, certainly not the first time... but it seems like we agree. [22:23] sh1mmer: because a "runaway" function could take down a server [22:23] isaacs: and yes, it has implications. great lovely wonderful implications. [22:23] pgriess has left the channel [22:23] sh1mmer: we do, I guess I'm saying there is a bad implication too [22:23] mjr_: yes, a runaway function can take down a server. I think that's pretty much the case. [22:23] isaacs: sh1mmer: so run your server in a subproc [22:23] sh1mmer: I'm trying to figure out architectural issues to highlight to people [22:24] sh1mmer: but I'm also wondering if having some built in protection isn't helpful too [22:24] isaacs: sh1mmer: i mean, it's an easy problem to solve without breakins. once you allow break-ins, you better hide yo kids, hide yo wife, and hide you javascrip too, cuz we rapin alla threads up in here. [22:24] mjr_: But your example program isn't doing what you think it is doing. [22:24] sh1mmer: heh [22:24] ryah: sh1mmer: looks good [22:24] ryah: sh1mmer: is he going to pull-req me or email? [22:24] sh1mmer: I dunno lemme ping him [22:24] mjr_: Because setTimeout callbacks don't run until the current stack unwinds. [22:24] isaacs: sh1mmer: you could just show them every "intro to nodejs" video that ryah's done, where he says, "That's not a sleep." [22:24] ekidd has joined the channel [22:25] sh1mmer: ryah: we need to get him to sign the committer form too [22:25] ryah: sh1mmer: i think he has [22:25] papyromancer: mjr_: rolled back to connect-redis 0.0.2 and auth works again :) [22:25] sh1mmer: ryah: ok [22:26] tjholowaychuk: papyromancer / mjr_: the old version had fictorial's localized [22:26] tjholowaychuk: so that is probably why [22:26] tjholowaychuk: now im using node_redis as an npm dep [22:26] sh1mmer: mjr_: right, but I think EventEmitter force events tofire [22:26] sh1mmer: mjr_: on emit anyway [22:26] tjholowaychuk: once stable will localize it again [22:26] mjr_: sh1mmer: no, it won't ever run [22:26] isaacs: sh1mmer: mjr++ [22:27] mjr_: sh1mmer: it can't run because the while loop is busy creating a million calls to setTimeout, none of which will ever run. [22:27] mjr_: until presumably you run out of memory to store those callbacks andthen something blows up [22:27] sh1mmer: mjr_: I mean if I call ee.emit() in the loop EventEmitter is forcing the callbacks to run [22:27] mjr_: sh1mmer: yes, that's true. [22:27] sh1mmer: if there was an Event from outside that closure it wouldn't break the loop either [22:27] malkomalko_ has joined the channel [22:27] isaacs: sh1mmer: yes, ee.emit() is sync [22:27] sh1mmer: right. [22:27] isaacs: blocking etc [22:27] mjr_: sh1mmer: a runaway loop can take down a server. This is true. [22:27] isaacs: if ti wasn't, then an http server would lose body chunks [22:27] sh1mmer: I'm not saying this is wrong, I'm saying it has implications for coding style. [22:27] mjr_: But that's not a "deadlock" [22:28] malkomalko_: so it looks like after upgrading to the new express/connect, and using connect-redis, that the bodyDecoder middleware is hanging my requests.. anybody run into this? [22:28] mjr_: It's an active CPU burn [22:28] sh1mmer: The more you make your code "event driven" the less blocking it will be and the better you can handle more connections [22:28] sh1mmer: but that also comes at a context switching cost [22:28] sh1mmer: and probably a state encapsulation in memory cost as well [22:28] mjr_: tjholowaychuk: any idea why the auth doesn't work? I should look at that. [22:28] tjholowaychuk: malkomalko_: what node --version? [22:28] tjholowaychuk: mjr_: I dont think we have an auth method [22:28] malkomalko_: 0.2.1 [22:28] malkomalko_: It took me a while to figure out what was causing the problem [22:28] tjholowaychuk: malkomalko_: hmmmMMM [22:29] mjr_: tjholowaychuk: auth is in there [22:29] Aria: Explicit state encapsulation is usually cheaper than stacks in memory cost, sh1mmer. [22:29] tjholowaychuk: mjr_: oh, I dont know I havent tried it [22:29] mjr_: tjholowaychuk: oh, but maybe I added it after you packaged it up. [22:29] tjholowaychuk: maybe [22:29] tjholowaychuk: but I am using npm deps right now [22:29] tjholowaychuk: since its changing tons [22:29] malkomalko_: and without bodyDecoder I don't have access to req.body right? so I'm just trying to figure out why it'd be hanging the request [22:29] tjholowaychuk: malkomalko_: yup that is right [22:30] Aria: And the context switching cost can be a function call. Very cheap. [22:30] sh1mmer: Aria: I'm not saying it isn't, but these are all architectural considerations in writing for event-loop servers [22:30] sh1mmer: and it's worth writing down [22:30] Aria: What I'm saying is that they're LESS considerations for eventloop servers. [22:31] aconbere: /home/aconbere/Projects/javascript/node/deps/v8/src/x64/macro-assembler-x64.h: In member function 'void v8::internal::MacroAssembler::SmiMul(v8::internal::Register, v8::internal::Register, v8::internal::Register, LabelType*)' [22:31] aconbere: hmmmm [22:31] isaacs: sh1mmer: some of the words your'e using (deadlock, context-switching cost) sound very thready [22:31] malkomalko_: the weird thing is, if I take out connect-redis for my session store and put it back to the memory-store, it works like a charm [22:31] skampler_ has joined the channel [22:32] sh1mmer: isaacs: yeah sorry. Looking for the right terms in my current vocab. [22:32] isaacs: sh1mmer: well, the term for "deadlock" in an event driven system is "it doens't happen" [22:32] sh1mmer: Also, I blame the Erlang guy I was talking to on the yshuttle [22:32] isaacs: hehe [22:32] Aria: Hehe [22:32] aconbere: so I'm getting errors when trying to build node [22:32] isaacs: same for "context switch" [22:32] isaacs: doesn't happen [22:32] aconbere: (see above) [22:32] isaacs: there's only one context [22:32] gthb has joined the channel [22:32] aconbere: and I'm stumped on where to begin to try to fix them [22:32] sh1mmer: isaacs: well you can consider switching between requests "context" [22:32] isaacs: the trade-off, conceptually, is that your program must repeatedly "let go" so that more events can happen. [22:32] Aria: Yeah. You unwind out of the context before entering the next. You switch when there's no context left ;-) [22:33] sh1mmer: in that you have to retain state for them while you are waiting on their callbacks [22:33] isaacs: sh1mmer: but, "context", in this context, means something, and that isn't it [22:33] sh1mmer: agh. brain. hurt. [22:33] sh1mmer: sorry. [22:33] isaacs: sh1mmer: but you have closures. they just do that [22:33] x_or has joined the channel [22:33] aconbere: http://gist.github.com/592713 [22:33] aconbere: there's the full gist [22:33] Aria: Yeah. Not 'context'. The word for that is 'state' [22:33] mjr_: sh1mmer: there are indeed architectural considerations here that are worth writing down and having everybody understand. [22:33] sh1mmer: isaacs: right, but maintaining that state has a memory cost [22:33] isaacs: sh1mmer: Aria ++ [22:33] Aria: And yeah, closures make maintaining state easy, and relatively obvious WHAT you're retaining. [22:33] isaacs: sh1mmer: true, but it's low. [22:34] mjr_: tjholowaychuk: just tested auth with node_redis and it worked as expected. [22:34] Aria: The thing is, if you're threading, you're maintaining that state _as context that must be switched_ [22:34] mjr_: papyromancer: are you using node_redis from connect-redis? [22:34] isaacs: sh1mmer: so, you wanna talk about problems, let's talk about the problems of event-loops vs threads. [22:34] sh1mmer: isaacs: well I think that depends on what you are storing and for how many connections [22:34] isaacs: sh1mmer: 1) you must write small fast programs that release to the event loop quickly. ie, async > sync io, don't compute primes. [22:34] sh1mmer: isaacs: I'm not trying to find problems I'm trying to find how we teach people to write good code for node [22:34] sh1mmer: and that means avoiding some pitfalls [22:34] sh1mmer: I'm not trying to question the approach we are taking [22:35] Aria: Well, sure. Threaded systems have state too. They just store it on the stack. Often with temporary variables in there too. And they often do all sorts of complicated context switching. [22:35] tjholowaychuk: mjr_: weird! [22:35] papyromancer: mjr_: yes I'm sticking with npms [22:35] mjr_: sh1mmer: I think the pitfall you've uncovered is that you can take down a server by building a single infinite loop. [22:35] isaacs: sh1mmer: 2) make sure that you don't leak memory, becasue you're writing a server. (same goes for threads, but it's simpler to just drop the context and lose all the state you were keeping) [22:35] Aria: With an evented system, you get to be explicit about what state you maintain. [22:35] sprout has joined the channel [22:35] mjr_: papyromancer: you use the version in npm, and auth doesn't work? [22:35] papyromancer: mjr_: but I don't have anything in my package.json to install node-redis [22:35] sh1mmer: mjr_: I think I was trying to highlight that you can take down a server by creating a workload that is blocking [22:36] sh1mmer: mjr_: a loop with a stupid condition is just an easy way of blocking [22:36] papyromancer: mjr_: my problem is complicated because I'm running node 1.101 in production (where auth actually gets called) and 2.2 in dev where no auth is needed [22:36] isaacs: sh1mmer: right. and, you simply *cannot* do any Sync io, ever, or you will make everyone wait. [22:37] isaacs: sh1mmer: with a thread-per-request approach, you can do sync io all you want, but at the price of lots of extra ram per request. [22:37] sh1mmer: right [22:37] tjholowaychuk: papyromancer / mjr_: shit you know what, I re-localized node_redis I think [22:37] isaacs: sh1mmer: so, the 100r/s case is simpler, but the 100000r/s case is impossible. [22:37] tjholowaychuk: because npm deps kinda fuck up some other ways that I handle things [22:37] aconbere: hmm okay well I moved to stable and that compiled today (yesterday if failed with the same error) [22:37] Aria: And, your infinite loop will be harder to detect -- you'll have a thread go wild (...and if it allocates RAM, ouch...) [22:37] sh1mmer: isaacs: I'd like to think the 100k rps is possible, but maybe not [22:38] isaacs: sh1mmer: i mean, with a thread-per-cnxn [22:38] Aria: If you have very lightweight threads and are very careful about what you keep on the stack, sure. [22:38] sh1mmer: isaacs: oh yeah, for sure [22:38] Aria: And have an OS whose scheduler wakes threads very carefully in response to IO [22:38] isaacs: sh1mmer: yahoo can't do it ;) of course, they're running php [22:38] sh1mmer: isaacs: but with node, if you have a 100k connection each sucking up some state and waiting for some IO then you could soon eat a lot of RAM [22:39] Aria: sh1mmer: What additional state is there in node that wouldn't be there in threaded? [22:39] tjholowaychuk: papyromancer: released 0.1.2 [22:39] sh1mmer: the expactations are high, for sure, but that doesn't mean we shouldn't be thinking about it [22:39] sh1mmer: isaacs: who knows for how long ;) [22:39] isaacs: sh1mmer: you'll always have less RAM than if it was threaded [22:39] Aria: Threads _keep state too_. They just keep it _on the stack along with temporary variables_ [22:39] isaacs: sh1mmer: that is, the problem you describe is a problem everywhere. it's a problem that ev-loop approach makes more solveable, but doesn't magically solve for you, necessarily. [22:40] Aria: (and, since you can then share state, and don't have to deal with locking, makes some shared-state solutions very possible.) [22:41] isaacs: sh1mmer: i'd like to say smart things about this problem, and how some of the problems that you're describing are order-of-magnitude more solveable in node than in a threaded system, but Aria keeps saying it better. [22:41] isaacs: but yes, you can safely share state in a single-threaded event loop system [22:41] isaacs: and, you dont' have to deal with retardedly complicated "thread-safe" data structures, or locking, because only one thing ever has the Talking Stick at a time [22:41] Aria: Indeed. [22:42] Aria: And encourages you to split things that really could run in parallel into separate processes, with a completion event. [22:42] isaacs: sh1mmer: as an example, look at how npm handles the case of "i have a bunch of files to write" [22:42] konobi: iirc, there's also a difference in what the "stack" actually is in each case [22:42] papyromancer: tjholowaychuk: you sir, rock [22:42] tjholowaychuk: papyromancer: sorry about that man [22:42] isaacs: sh1mmer: i can safely keep a counter, and decrement it, because i know that two things won't be trying to decrement the counter at once. [22:42] tjholowaychuk: thought I had changed it [22:42] aconbere: hmmm [22:42] mjr_: tjholowaychuk: so the issue was that you pulled an older version of my lib that didn't have the auth method in it? [22:43] papyromancer: tjholowaychuk: do I look worried? [22:43] isaacs: sh1mmer: i really think that this is an interesting course of investigation, i don't want to come across as too beligerent here. [22:43] tjholowaychuk: mjr_: apparently yup I had an old version [22:43] isaacs: sh1mmer: i just want to come across as belligerent *enough* [22:43] isaacs: ;) [22:44] mjr_: papyromancer: sorry, it was a one-line fix. I forgot to include "AUTH" in the list of valid regular commands. [22:46] aconbere: ACTION sighs [22:46] aconbere: of course... stable isn't up to date with stable [22:46] isaacs: sh1mmer: the other way to make concurrency easier is to never ever share any state with anything ever. Ever. This is the Erlang Way. [22:47] aconbere: so checkout out v0.2.2 I get the same error [22:47] stephenjudkins has joined the channel [22:47] nwhite_ has joined the channel [22:47] aconbere: http://gist.github.com/592728 [22:48] aconbere: trying to compile the latest stable node [22:48] sh1m has joined the channel [22:49] Tim_Smart has joined the channel [22:50] aconbere: I mean [22:50] aconbere: do these errors mean anything to anyone? [22:50] aconbere: Build failed: -> task failed (err #2): {task: libv8.a SConstruct -> libv8.a} [22:50] aconbere: ^ fairly meaningless to me [22:51] isaacs: aconbere: make distclean [22:51] ajpiano has joined the channel [22:52] aconbere: I'm surprised that wouldn't be covered by doing a make clean [22:52] isaacs: aconbere: to explain the thinking behind my terse answer: "make distclean" removes v8 and other dependencies. you normally don't want to do that, since they don't update that often, and evenwhen they do, they almost always make properly. [22:52] isaacs: aconbere: and, it takes about 3x as long to compile v8 as the rest of node [22:53] isaacs: but, when you make, and there's a boatload of errors on the v8 step, 10 will get you 20 that "distclean" will solve it [22:53] ekidd has joined the channel [22:53] aconbere: cool [22:53] rwaldron has joined the channel [22:54] malkomalko_: tjholowaychuk: can you see if you try an example out with bodyDecoder with connect-redis to see if it hangs for you too or if it's just me? [22:54] aconbere: recorded - if compiling fails in v8, make distclean [22:54] aconbere: :) [22:54] tjholowaychuk: malkomalko_: sure one sec [22:55] malkomalko_: take your time [22:55] tjholowaychuk: malkomalko_: is your bodyDecoder() above or below session()? (shouldnt matter but might help reproduce) [22:55] malkomalko_: doesn't matter, tried both [22:56] tjholowaychuk: malkomalko_: nope all good for me [22:56] malkomalko_: hrmm [22:56] aconbere: isaacs: just tried to build again, failed at the same spot [22:57] malkomalko_: can you gist up the example you used so I can try it exactly? [22:57] tjholowaychuk: malkomalko_: I just took ./examples/session and added connect-session and bodyDecoder in there [22:58] isaacs: aconbere: you did distclean already? did it change the output at all? [22:58] malkomalko_: don't think that does a post that example though right? [22:58] malkomalko_: so bodyDecoder wouldn't factor in [22:58] aconbere: isaacs: I did $ make distclean; make clean; ./configure; make (roughly) [22:58] isaacs: ok [22:58] aconbere: the output appears to be roughly the same [22:59] isaacs: how roughly? can you gist the latest output? [22:59] TooTallNate has joined the channel [22:59] siculars has joined the channel [22:59] aconbere: yessir [22:59] aconbere: http://gist.github.com/592745 [23:00] papyromancer: mjr / tjholowaychuk got something about a buffer not defined with 1.2, meh, 0.2 is more my style anyway ;) if you guys are in the NY area, come to the open video conference hack day. I owe you beer. [23:00] aconbere: so this includes more compiling output (since it's starting from scratch) [23:00] aconbere: but yeah the errors appear to the be the same [23:00] zmbmartin: I am trying to mess with express and connect_auth I want to show my view if they are authenticated --> http://gist.github.com/592744 [23:01] zmbmartin: I am getting that error [23:01] mjr_: papyromancer: your version of node might be old enough to not be compatible. [23:01] aconbere: isaacs: makes me wonder how many people are compiling on 64 bit linux :) [23:01] isaacs: aconbere: ahh, interesting. maybe v8 simply don't work there? [23:01] aconbere: well 1.9.9 compiles [23:01] isaacs: aconbere: i mean, if so, then i think i know the answer to your wondering ;) [23:02] aconbere: hahaha [23:02] papyromancer: mjr_: true. 1.2 didn't cause any problems on my dev system. [23:02] tjholowaychuk: malkomalko_: I did posts to it with curl [23:02] aconbere: isaacs: so I could try backing down through releases [23:02] tjholowaychuk: malkomalko_: if it was bodyDecoder it shouldnt matter if it hits a route [23:02] aconbere: to find the first one after 1.9.9 that works [23:02] malkomalko_: ahh ok, thanks for checking [23:02] aconbere: v0.1.99 [23:02] aconbere: that is anyway [23:02] aconbere: (output from $ node --version) [23:02] malkomalko_: yup, I forgot, proof that it doesn't matter what url I go to, it just hangs lol [23:02] isaacs: aconbere: oic [23:02] mjr_: papyromancer: I started writing a redis lib because the current redis lib didn't work on the NEW versions of node. Now it looks like mine doesn't work on the old ones. Oh well. [23:03] isaacs: aconbere: the odd thing is that v8 itself isn't installing there, which leads me to believe it might be more interesting, but i dunno [23:03] aconbere: isaacs: alternatively I could actually try pulling the V8 source, and see if I run into the same issues, and ask /them/ [23:03] isaacs: yeah [23:03] aconbere: k [23:03] aconbere: :) [23:03] aconbere: I'm hitting some errors with UTF8Write [23:03] davidwalsh has joined the channel [23:03] isaacs: aconbere: at the very least, if it works there, but not in node's v8, then you have narrowed down the problem considerably [23:03] papyromancer: but an old version of your lib works on old node, so you get the prize for best upgrade path :D << mjr_ [23:03] aconbere: that I think should be fixed in newer nodes [23:03] aconbere: and so... [23:04] aconbere: I'm in a jam :) [23:04] isaacs: yep [23:04] aconbere: cool well thanks for the help [23:04] isaacs: i pretty much only run on osx and solaris these days, so i don't have a good answer for you [23:04] isaacs: np [23:04] aconbere: heh [23:04] aconbere: yeah, yeah yeah [23:04] WALoeIII has joined the channel [23:05] jacoblyles has joined the channel [23:05] bmizerany has joined the channel [23:05] MikhX_ has joined the channel [23:05] aconbere: are you a reasonable resource to ask about compiling v8? [23:05] jashkenas has joined the channel [23:05] tjholowaychuk: papyromancer: the old versions of connect-redis use fictorial's redis client [23:06] tjholowaychuk: i upgrade to mjr's recently [23:06] tjholowaychuk: d [23:07] samsonjs: is it a known issue that require is broken in the repl in v0.2.2? [23:07] papyromancer: tjholowaychuk: ahhh, now I get it, hehehe, thanks for all the help today :) [23:07] tjholowaychuk: np [23:09] samsonjs: instead of require being an object with properties such as 'paths', it's a function cwdRequire(id){...}. broken by http://github.com/ry/node/commit/ee253b374dff0fe562b3f453b7ec33e6e71a8aa3 [23:11] samsonjs: i have to run now but if i have time later i'll try to fix it. [23:13] lachlanhardy has joined the channel [23:13] emmanueloga has joined the channel [23:14] tpryme has joined the channel [23:15] codetonowhere has joined the channel [23:15] thejefflarson has joined the channel [23:18] mikew3c has joined the channel [23:19] ooooPsss has joined the channel [23:20] gerred_ has joined the channel [23:22] aconbere: isaacs: heh [23:22] aconbere: scons: done building targets. [23:22] isaacs: aconbere: figured it out? [23:22] aconbere: nope! [23:22] aconbere: v8 compiled just fine [23:23] isaacs: aconbere: hey, i was just thinking, to rule out possible issues, what if you tried installing node with nave? [23:23] dicon has joined the channel [23:23] isaacs: aconbere: curl http://github.com/isaacs/nave/tarball/master | tar zx ; cd nave ; ./nave.sh use 0.2.2 [23:24] aconbere: nave is like rvm for node? [23:24] isaacs: aconbere: it's like that, yeah [23:24] isaacs: aconbere: it's more like virtualenv fornode [23:24] LowValueTarget has joined the channel [23:24] isaacs: but same idea [23:25] saikat: anyone know if there is something like charles proxy for websockets (or if charles proxy can throttle websockets connections)? [23:26] cloudhead has joined the channel [23:27] aconbere: ACTION compiles [23:27] sugardave has joined the channel [23:28] aconbere: heh [23:28] aconbere: isaacs: that worked [23:28] isaacs: aconbere: ok, then it's something wonky in your node folder. [23:28] isaacs: reset --hard? i dunno. are you trying to build head? [23:29] isaacs: aconbere: note that you have not installed over your "real" node. "nave usemain " will do that [23:29] isaacs: aconbere: but you'll have to `exit` the subshell first [23:29] aconbere: sure [23:30] aconbere: so I'll pull a new clean repository for node [23:30] aconbere: from there what I'm doing is [23:30] aconbere: git checkout -b v0.2.2 [23:30] aconbere: and then whatever [23:31] aconbere: but let's see what I can do with a gresh repository [23:31] Tim_Smart: Won't git checkout -v 0.2.2 create a new branch from master? [23:32] Tim_Smart: s/-v/-v/ [23:32] Tim_Smart: -b* [23:32] aconbere: I'm not super git savy (even though I use it every day) [23:32] aconbere: so I'll neglect to comment [23:32] aconbere: and just say "that's what git tag told me to do" [23:33] aconbere: since v0.2.2 is an actual reference to an object [23:33] aconbere: I would expect that it works correctly [23:36] Tim_Smart: aconbere: Instead of git checkout -b v0.2.2, do `git checkout v0.2.2` [23:37] Tim_Smart: It should go into a detached HEAD state. [23:37] Tim_Smart: If you have already jumped the gun, then do a `git checkout master && git branch -d v0.2.2` [23:38] aconbere: ahhh [23:38] aconbere: so is there a way to checkout at tag into a branch? [23:38] aconbere: (not into a detached head state) [23:38] Tim_Smart: Yup [23:38] aconbere: how would one do that :) [23:39] Tim_Smart: git checkout v0.2.2 && git checkout -b v0.2.2 [23:39] aconbere: huh [23:39] aconbere: weird [23:39] technoweenie has joined the channel [23:43] sprout has joined the channel [23:46] aconbere: yay! [23:46] aconbere: and it fixed my Offset error issues :) [23:47] dnolen has joined the channel [23:48] rcy has joined the channel [23:50] kschzt has joined the channel [23:54] sahazel has joined the channel [23:54] ekidd has joined the channel