[00:05] sixtus42_ has joined the channel [00:09] jcrosby has joined the channel [00:12] JimBastard: you alive inimino [00:28] sixtus42 has joined the channel [00:28] inimino: JimBastard: yeah [00:30] chakrit has joined the channel [00:32] chakrit: Just pulled from github and make throws "Build failed -> task failed (err #2): {task: libv8.a SConstruct -> libv8.a}" .. any ideas? [00:32] frodenius has left the channel [00:32] frodenius has joined the channel [00:33] ryah: chakrit: try the latest [00:33] chakrit: oh you're here [00:33] chakrit: pulling [00:34] sudoer has joined the channel [00:34] CIA-56: node: 03Ryan Dahl 07master * ra98afdf 10/ (108 files in 11 dirs): [00:34] CIA-56: node: Revert "Upgrade V8 to 2.0.5" [00:34] CIA-56: node: This reverts commit 20b945df706b2b9fcbc1a84230372d288d497544. [00:34] CIA-56: node: Broken on Hagen's Macintosh. Don't have time to investigate. - http://bit.ly/5WIGfw [00:34] CIA-56: node: 03Ryan Dahl 07master * ra2d809f 10/ (ChangeLog doc/api.txt doc/index.html wscript): bump version - http://bit.ly/826WST [00:35] chakrit: ryah: 'install' finished successfully [00:36] ryah: cool [00:36] JimBastard: sup inimino [00:36] JimBastard: so im doing this contest this weekend [00:36] JimBastard: ive got a solid idea but im stuck on one point [00:37] JimBastard: i might need to do some serious cross-domain voodoo magic [00:37] JimBastard: you know anything about this [00:37] chakrit: I imagine the voodoo doll begin the guy who invented cross-domain policy [00:37] chakrit: s/begin/being [00:38] JimBastard: i actually meant voodootikigod [00:38] JimBastard: when i said voodoo maic [00:38] JimBastard: magic [00:38] chakrit: O.o [00:38] JimBastard: :p [00:38] chakrit: lolz [00:38] JimBastard: this api for drop.io [00:38] JimBastard: for the real-time xmpp javascript stuff [00:39] JimBastard: they require an html file to be placed on your domain, that looks like http://drop.io/streamer_xdr.html [00:39] JimBastard: then this gets included as an iframe as part of the comet stuff [00:39] JimBastard: i need to bypass that so i dont have to include another file on my server [00:39] JimBastard: or on the server at all [00:41] inimino: hm... [00:41] JimBastard: ive got live examples up and what-not [00:41] JimBastard: im going to the offices tonight and seeing what i can figure out from the devs [00:41] JimBastard: im not sure if its gonna be possible or not [00:42] inimino: why can't you include what you're supposed to include? [00:43] brandon_beacher has joined the channel [00:44] inimino: hm, interesting file, I see how it works [00:44] inimino: var escapedData = /\??(.*)/.exec(window.location.search)[1]; [00:45] JimBastard: im thinking i could just create the contents of the iframe dynamically instead? [00:45] inimino: that's a nice way of dealing with the fact that some browsers include the "?" and some don't too [00:45] JimBastard: yaya for sure [00:49] fictorial has joined the channel [00:51] quirkey has joined the channel [00:51] JimBastard: hey quirkey [00:52] quirkey: hey JimBastard - hows it going [00:52] JimBastard: chillin, what you doing tonight? you should come to the drop.io offices for free beer and pizza [00:52] JimBastard: im in that competition they having [00:53] quirkey: oh damn - thats crazy - I had no idea, I work literaly the next door down [00:53] quirkey: but I went home already :( [00:53] JimBastard: ahahaha [00:53] JimBastard: i was there last night too [00:53] quirkey: haha [00:53] quirkey: whats the contest they're having? [00:54] JimBastard: i almost dont want to tell you, you might join and beat me [00:54] JimBastard: ahaha [00:54] erichocean: hmm, one advantage of embedding node inside v8 is that it makes it easier to embedd v8 + node into other applications. [00:54] quirkey: haha [00:54] jcrosby has joined the channel [00:54] quirkey: next time you're there, you should peek in objective subject next door [00:54] quirkey: thats where i rent a desk [00:55] JimBastard: http://dropiohackathon.eventbrite.com/ [00:55] JimBastard: ill be there over the weekend on and off [00:56] quirkey: very cool [00:56] quirkey: i wish i could hang, but i have family coming in this weekend [00:56] quirkey: kind of a wierd weekend to do it [01:03] erichocean: JimBastard: are you one of the drop.io devs? [01:06] deanlandolt has joined the channel [01:11] eddanger has left the channel [01:24] inimino: var escapedData = /\??(.*)/.exec(window.location.search)[1]; [01:24] inimino: oops [01:28] actsasflinn has joined the channel [01:33] the_undefined has joined the channel [01:35] actsasflinn: anyone really familiar with evcom? [01:38] chakrit has left the channel [01:43] jamiew: what's powering the CIA-56 bot? GitHub's IRC hooks are... unsatisfying [01:44] chakrit has joined the channel [01:45] rbranson_: http://cia.vc/ [01:45] kriskowal_ has joined the channel [01:45] kriskowal has joined the channel [01:45] jamiew: oh, very cool. Thanks. [02:06] sudoer has joined the channel [02:07] sudoer has joined the channel [02:16] sudoer has joined the channel [02:30] logicuce has joined the channel [02:31] dnolen has joined the channel [02:32] evilhackerdude has joined the channel [02:32] sebastiandeutsch has joined the channel [02:32] evilhackerdude: hi [02:39] jamiew: OH NO A HAXOR [02:50] bentomas has joined the channel [02:54] dnolen has joined the channel [03:04] hassox: morning lads/lassies [03:06] scudco has joined the channel [03:19] sixtus42_ has joined the channel [03:32] sztanpet has joined the channel [03:32] mikeal has joined the channel [03:36] sixtus42__ has joined the channel [03:40] PowerToExt has joined the channel [03:47] shfx has joined the channel [03:53] Jan- has joined the channel [03:53] stephenlb has joined the channel [03:53] Jan-: ooo, nodeJS looks *cool* [03:54] inimino: it is :) [03:55] stephenlb: ~ [03:59] chakrit: +1 ... it is :) [04:03] Jan-: for writing webservers?! [04:03] Jan-: why? [04:07] chakrit: because javascript is awesome :) [04:08] chakrit: nodejs isn't just for writing webservers though, [04:10] Jan-: ACTION also considers javascript to be awesome, and is currently writing a wave file parser in it [04:10] sebastiandeutsch has joined the channel [04:11] chakrit: I find it's a good fit for writing webservers because you are writing javascript in webpages these days anyway [04:12] Jan-: I wrote a webserver in Javascript about a year ago [04:12] chakrit: and together with CouchDB, you can have your whole stack written entirely in JS [04:12] Jan-: using jscript and the winsock socket activex control [04:12] Jan-: it wasOK [04:16] scudco has joined the channel [04:16] sebastiandeutsch has left the channel [04:38] erichocean: if I don't set a content-length, wget will "hang" on the connection, even though I'm calling req.finish(); [04:38] erichocean: is there something else I need to do? [04:39] erichocean: for instance, the "hello world" example here (http://nodejs.org/api.html) causes wget to hang [04:43] chakrit: shouldn't that be res.finish() not req.finish() ? [04:43] Jan- has left the channel [04:43] chakrit: I mean, finish the response, not the request [04:43] erichocean: IRC typo [04:44] erichocean: I'm doing res.finish() [04:44] chakrit: I see [04:44] chakrit: let me test [04:46] chakrit: this works w/ wget: http://pastebin.com/m28525808 [04:46] logicuce has joined the channel [04:47] scudco has joined the channel [04:47] erichocean: right [04:47] erichocean: if you add Content-Length, all is well [04:47] erichocean: but how would you stream a response? [04:47] chakrit: You should add Content-Length, I think it's expected [04:47] chakrit: If you want streaming I think you need [04:47] chakrit: Transfer-Encoding: chunked [04:48] brandon_beacher has joined the channel [04:48] alex-desktop: do you also have to send hex chunk lengths? [04:48] alex-desktop: ACTION tries to remember from the bits of the HTTP docs I was reading the other day... [04:51] erichocean: chakrit: I tried that, didn't seem to make a difference... [04:51] chakrit: ok.. one sec... [04:51] erichocean: alex-desktop: I've got node.js fully running on Solaris 10 x86 now [04:51] alex-desktop: cool :) [04:51] erichocean: I'm building it as a v8 extension, rather than having v8 as a library [04:52] alex-desktop: that's interesting... [04:52] erichocean: so instead of four separate build systems, we're down to one [04:52] erichocean: the one that comes with v8 [04:52] alex-desktop: scons? [04:52] erichocean: yep [04:52] alex-desktop: I was always pleased with how well that worked. [04:53] alex-desktop: well, at least, it rarely broke, whereas every other system did [04:54] erichocean: chakrit: I wonder if not sending multiple chunks actually causes node.js to not send the "chunk finished" stuff? [04:55] chakrit: Mmmm I did it once a while back... not sure where I've kept it [04:56] chakrit: erichocean: I don't know about that one :( [04:58] erichocean: kind of odd that the "hello world" doesn't actually work :/ [04:58] chakrit: erichocean: There's this on google groups: http://groups.google.com/group/nodejs/msg/9e75df46204bf79a?pli=1 [04:58] chakrit: He just omitted the Content-Length... duh :/ [04:59] chakrit: ... and res.flush() [05:04] erichocean: alex-desktop: how's SC on node.js coming? [05:05] alex-desktop: Haven't done anything today (busy at work and then family time), but last night I got most tests passing [05:05] quirkey has joined the channel [05:05] alex-desktop: for runtime.js, that is [05:05] erichocean: sweet [05:05] alex-desktop: SparseArray is giving me a hard time [05:06] erichocean: do the tests that are failing there succeed normally? [05:06] alex-desktop: but amazingly, the file is almost unchanged; just a little bit to make it a CommonJS module and replacing window with GLOBAL (not the best solution, perhaps, but it works and is equivalent) [05:06] alex-desktop: erichocean: you know, I didn't check... [05:06] erichocean: ;-) [05:06] alex-desktop: I probably should before investing too much time [05:07] alex-desktop: it is three or so tests, where the didRequestRange or something like that doesn't get called [05:07] alex-desktop: it could very easily be a problem with the test system; that was what I spent most of my time on: writing something that acted enough like the test system to work, just to see if things were working [05:08] erichocean: k [05:08] JimBastard has joined the channel [05:08] pjb3 has joined the channel [05:09] JimBastard: i think i might have figured out that xdr issues inimino..... [05:09] JimBastard: gonna try it out [05:11] erichocean: ACTION would love to see zeroconf support in node.js: http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-58.8/mDNSShared/dns_sd.h [05:12] alex-desktop: erichocean: this is the test that fails, I think: SC.replace module: Check that requestIndex works with a rangeWindowSize larger than 1 [05:12] alex-desktop: and it does pass normally [05:12] erichocean: hmm [05:13] alex-desktop: it is very possibly an issue with the test engine, as I basically hacked it together from scratch [05:13] alex-desktop: and then copied in the code for Suite [05:13] erichocean: k [05:13] alex-desktop: I'll debug more tomorrow, and try to see what is happening [05:13] chakrit: erichocean: This works w/ wget: http://pastebin.com/m2bb50334 [05:14] chakrit: I think if we're not res.finish()-ing right away we'll have to manually res.close() not sure if that's intended or if it's a bug [05:14] erichocean: will res.close() actually close the HTTP connection? [05:15] chakrit: I think. If it wasn't there wget will just wait until it times out [05:15] chakrit: So I think node is just keeping the connection alive [05:15] erichocean: perhaps wget should be sending connection: close [05:16] chakrit: oh, crap it's actually an error [05:16] chakrit: hahah [05:16] chakrit: let me try again [05:18] erichocean: passing "Connection: close" in the headers works [05:19] chakrit: Since we omitted Content-Length, how will it determine when to close? [05:19] erichocean: no idea [05:19] jcrosby has joined the channel [05:20] erichocean: hmm, with "Connection: close", I'm getting spurious data saved in wget [05:20] erichocean: like an extra 10 bytes [05:21] chakrit: I got that too [05:21] chakrit: Seems to be a bug in node itself. [05:21] chakrit: res.finish() should just does the job. [05:22] erichocean: I agree [05:22] chakrit: ACTION go fetch lunch [05:24] bryanl has joined the channel [05:38] malkomalko has joined the channel [05:39] micheil has joined the channel [05:48] brandon_beacher has joined the channel [05:50] malkomalko_ has joined the channel [05:56] hassox has joined the channel [05:58] micheil: erichocean: If there's any special configuration or install notes for getting node running on Solaris, could you add them to http://wiki.github.com/ry/node/installation-notes ? [06:02] dnolen has joined the channel [06:07] jamiew has joined the channel [06:14] micheil has joined the channel [06:26] hassox: what is a good evented testing framework for use with node? [06:33] djangomg has joined the channel [06:33] Connorhd has joined the channel [06:55] bentomas has left the channel [06:57] micheil: hmm.. we have rack and jack, what about Jill? [07:01] RayMorgan has joined the channel [07:01] micheil: http://jackjs.org/writing-jsgi-applications.html [07:02] micheil: Someone doesn't know the difference between an array and an object [07:07] chakrit: jackjs? [07:10] micheil has joined the channel [07:11] micheil: chakrit: yah [07:12] micheil: chakrit: I'm looking to see how they do some thing for reference in one of my newer own projects [07:13] chakrit: micheil: yah. those folks use arrays in weird places sometimes. [07:13] micheil: yeah, but look at the code example below, it's an object [07:13] micheil: and not only that, but array's aren't key/value pairs [07:16] chakrit: ah-ha. [07:16] chakrit: You can't use RegExp as hash keys. I've tried to do a url mapper once. [07:17] micheil: hmm? [07:17] chakrit: So I figure those guys were using arrays to do some kinda stuff [07:17] chakrit: s/some/those [07:17] micheil: you can use strings though, eg: "test/([A-Za-z]*)" [07:17] micheil: and then use new RegExp(string) [07:17] chakrit: If I remember correctly they have [["/url", function() {}], ["another", function() {}]] [07:17] chakrit: somewhere in the framework ... which is totally weird [07:17] micheil: that's how you get around that issue ;p [07:18] binary42 has joined the channel [07:18] micheil: yeah, uh, no thanks. [07:18] micheil: :P [07:18] chakrit: yup I ended up doing just that.. strings [07:19] chakrit: and I think the array in the body was so you could push strings in a few lines at a time [07:19] chakrit: they think in OO a little too much... I think [07:20] micheil: I don't think like that. [07:20] micheil: I think, this is how I want it to be and this is what it should do, then I implement it' [07:21] chakrit: yup [07:21] chakrit: but I ended up sticking with node cuz of those things [07:21] micheil: although.. yesterday I went out to write a URI router, I ended up writing a dispatcher.. O.o [07:21] hassox: lads [07:21] hassox: sorry for total n00b [07:22] hassox: how do I run the tests for node? [07:22] micheil: node is good, but I think narwhal may be a little more mature [07:22] micheil: hassox: make test [07:22] micheil: after you've do: $ ./configure $ make [07:22] micheil: *done [07:23] chakrit: Maybe. But I got into more headaches than with node [07:23] hassox: that's how you run the tests? [07:23] micheil: ryah_away: when you're about, are there any really good docs / resources on REPL, is it like Narwhal's argument's parser? [07:23] micheil: hassox: yes [07:23] hassox: so how do I make and run tests using the same setup as node in my app>? [07:23] micheil: chakrit: besides, iirc, node is faster then narwhal [07:23] micheil: huh? [07:24] micheil: hassox: do you want to test node, or do you want to test your application? [07:24] hassox: I want to test my app [07:24] micheil: ah [07:24] micheil: umm... [07:24] hassox: but I was going to use the mjtest framework in node to do it [07:24] chakrit: micheil: agreed :-) [07:25] micheil: hassox: try using the Assert module, http://nodejs.org/api.html#_assert_module [07:25] micheil: hassox: It's on my todo list to write better docs for testing, so those are only very basic atm [07:25] hassox: micheil: yeah that's what I want to use but how do I run it [07:25] hassox: ? [07:25] micheil: hassox: let me find out for you [07:25] micheil: one minute [07:26] hassox: thanx mate :D [07:29] micheil: hassox: do you have python installed? [07:29] hassox: I must have [07:29] hassox: cause the node tests run [07:29] chakrit: you're looking for a test runner? [07:29] hassox: I've never used it though [07:29] micheil: okay [07:29] hassox: chakrit: perhaps [07:29] hassox: yeah I guess [07:29] hassox: I wanna run my tests [07:29] micheil: hassox: that's fine, it's just that the node test runner is written using python [07:29] hassox: oh right [07:32] chakrit: Actually, you can embed the test into each module itself python-style [07:32] ryah_away: micheil: ? [07:33] chakrit: Just do a test for module.parent if there's no parent then you're running the file stand-alone... so just perform the asserts inside that if block [07:33] chakrit: not sure if that's the *right* way though [07:33] micheil: ryah_away: uhh.. [07:33] micheil: ryah_away: can you lend me a tip on this one, testing an app [07:35] micheil: I would guess that if you had tools/test.py and tests/mjsunit/ existing at the root of your project, then at the root of your project you could run, $ python tools/test.py [07:35] micheil: ryah: is that the right approach, or would using something like jspec be better? [07:35] ryah: chakrit: i got your bug report - it's going to be some days before i can look at it - i'm traveling for the holidays [07:36] hassox: hey ryah [07:36] ryah: micheil: *shrug* [07:36] ryah: hassox: hey [07:36] hassox: i'd like to use as standard an approach as possible [07:36] micheil: ryah: oh thanks ;P [07:36] chakrit: ryah: that's cool. :) it's actually erichocean who found the bug... and we did some experiments [07:37] ryah: patches with tests are very helpful [07:37] ryah: or just tests [07:37] micheil: ryah: I'm just trying to figure out the best way for hassox to run tests [07:37] hassox: ryah: trying to work out a good "standard" approach to using the assert module in my node app [07:37] hassox: not sure how to run it though [07:38] micheil: ryah: I guess we could go the way of having /lib/test/runner.js or something, but there has to be a better way [07:38] ryah: micheil: shell script? :) [07:38] micheil: ryah: that's why I was guessing along the lines of tools/test.py [07:38] micheil: (I mean, that's what the node make file uses) [07:38] ryah: yeah, i wouldn't use that - it's a bit annoying [07:39] micheil: hmm... [07:40] micheil: ryah: what about if I wrote something that was a wrapper for node, doing something like node testrunner.js __DIR__ [07:40] micheil: and then had testrunner report to the console. [07:40] ryah: for $i in test/test-*.js; do node $i && echo "pass" || echo "fail"; done [07:40] micheil: okay then ;P [07:41] micheil: ryah: although, that wouldn't plugin to the Assert module would it? [07:41] chakrit: lol.... roll everything ourselves is the mantra right? .. :) [07:41] micheil: chakrit: yeah, pretty much [07:42] elliottcable has joined the channel [07:42] micheil: ryah: haha @ jslint \n evil: true [07:42] micheil: in the mjsunit file [07:42] jchris has joined the channel [07:43] ryah: jchris: hey [07:44] hassox: so I have htis [07:44] hassox: http://gist.github.com/ [07:44] hassox: https://gist.github.com/6a7a034a07c553346fb6 [07:44] hassox: but it seems to throw the error [07:45] hassox: https://gist.github.com/6a7a034a07c553346fb6 [07:45] hassox: updated [07:45] micheil: Assert.ok(expects, message) expects the variable expects to be true [07:45] hassox: I run that with "node myTest.js [07:45] hassox: yeah [07:45] hassox: I'm trying to get it to fail [07:45] micheil: so to pass, you'd need to do: Assert.ok(true, "I pass") [07:45] micheil: so it's working correctly then [07:46] hassox: I do that and it doesn't report [07:46] micheil: ah [07:46] hassox: but whey when it fails does it throw and not just report the error? [07:46] micheil: hassox: I'm not sure [07:47] chakrit: hassox: assert isn't just for tests [07:47] hassox: oh it's not? [07:47] chakrit: it's not a full test runner by it self [07:47] chakrit: it's for "asserting" stuff [07:47] hassox: le sigh [07:47] hassox: ;) [07:47] chakrit: it should throw an error [07:48] micheil: hassox: I'll be back in a while (I'm going to try and write something for running tests) [07:48] hassox: micheil: :D [07:48] hassox: chakrit: righto [07:48] chakrit: hassox: :) [07:49] hassox: so [07:49] hassox: moving forward [07:49] hassox: is the assert module in node the right thing to go with for doing tests? [07:49] hassox: in my app [07:50] micheil: hassox: I'm going to write a better testing framework [07:50] micheil: hassox: could you write a Gist as to how you would like to write tests? [07:50] hassox: micheil: so whats ur background mate? Have you been into js for ages? [07:50] hassox: do you know ruby test unit? [07:50] micheil: (like code for them) [07:51] hassox: although I don't think that's really appropriate for evented stuff [07:52] micheil: hassox: learnt html, learnt css, then learnt javascript via jquery and the jquery ui group, left jquery ui, built a javascript chat client on top of xulrunner, started learning dojo, got hired by uxebu, started playing with node. [07:52] micheil: hassox: just write how you feel you'd like to write tests. [07:52] micheil: try and keep it simple though [07:52] hassox: sure [07:52] elliottcable: ohai hassox [07:52] hassox: cool [07:52] hassox: hey elliottcable [07:52] hassox: how are you mate [07:52] elliottcable: you know, I added you to my chat client, but completely failed to ever talk any Node with you d-: [07:52] hassox: micheil: so started on the client sn stuff [07:52] hassox: elliottcable: haha [07:53] elliottcable: I haven’t written any code, minus some shitty boilerplate on JESS and a writeup on `from`, in like a month. [07:53] elliottcable: Driving me slightly crazy [07:53] hassox: heh [07:55] micheil: hassox: yeah, although, I'm someone who actually likes working with the DOM [07:55] hassox: :) [07:55] elliottcable: o_O [07:56] elliottcable: broken. person. [07:56] chakrit: lol [07:56] micheil: haha [07:57] mikeal has joined the channel [07:59] the_undefined has joined the channel [08:03] micheil: hassox: Something like this look good? https://gist.github.com/d5c3832a5fda28aa8215 [08:04] micheil: assert would contain all the methods of the Assert module [08:04] hassox: so far looking good [08:04] hassox: how to make async testing friendly? [08:04] micheil: I'm not sure [08:05] micheil: hassox: tbh, I'm new to doing things against async vs sync [08:05] hassox: yeah me too [08:05] micheil: brb, getting a tea. [08:05] hassox: righto [08:05] micheil: even though it's 7pm [08:06] elliottcable: assert meh [08:07] elliottcable: hassox: You ever look at Speck? I’m going to be finishing the JS version of that for Node, once I get through this JESS and `from` crap [08:07] hassox: I haven't [08:07] hassox: do you have a link? [08:07] hassox: I'm looking for a reasonably brain dead way of doing async tests [08:07] elliottcable: hassox: the original concept was actually when I came to Node.js; but for various reasons, I really dug in and nearly finished the Ruby version before even really starting on the JS version. [08:07] chakrit: micheil: you could replace Promise with a more test-friendly one. might help :) [08:08] elliottcable: Yeah, the whole concept behind Speck and grizzly (I’m calling them ‘description’ libraries) happens to be extremely async [08:08] elliottcable: hassox: http://github.com/elliottcable/speck [08:08] hassox: got some examples? [08:08] elliottcable: hassox: I was about 2% away from an official, completed release, and then I left Ruby wholesale… so there’s no real examples there, unfortunately [08:09] hassox: you've left ruby? [08:09] elliottcable: hassox: however, most of the trio of libraries are, themselves, speck’d, so you can look through the source [08:09] elliottcable: hassox: yep, for the most part; I’m a Noder now, barring any sudden job offers [08:09] elliottcable: hassox: http://github.com/elliottcable/Speck/blob/master/specifications/speck/check_specs.rb [08:10] elliottcable: hassox: unfortunately, Ruby doesn’t lend itself to the syntax necessary for the semantics of a ‘check,’ so those are fairly ugly. )-: [08:10] hassox: I was wondering what -> is all about [08:10] elliottcable: hassox: that file is actually fairly unusual; first of all, it doesn’t use the Slack extensions (Speck itself is … *extremely* light. *extremely* light.), so those are overly verbose; [08:11] elliottcable: hassox: second, it’s external to the code itself. One of the primary advantages of the system is that documentation, implementation, and description (‘specs’) can all be inlined [08:11] elliottcable: let me find an old revision… [08:11] hassox: yeah I'm not seeing how to use it from those :( [08:12] elliottcable: Here we go, the last commit (AFACR) wherein the checks for check.rb were inlined http://github.com/elliottcable/Speck/blob/8b0a043ba9982f9abe772950c4ea97dae45d67e8/lib/speck/check.rb [08:12] elliottcable: hassox: here’s a farily semantic and basic example: http://github.com/elliottcable/Speck/blob/8b0a043ba9982f9abe772950c4ea97dae45d67e8/lib/speck/check.rb#L38-41 [08:13] elliottcable: hassox: essentially, checks are nothing more than a pair of two closures; one is called and the result is stored; that result is then passed to the second one, the return value of which is the return value of the check (generally, a boolean) [08:17] elliottcable: hassox: hah, I love ->{} (even though *every rubyist I knew* hated it) [08:17] hassox: is that 1.9 syntax? [08:17] elliottcable: hassox: I love it so much, I brought it to JS with JESS [08:17] elliottcable: hassox: yep [08:18] hassox: ah k [08:20] micheil: elliottcable: I don't know much ruby, but how is Speck async? [08:21] elliottcable: micheil: It’s not, in Ruby. But grizzly, the original (and now primary) project, will be [08:21] micheil: ACTION goes to find that [08:21] hassox: micheil: I'm really having trouble thinking of a good api :( [08:21] elliottcable: micheil: no code, really (well, a little, but irrelevant) yet [08:21] micheil: hmm.. [08:21] elliottcable: micheil: impossible for me to write any code on it until I finish `from` and JESS [08:22] elliottcable: micheil: Bootstrapping your own ecosystem is *really* difficult )-: [08:22] micheil: elliottcable: I'm just going for basics I think I'll implement "sync" first, then implement async in a slightly similar way [08:22] elliottcable: heh [08:22] elliottcable: well, yeah, and you probably want ‘assert’ and stuff [08:22] micheil: duh ;P [08:22] elliottcable: the thing is, there’s no default asserts in my system [08:22] elliottcable: I *hate* that concept [08:22] elliottcable: you simply have closures [08:22] elliottcable: you can return whatever you want, whenever you want, from your expectation closure [08:23] cloudhead has joined the channel [08:23] elliottcable: if it’s truthy, it doesn’t raise out of the system; falsey ones do. Beyond that, it’s *completely up to you* [08:23] elliottcable: cloudhead! [08:23] elliottcable: oh, you’re Alexis. [08:23] micheil: so what.. test(expects, function(){return whatExpectsIs; }); [08:23] micheil: sorta thing? [08:23] elliottcable: not exactly [08:23] micheil: oh [08:24] micheil: test(expects, actual) and then compares the truthiness [08:24] elliottcable: in the Ruby implementation, it would be `Check.new(->{ my_target_object }) {|obj| obj.is_awesome? }` [08:24] micheil: (how messed up does truthiness look) [08:24] elliottcable: that Check object would be sequestered away with others in that particular Speck (Specks are object-oriented, they target specific objects, such as a Class, Module, UnboundMethod, or similar) [08:25] elliottcable: finally, when you go to run your descriptions through, to see if your code preforms as expected, the targets are compiled (by running through the target closures of each Check) [08:25] elliottcable: (which also allows you to set up any evil-ish dependant environment) [08:25] hassox_ has joined the channel [08:25] micheil: uh, man, are yuo sure that isn't tooo complicated? [08:25] elliottcable: and finally all of the expectations are run, and spit out some sort of useful information [08:26] elliottcable: micheil: Perhaps. We shall see, I suppose. It worked great for me with Speck; we’ll have to see how well it works in JS [08:26] hassox: test("test name", function{ assert stuff }) [08:26] hassox: something like that? [08:26] elliottcable: micheil: it’s *extremely* different from traditional unit testing; it’s even *more* different from ‘specifications’ like Rspec. [08:26] hassox: sorry got dropped off [08:26] micheil: hassox: https://gist.github.com/d5c3832a5fda28aa8215 [08:26] elliottcable: hassox: http://nodejs.debuggable.com/2009-12-19.txt [08:27] hassox: micheil: that's good for sync [08:28] cloudhead: I've been testing with promises so far [08:28] cloudhead: so the asserts go in the addCallback [08:28] hassox: cloudhead: do you have an example? [08:28] hassox: that we can look at [08:29] cloudhead: yeh, although it's not very diverse [08:29] cloudhead: 1 sec [08:29] micheil: cloudhead: just as long as it's something, that's fine :) [08:29] hassox: indeed :) [08:29] elliottcable: hahaha Grooveshark has weird tastes. Went from Disturbed to Samuel Barber [08:30] micheil: ACTION can't use Grooveshark, I'm limited on my bandwidth.. [08:31] elliottcable: micheil: where’re you? [08:31] micheil: Australia [08:31] elliottcable: Ah, what part? [08:31] micheil: land of the soon to be Great Firewall of down under [08:31] hassox: micheil: ur in aus? [08:31] micheil: eastern [08:31] hassox: me too! [08:31] elliottcable: ah [08:31] micheil: hassox: where abouts? [08:31] hassox: ACTION is in Bendigo, 2hrs north of melbs [08:31] elliottcable: My bestest friend evar (another Noder, @Bluebie) is in Sydney [08:32] cloudhead: https://gist.github.com/a528f73b3f0948de0da0 [08:32] micheil: hassox: yeah, no need to tell me where bendigo is, I travel a lot. [08:32] hassox: :) [08:32] hassox: where are you? [08:32] cloudhead: that's my current test file [08:32] micheil: hmm, us lot should meetup at webdirections this year [08:32] micheil: (well, 2010) [08:32] hassox: where's web directions? [08:32] micheil: Sydney [08:32] cloudhead: so I make sure the interface I'm testing returns a promise as well as doing all the usual work [08:32] elliottcable: Some dudes were supposed to meet up at RubyConf. [08:32] elliottcable: We never did /-: [08:32] cloudhead: scroll down for the actual tests [08:33] elliottcable: How the fuck do you say you’re ‘node-ing’? [08:33] elliottcable: Noding doesn’t work, nodeing sounds weird. [08:33] micheil: elliottcable: umm.. well you'd be a Noder [08:33] cloudhead: hah [08:34] micheil: elliottcable: you'd be riding the nodes [08:34] elliottcable: micheil: Yes, I’m a noder, but how do I say I am in the act of preforming node? [08:34] micheil: :D [08:34] cloudhead: nodeist sounds better [08:34] elliottcable: no. [08:34] elliottcable: noder. [08:34] micheil: cloudhead: noder. [08:34] elliottcable: That bit was decided like a week ago. [08:34] elliottcable: d-: [08:34] micheil: haha [08:34] micheil: true [08:34] cloudhead: that makes me think of 'nodder' [08:34] cloudhead: ;p [08:35] elliottcable: Yeah, well nodist is worse. [08:35] elliottcable: (… nudist?) [08:35] cloudhead: lol [08:35] micheil: haha [08:35] cloudhead: ok then. [08:35] elliottcable: I’d rather be a nodder than a nudist. [08:35] hassox: heh [08:35] elliottcable: Interesting point: I’m currently nodding in real life. [08:36] mikeal has joined the channel [08:37] micheil: cloudhead: interesting points [08:37] micheil: cloudhead: re testing [08:37] cloudhead: yeh [08:37] cloudhead: I try to return a promise whenever I can [08:37] cloudhead: if I'm not using the return value [08:38] cloudhead: sometimes it'll involve using a setTimeout(..., 0) [08:38] cloudhead: so I have a wrapper around that I call 'delayed' [08:38] cloudhead: which is just a 0ms timeout [08:38] cloudhead: but it'll allow me to return a promise [08:38] elliottcable: delay(function(){ … }) [08:38] elliottcable: I like that [08:38] cloudhead: yeh [08:38] elliottcable: readysetstdlib [08:39] cloudhead: : > [08:39] micheil: cloudhead: yeah, using promises has made me think about something, bbl. [08:39] elliottcable: … lol [08:39] cloudhead: haha [08:39] elliottcable: silly, silly people who grew up on test/unit and similar BS d-: [08:39] cloudhead: also, the last promise will have to have a .wait() on it, to make sure it blocks before exiting [08:39] cloudhead: hehe [08:39] elliottcable: ACTION was lucky enough to start with Rspec, and immediately recognize that as terrible [08:40] elliottcable: that should, perhaps, also be in the stdlib [08:40] elliottcable: a way to make sure that the last promise in the system always get wait’d [08:41] cloudhead: yea, +1 [08:42] cloudhead: I've been thinking of writing a preprocessor for test files, to be able to use comments to specify assertions [08:42] cloudhead: so I could write code like this [08:42] elliottcable: cloudhead: No need [08:42] elliottcable: cloudhead: As I pointed out earlier, grizzly does that [08:42] cloudhead: x == 1 // => true [08:42] cloudhead: hm? [08:42] elliottcable: inline descriptions ftw d-: [08:42] hassox: ACTION is nervous [08:42] elliottcable: hassox: why’s that? [08:43] cloudhead: except grizzly uses js syntax, which is overly verbose [08:43] hassox: I'm about to put my nutz on the table so to speak [08:43] cloudhead: if it's anything like Speck atleast [08:43] hassox: hope they don't get smashed too hard [08:43] micheil: hassox: why would they get smashed? [08:43] hassox: iunno [08:43] cloudhead: check(function () { x }, function (topic) {topic == 1}) [08:43] hassox: hopefully we'll find out soon ;) [08:44] cloudhead: er, missing two returns [08:44] cloudhead: lol [08:44] micheil: hassox: did you mean nuts smashed by us in here or something else? [08:44] cloudhead: check(function () { return x }, function (topic) {return topic == 1}) [08:44] hassox: yeah [08:44] elliottcable: cloudhead: nope [08:45] sveimac has joined the channel [08:45] hassox: not literally [08:45] hassox: I don't think you guys are nut smashers or anything [08:45] hassox: every exp has been awesome so far [08:45] hassox: everyone is really helpful [08:45] elliottcable: cloudhead: as I said, I can’t write grizzly until I finish `from` and JESS. `from` because I can’t write *any* JS libraries without a package system that actually works, and JESS because `function(){}` is *way* too verbose to be writing twice per line in every test case [08:46] cloudhead: ah right, jess + grizz [08:46] elliottcable: hassox: why are you afraid your nuts are going to get smashed? [08:46] cloudhead: but still, I have yet to see.. [08:46] cloudhead: even the ruby version is too verbose for me [08:46] elliottcable: cloudhead: (and JESS handles implied return statements as well) [08:46] micheil: brb [08:46] hassox: I have been working on something for node that is not a framework [08:46] hassox: but it's close [08:46] cloudhead: hassox!!! [08:46] micheil has left the channel [08:46] elliottcable: cloudhead: Yeah, it’s certainly going to be verbose. But I think it’s going to be verbose in a good, semantic way [08:46] elliottcable: hassox: oh gods /-: [08:46] elliottcable: hassox: whyyyyyy [08:46] elliottcable: hassox: d-: [08:47] cloudhead: ;D [08:47] hassox: because I see jack, express and many others [08:47] micheil has joined the channel [08:47] hassox: that are like rack in ruby [08:47] hassox: they're callstack based ways of building apps [08:47] cloudhead: hassox: we're not being serious [08:47] hassox: and I think that in node that's just not awesome [08:47] cloudhead: express sucks [08:47] cloudhead: lol [08:47] elliottcable: yeah srsly [08:47] hassox: I think that if there's some generally followed way of making apps [08:47] hassox: then it should be evented at its core [08:47] sudoer has joined the channel [08:47] elliottcable: duh >,< [08:48] elliottcable: sudoer! [08:48] hassox: you should not be able to do non-evenedted stuff [08:48] elliottcable: sudoer: you used to be nicked jtoy, right? [08:48] sudoer: elliottcable: i am [08:48] cloudhead: man js is painful to write : / [08:48] elliottcable: sudoer: I know you from #offrails d-: [08:48] qFox has joined the channel [08:48] elliottcable: cloudhead: not *that* bad [08:48] micheil: cloudhead: don't write it then [08:49] sudoer: elliottcable: cool, where do you live now? [08:49] cloudhead: micheil: but Node! [08:49] micheil: cloudhead: what about Node? [08:49] elliottcable: Uh, that’s sort of up in the air. [08:49] elliottcable: Alaska, I suppose [08:49] cloudhead: Node.*js* [08:49] elliottcable: am in Seattle right now. [08:49] cloudhead: hehe [08:49] elliottcable: Hopefully moving to North Carolina soon [08:49] elliottcable: cloudhead: it’s nowhere near as bad if you follow my rules [08:49] elliottcable: cloudhead: … which I have yet to publish, and thus you can ignore me [08:49] elliottcable: ACTION hides [08:49] cloudhead: aha [08:49] sudoer: elliottcable: cool, i am in SF until monday, but then dont really have a place to live [08:50] elliottcable: sudoer: Why’s that? [08:50] cloudhead: my problem is mainly that the language is very very verbose [08:50] elliottcable: cloudhead: Indeed it is, but the semantics are quite beautiful. [08:50] cloudhead: not being able to do parrallel assignment for instance.. [08:50] micheil: cloudhead: verbose removes clouds from ones head [08:50] elliottcable: cloudhead: objects as hashes, prototypal inheritance, closures for *everything*… <3 [08:50] cloudhead: tehe [08:50] sudoer: ive been in SF for a couple of months trying to do a startup, but my friend just sold his house so i need to move out and i didnt find a partner so i didnt get a new place [08:50] cloudhead: yea, it has some great ideas behind it [08:51] micheil: yeah, alright something like [a, b] = test(); [08:51] elliottcable: sudoer: oh shite man [08:51] micheil: would be cool [08:51] elliottcable: micheil: what? [08:51] cloudhead: micheil: yea.. [08:51] micheil: cloudhead: but I don't need cool. [08:51] sudoer: but there is endless contracting work here, but i dont want to do that [08:52] cloudhead: and better functional programming support [08:52] cloudhead: like [08:52] elliottcable: me.apply(this, [path, relativeTo, acquisition]); [08:52] cloudhead: var x = if (c==v) {5} else {6}; [08:53] elliottcable: sudoer: You’re lucky, I can’t find *any* Ruby work. [08:53] elliottcable: sudoer: I’m probably going to be working at Costco or Best Buy while I work on Node stuff /-: [08:53] cloudhead: elliottcable: : | [08:53] elliottcable: sudoer: So I suggest you take what you can get, and be grateful for it d-: [08:53] sudoer: elliottcable: well, if you can come to sf, there is literally tons of work [08:53] sudoer: everywhere i turn, i see companies hiring [08:54] elliottcable: sudoer: Problem is, most of that is Rails, which I don’t do [08:54] elliottcable: sudoer: why don’t you contract? [08:54] sudoer: elliottcable: ah, i see [08:54] cloudhead: elliottcable: I got hired for a rails position without having done any rails [08:54] cloudhead: I picked it up in a week [08:54] elliottcable: sudoer: yeah, I made the wrong choice in Ruby/Python, way-back-when. Python has lots of non-Django work, mostly in the scientific community. Ruby has nearly *no* non-Rails work [08:54] sudoer: elliottcable: i did consulting for a couple of years [08:54] sudoer: i got tired of it [08:55] sudoer: elliottcable: that is true [08:55] elliottcable: cloudhead: I could *probably* pick it up (though I have ethical problems with taking a job for a skill I don’t have, even if I honestly could pick it up on the job fairly fast) [08:55] elliottcable: cloudhead: but it’s more of a ‘I simply don’t want to touch Rails with a ten foot turd’ thing [08:55] cloudhead: yea I know what you mean [08:55] elliottcable: var me = arguments.callee; [08:55] elliottcable: hah, I love this idiom [08:56] elliottcable: ^_^ [08:56] sudoer: i use 'var me = $(this)' for jquery all the time [08:56] elliottcable: jQuwery /-: [08:56] sudoer: what does arguments.callee do? [08:56] elliottcable: I’d do `self` for that, personally [08:56] micheil: blargghh.... jquery... [08:56] sudoer: elliottcable: u dont like jquery? it seems pretty nice, i like underscore too [08:57] elliottcable: yeah what micheil said [08:57] sudoer: haha [08:57] qFox: callee = function currently executing [08:57] micheil: ACTION is a dojoer [08:57] qFox: without having to know its name [08:57] elliottcable: Underscore isn’t horrible, but the biggest problem I have with *all* of those things, is the fact that they make you throw away the JS object system [08:57] elliottcable: “You can’t use JS objects! You have to use *jQuery* objects, INSTEAD!” [08:57] elliottcable: “Any JS object, you want to do anything with, you have to use our evil-magic function on *first*, to transmorph it into a magically unicorn-mazing jQuery object!” [08:58] elliottcable: jQuery/Underscore, minus $() and _(), would be a *lot* more stomache-able to me. [08:58] micheil: you know you don't need to do $(this) in jquery, as this is usually an instance of $() [08:58] sudoer: micheil: i think you do need it [08:58] elliottcable: micheil: doesn’t solve the problem; my reasoning isn’t against the syntax, it’s against the semantics [08:58] micheil: sudoer: last I wrote jquery stuff you didn't [08:58] elliottcable: micheil: point is, you can only dispense with $() if you already have a ‘magial unicorn-loving gliterry jQuery object’ [08:58] micheil: elliottcable: I just dislike jquery because people learn jquery then claim to know javascript [08:59] sudoer: i think $() is usually not this [08:59] micheil: and they are entirely different things [08:59] elliottcable: micheil: that’s my problem with Rails [08:59] elliottcable: micheil: Rails is *not* Ruby, and jQuery is *not* JavaScript [08:59] micheil: javascript isn't the framework. it's the language. [08:59] elliottcable: My POV is that a framework has officially outlived its usefulness when you can learn, and be productive in, the *framework*, as *opposed* to the language. [08:59] elliottcable: Rails and jQuery are *both* that way [08:59] micheil: elliottcable: btw, ell.io is down, 404 [08:59] sudoer: i know ruby better than rails, but unfortunately I know jquery better than js, i really like node.js though [09:00] elliottcable: micheil: yeah, I know. Server troubles. http://elliottcable.name/ for now d-: [09:00] micheil: nice design skills dude [09:00] elliottcable: Yeah, I know freaking everything there *is* to know about Ruby (well, at least YARV, not too familiar with Rubinius/Jruby/Maglev), but nothing about Rails [09:00] micheil: (I can see you're a developer through and through :P) [09:00] elliottcable: micheil: oh ff- shut up. I like that page )-: [09:01] Yuffster_ has joined the channel [09:01] micheil: :P [09:01] elliottcable: holy— Yuffster_! [09:01] sudoer: elliottcable: well, , if you want to get work, im sure you can get tons of rails work since you are a ruby/js master [09:01] micheil: elliottcable: admitted, it's only fair you see my site, http://brandedcode.com [09:02] elliottcable: sudoer: /-: [09:02] elliottcable: sudoer: We’ll see. When I finish my ‘résumé’ and get moved, I’m going to probably apply for some stuff. [09:02] sudoer: im just saying, id rather do rails work then bestbuy [09:02] sudoer: is the problem you dont want to go near rails or you think you cant do rails? [09:02] elliottcable: sudoer: I’m not at all sure that *I’d* rather do Rails work than Best Buy >,> [09:02] sudoer: haha [09:03] elliottcable: sudoer: A healthy helping of both, really [09:03] sudoer: since we are sharing blogs, here is my crappy blog: http://jtoy.net/ [09:03] elliottcable: sudoer: Actually, I’d much prefer a docks/warehouse job of some sort, something physical to balance my mad-insane coding hobbies [09:03] elliottcable: sudoer: oh meh Jekyll [09:03] micheil: sudoer: ruby powered, probably jeykll [09:03] elliottcable: sudoer: and I didn’t share my blog [09:03] sudoer: haha, its simple [09:03] elliottcable: http://github.com/elliottcable/blog [09:03] micheil: sudoer: :P [09:03] cloudhead: it's really quite a predicament, this rails thing, I have to admit [09:04] cloudhead: I don't think it's good for ruby [09:04] cloudhead: it's dwarfing ruby [09:04] elliottcable: Yep /-: [09:04] elliottcable: ACTION shrugs [09:04] elliottcable: I stopped bothering, and left for Node. [09:04] cloudhead: of course, you can wonder if ruby would have ever been popular without rails [09:04] elliottcable: Node is young, I think I have a chance to ensure that the same thing doesn’t happen here. [09:05] elliottcable: I want to nurture a *beautiful* ecology of sensible libraries that discourage Railsisms of all sorts, and encourages light, evented, prototypal, abstracted programming. [09:05] cloudhead: it has already happened to JS... [09:05] elliottcable: cloudhead: Yes, but JS is not Node. [09:05] chakrit: elliottcable: +1 for 'prototypal' [09:05] saimon_ has joined the channel [09:05] micheil: hm.m. [09:05] elliottcable: cloudhead: JS is not even SSJS, though I think the generalized SSJS fight is a lost cause already [09:05] cloudhead: you can't find pure js work [09:05] elliottcable: chakrit: you seen poopy.js? [09:06] elliottcable: cloudhead: Not *yet*. I plan to change that. [09:06] cloudhead: : ) [09:06] elliottcable: cloudhead: Once I get this ecology put together over the next year or so, I think I’m going to start a consulting company that works in Mu and Node [09:06] chakrit: @elliotcable: ah... cool lib :) [09:06] cloudhead: well, when I say pure js, I mean sensible js, like Node [09:06] elliottcable: cloudhead: The first, I hope, of many such companies. [09:07] cloudhead: woot. [09:07] chakrit: oops... just used twitter syntax there haha [09:07] elliottcable: Twitter exchange time? [09:07] elliottcable: @elliottcable here, of course [09:07] chakrit: lol, nobody uses multiple aliases anymore huh [09:08] micheil: @miksago here [09:08] cloudhead: elliottcable: I think JESS could be really interesting, to make JS more readable & somewhat more concise [09:08] chakrit: @ my irc name [09:08] cloudhead: problem is it won't be easy to adopt [09:08] elliottcable: cloudhead: Why not? [09:09] cloudhead: because it's not a generally accepted idea [09:09] chakrit: elliottcable: where r u from? [09:09] elliottcable: chakrit: Anchorage, Alaska [09:09] elliottcable: chakrit: in Seattle right now [09:09] cloudhead: JS is probably the only language actually, where it makes sense [09:09] elliottcable: cloudhead: yep [09:09] cloudhead: but it's not something people are used to [09:09] elliottcable: cloudhead: Well, I *absolutely hate* generated code. [09:09] chakrit: elliottcable: fair enough, I might be moving to America in the future... would love to join ur company once it's there :) [09:10] elliottcable: cloudhead: which means, of *all the people in the world* from which somebody might choose someone to build a code-generation / precompiler system, I’m the best [09:10] cloudhead: haha [09:10] cloudhead: fair point [09:10] elliottcable: because I’ll be anal enough about it to make it not suck (lookin’ at you, Thrift… and you, protobufs…) [09:10] elliottcable: chakrit: We’ll see. [09:10] micheil: elliottcable: in poopy.js, I'm not too fond of the beget method on all objects [09:10] cloudhead: I trust that it'll be the best it can possibly be [09:10] cloudhead: but that might still not be enough [09:10] elliottcable: chakrit: I have *no* experience with running that sort of thing, so, I’ve no idea how I’d do it. [09:10] elliottcable: micheil: Not open for debate. [09:11] elliottcable: micheil: I’m *not* going to use horrible object wrappers. [09:11] micheil: elliottcable: each to their own [09:11] elliottcable: micheil: And I’m *definately* going to use the *actual inheritance system*, which means I’m going to put methods where I want them—on Object.prototype, Function.prototype, and Array.prototype—not some freaking ass-tarded wrapper. [09:11] elliottcable: ACTION angries [09:11] elliottcable: huge, *huge* pet peeve of mine. [09:11] elliottcable: Like, bigger pet peeve than people-actually-using-Rails. [09:11] elliottcable: lol [09:12] cloudhead: I don't have a problem with extending Object.prototype, I use Object.create() though for that sort of thing [09:12] elliottcable: See, I hate Object.create() [09:12] cloudhead: cause it's not oo? [09:12] elliottcable: That’s completely dumping object-oriented programming out the door. [09:12] chakrit: I have pet peeves with people who try to bend JS to do OOP for them... [09:12] cloudhead: yeh [09:12] elliottcable: That’s just a procedural function, put in the `Object` namespace [09:12] chakrit: like..... if I see the first hint of OO, I'd just *screams* [09:13] elliottcable: chakrit: JavaScript *does* oop [09:13] cloudhead: yea I'm aware of that [09:13] chakrit: ah.. I mean [09:13] elliottcable: chakrit: you mean classist? [09:13] chakrit: traditional class-based OOP [09:13] elliottcable: chakrit: yeah, I hate MooTools for exactly that reason [09:13] chakrit: yup [09:13] cloudhead: I might switch to something like poopy actually, I havent decided [09:13] chakrit: exactly [09:13] elliottcable: chakrit: JS has a *beautiful* prototypal inheritance system, if people would just *use* it [09:13] elliottcable: hence, poopy.js: a contract to do so. [09:14] elliottcable: also, my name is *awesome*. [09:14] cloudhead: no comment. [09:14] elliottcable: poopy.js: about as un-classy as you could get d-; [09:14] cloudhead: >_> [09:14] elliottcable: hahahaha [09:14] cloudhead: lol [09:14] chakrit: elliottcable: agreed [09:14] chakrit: hahaha [09:14] cloudhead: NewObj = OldObj.beget() // that right? [09:15] cloudhead: er [09:15] cloudhead: forget the caps [09:15] cloudhead: lol [09:15] elliottcable: lol cloudhead [09:15] elliottcable: and yes, it indeed is [09:15] cloudhead: kk [09:15] chakrit: lolz [09:15] cloudhead: yea I like that idiom [09:15] chakrit: the caps [09:15] elliottcable: although more often, it’s going to be newObj = prototype.beget(); [09:15] cloudhead: >__> [09:15] cloudhead: was still thinking in terms of `new` [09:15] elliottcable: d-: [09:16] elliottcable: Under poopy.js, the `n`-word is a curseword. [09:16] cloudhead: huh. [09:16] cloudhead: prototype.beget()? [09:16] elliottcable: it’s abstracted away behind `beget()`, and is never meant to be touched d-: [09:16] cloudhead: hehe [09:16] elliottcable: cloudhead: poopy libraries will construct and expose useful objects of all sorts, that you are intended to either use directly, or inherit from [09:17] elliottcable: cloudhead: those cover the same goals as classes in classy libraries: classes you either use class methods on, or instantiate [09:17] cloudhead: oh right ok, I though you literally meant `prototype` [09:17] cloudhead: thought* [09:17] elliottcable: cloudhead: nope, Function.prototype is meaningless under poopy.js [09:17] cloudhead: yah, what I thought [09:18] cloudhead: elliottcable: does JESS work yet? [09:18] elliottcable: cloudhead: nope. [09:18] elliottcable: cloudhead: need to finish `from` first. [09:18] cloudhead: even if it just does function to -> [09:18] cloudhead: ah right [09:18] elliottcable: cloudhead: yeah, ->{} is coming before anything else [09:18] cloudhead: cool [09:18] cloudhead: then return? [09:18] cloudhead: : D [09:18] elliottcable: Yep [09:19] cloudhead: nice. [09:19] cloudhead: lol [09:19] elliottcable: and finally some other niceities. Unicode quotes and such. [09:19] cloudhead: ah right [09:19] micheil: ACTION doesn't like compilers for javascript [09:19] elliottcable: micheil: Neither do I, friend, neither do I [09:19] elliottcable: micheil: which is ironic, since I’m writing one [09:19] micheil: so why are you writing one? [09:19] elliottcable: micheil: the goal here, though, is to enhance, and play *nicely* with JS, not try to turn it into Objective-C or Java or something [09:20] elliottcable: micheil: I thought about it a *lot*, literally, I had sleepless nights wondering if it was the wrong thing to do… but the truth is, I just don’t believe JS is the language I love it for being (if that makes any sense) [09:20] micheil: javascript doesn't need enhancements that would require a compiler. [09:20] elliottcable: micheil: I’m not trying to make JS into another language because I lack an understanding and love for JS. I’m simply trying to make JS a *more JS-y language*, does that make sense? [09:21] micheil: no [09:21] elliottcable: micheil: for instance. JavaScript is *very* heavily conceptually dependant on closures. Yet, closures are so difficult to write, that we don’t use them as wantonly as we should. We should be wrapping things into closures and passing them around willy-nilly. [09:21] elliottcable: micheil: in that way, the syntax of JS doesn’t support the semantics. Hence, pre-compiler [09:21] micheil: pah [09:21] cloudhead: " the syntax of JS doesn’t support the semantics" +1000 [09:21] micheil: yes, pah is really my only response [09:22] hassox: ok guys [09:22] hassox: here tis [09:22] hassox: http://github.com/hassox/chain/ [09:22] elliottcable: hahaha. well, micheil, each to their own. Please believe that I *certainly* understand your point, I’ve just come to believe it may actually work out [09:22] hassox: pls all feedback is welcome [09:22] chakrit: -1000 on me.. I think the syntax's ok [09:22] elliottcable: hassox: what’s with that little ASCII drawing? [09:22] elliottcable: function function function function? o_O [09:22] elliottcable: Oh, I just read the next sentance. Ignore me, hassox >,> [09:22] cloudhead: omg hassox: I was just gonna say, <- for return would make sense if we have -> for function [09:22] elliottcable: lol [09:22] micheil: hassox: hmm.. [09:23] elliottcable: cloudhead: Nope, I’m not screwing with the `return` keyword. [09:23] cloudhead: elliottcable: why not? [09:23] elliottcable: cloudhead: JESS is *not* slated to implement all of the wonderful syntactic ideas I’ve had in the past few years; those are for me to implement in my own language [09:23] cloudhead: lol. [09:23] elliottcable: cloudhead: instead, it’s *very specifically* to enhance and extend JS in purely JS-y ways [09:23] hassox: brb lads [09:23] hassox: the spec file is where the acton is [09:23] elliottcable: cloudhead: otherwise JESS would be far, far overstepping the bounds of what I consider to be appropriate for a pre-compiler. [09:23] hassox: + the examples [09:23] micheil: why do we just do a ascii art compiler which compiles ascii art pictures to javascript, I think it may just work., [09:24] micheil: why don't* [09:24] cloudhead: elliottcable: it's just that it would be much more robust than magically adding returns [09:25] elliottcable: cloudhead: I certainly won’t be magically adding them if there’s an explicit return; and I won’t be adding them to verbosely-defined functions [09:26] elliottcable: cloudhead: and the magic will be very simple, by design; if you’re doing anything complex, you should define it explicitly [09:26] cloudhead: ok [09:26] elliottcable: I think it’s going to boil down to this: if there’s no semicolons inside the scope of the ->{}, the `return` goes at the start; if there are, it goes right after the second-to-last one [09:26] cloudhead: ACTION just did an experimental find and replace with -> and <- [09:27] cloudhead: ACTION and his code is so much lighter [09:27] elliottcable: if you have any complex nested scopes, or anything more difficult than that, then you really shouldn’t be using ->{} anyway. Why bother, when your code is already that heavy? [09:28] elliottcable: hassox: I don’t quite understand. Then again, I’m buried deep in a clusterfuck of path manipulation and posix calls for `from`, so I’m a little mindfucked [09:29] elliottcable: I just sneezed so hard that I think I sprained my spine >,> [09:29] elliottcable: d-: [09:30] elliottcable: I wish I could get rlwrap to build under Homebrew! [09:30] elliottcable: working without it in node-repl is *such* a pain [09:35] hassox: bak [09:35] cloudhead: ahaha [09:35] cloudhead: node-repl yea [09:35] cloudhead: cant make a mistake, or you're screwed [09:35] elliottcable: yep. [09:35] hassox: elliottcable: ask away happy to explain it a bit [09:36] elliottcable: ACTION shrugs [09:36] elliottcable: I’m not sure I get the point of all that. [09:36] elliottcable: What, exactly, is the `chain` repository supposed to contain, then? [09:36] elliottcable: It’s obviously not a ‘web framework’ on the scale of Rails; it’s obviously not yet-another-Sinatra-clone… it seems to be passingly similar to Rack? [09:36] elliottcable: Speak to me in Ruby terms. [09:36] elliottcable: d-: [09:36] cloudhead: k bed time [09:36] hassox: in ruby terms it's rack for node [09:36] cloudhead: cyas all [09:37] hassox: it's evented rack [09:37] elliottcable: bye-bye bits.slice(0, bits.length - 1).join('/'), hello bits[bits.length - 1] = '' [09:37] hassox: cya cloudhead [09:37] elliottcable: awww bye cloudhead [09:37] hassox: it's an interface specifictaion for talking between app components [09:37] cloudhead: sry its late! [09:37] hassox: but it's got to be about events [09:37] elliottcable: o6 cl [09:37] elliottcable: … fail [09:37] hassox: if you run ab on the simple.js example, I'm getting consistent time regardless of concurrency [09:38] elliottcable: hm [09:38] hassox: rps I mean.... Individiual request times increase though [09:38] elliottcable: The neighbours hate me. [09:38] elliottcable: Wake up at 8PM, start my music, and play through until about 10AM. [09:38] hassox: well it's the same for all of them, but simple is of course the quickest [09:40] hassox: elliottcable: rather than having a callstack to pass the request from one "middleware" to another, you simply pass it via an event [09:40] hassox: so you're not blocking the loop on a single request [09:40] elliottcable: I never understood Rack correctly, I suppose. [09:41] elliottcable: But if it’s sexy and evented, I’m down! [09:41] hassox: lol [09:41] elliottcable: though your use of Namespace.Constructor sickens me )-: [09:41] hassox: ? [09:41] elliottcable: hassox: introduce yourself to poopy.js d= [09:41] hassox: I'm new to js [09:41] elliottcable: ahh [09:41] elliottcable: didn’t know (-: [09:41] hassox: just trying to get something that I can use and rely on to make apps [09:42] hassox: elliottcable: means that all of chain is contained inside Chain [09:42] elliottcable: yeah [09:43] elliottcable: hassox: Well, it may pass you over then, but I don’t think it’s really that complex, even to a JS noob… but read the README: http://github.com/elliottcable/poopy.js [09:43] teemow has joined the channel [09:43] hassox: yeah I'm reading [09:43] hassox: I'm not a total n00b [09:43] hassox: but when it comes to js conventions I am not really faimiarl [09:43] hassox: familiar [09:43] elliottcable: hassox: hit me up on Gtalk if you have any Q’s. I don’t bite. Unless, perhaps, you’re covered in honey. [09:44] hassox: hehe [09:46] elliottcable: oh gods [09:47] elliottcable: this line ends with `) }) } } }, 0);` [09:47] hassox: which line? [09:47] elliottcable: I have the feeling that an evented language would be *really* well done with meaningful whitespace [09:47] elliottcable: hassox: not your code, mine [09:47] hassox: oh right [09:47] hassox: phew [09:47] elliottcable: also, I’ve had 32 levels of indentation in Node source, hahahah [09:49] elliottcable: Ugh, I still can’t untrain `node.stdio.write` from my fingers )-: [09:50] saimon_ has joined the channel [09:50] chakrit: omg 32! [09:51] elliottcable: I talked to Steve Dekorte for a while about writing a truely evented *language* [09:51] elliottcable: i.e. no return values from units of code, only input values, and powerful cosures [09:51] elliottcable: closures* [09:54] elliottcable: hassox: I actually prefer `) }) } } }, 0);` to `)\n })\n }\n }\n }, 0);` [09:54] elliottcable: hassox: you? [09:54] hassox: I usually go for the second [09:54] hassox: more symetrical [09:55] elliottcable: hm [09:55] hassox: I can run my eye down the editor [09:55] hassox: and see where stuff is [09:56] elliottcable: I like how this style simulates the benefits of meaningful indentation, with none of the downsides (because I can always break the rules when I want to) [09:56] hassox: :) [10:12] elliottcable: If I ever. [10:12] elliottcable: Meet. [10:12] elliottcable: The people. [10:12] elliottcable: Who designed this ‘securable modules’ bullshit. [10:12] elliottcable: I am going to *put a spork through their eye socket*. [10:12] elliottcable: Then I am going to pull it out, cut off one of their testicles, and put *it* in the now-vacated socket. [10:12] elliottcable: FUCKCKKCKC [10:12] elliottcable: var from = require('/Users/elliottcable/Code/poopy.js/lib/from'); [10:13] elliottcable: Inside the file, right near the end, I `probe(from)`, and I get all the stuff that I wrote in that file. [10:13] elliottcable: then, immediately after that require line, I `probe(from);`, and I get… an empty fucking object. [10:13] elliottcable: NO WONDER I’M GETTING `TypeError: Cannot call method 'relative' of undefined`! [10:13] elliottcable: HULK SMASH ARGH [10:14] elliottcable: This is the most… unintuitive… ridiculous… bullshit… I have ever seen [10:20] elliottcable: Blah, I need to get away from this. I’m gonna walk out to the 711 (2:00 AM! woo! wish me luck with the muggers) and get a soda and some shit. [10:20] elliottcable: Will be back in a bit, all [10:21] hassox: yeah good luck mate [10:32] saimon_ has joined the channel [10:35] elliottcable: I’m back, I’m alive, and I have chex mix and mountain dew [10:36] hassox: wish we had caffinated mountain dew [10:37] elliottcable: Yeah, I heard about that. What the hell? [10:37] hassox: it's never had it in it here [10:37] elliottcable: I know, that’s what i meant. [10:37] elliottcable: They don’t sell the non-caffeinated kind here, what possible reason is there to do so there? [10:39] brandon_beacher_ has joined the channel [10:40] hassox: yeah dunno [10:41] hassox: we have plenty of caffinated soda [10:42] elliottcable: Yeah, it’s not like it’s illegal or anything. Really weird. [10:43] elliottcable: hassox: So, how do I know you? What famous Ruby did you write? o_O [10:46] micheil has joined the channel [10:47] saimon has joined the channel [11:00] saimon_ has joined the channel [11:04] hassox: elliottcable: you may know me from merb [11:04] elliottcable: hassox: ah, probably [11:05] elliottcable: hassox: I was into merb way-back-when [11:06] hassox: yeah it was fun [11:12] elliottcable: hm [11:19] hassox: righto elliottcable I'm off [11:19] elliottcable: o7 hassox [11:19] hassox: catch you later dude [11:19] elliottcable: catch my code later, more like it [11:20] hassox: :) [11:20] bry has joined the channel [11:20] elliottcable: bry: do I know you? [11:21] bry: not sure :) [11:21] bry: <-- bry4n on github [11:22] elliottcable: hrm okay [11:22] elliottcable: bry: Node.js isn’t missing exists() [11:22] bry: since when? [11:23] elliottcable: bry: posix.stat('foo.bar').addCallback(function(file){if(file.isFile){ … } else { … }}).addErrback(function(){"it doesn’t exist"}) [11:24] bry: yeah but i wrote a "shortcut" for node.js [11:24] bry: :) [11:24] bry: if (file.exists("hello")) [11:24] elliottcable: Is that sync? o_O [11:24] elliottcable: ew. [11:25] bry: http://github.com/bry4n/node_file_exists/blob/master/lib/file/exists.js [11:27] elliottcable: `yah I saw [11:27] elliottcable: That’s a pretty faulty implementation; it’d be much better to add callbacks on the Promise returned by posix.stat [11:29] bry: it will work with file and directory but the one you showed me a little example is only for file. [11:30] elliottcable: bry: No big deal, reduce back into yourself with that knowledge [11:30] elliottcable: bry: It’s what i do [11:31] bry: yeah [11:31] elliottcable: QUICK SOMEONE HILIGHT ME 4 TIMES [11:31] the_undefined: !logs [11:32] elliottcable: the_undefined: wat [11:32] the_undefined: elliottcable: hi [11:33] elliottcable: the_undefined: ’sup [11:33] jasondavies: I found a bug in require("../foo") and pushed to my repository - is it good practice to send a pull request to *everyone* else, or just ry's repo? [11:34] elliottcable: jasondavies: ry. [11:34] jasondavies: ok, thanks [11:34] elliottcable: hm. [11:34] elliottcable: Is anybody intimately familiar with `require()` and shit? [11:35] elliottcable: I seriously, *seriously* cannot figure out why it is fucking up so majorly for me. [11:35] jasondavies: elliottcable: two things changed recently [11:35] the_undefined: jasondavies: I usually send my pull requests through the mailing list [11:35] jasondavies: firstly, it seems errors are now passed via exceptions, so errors get silently ignored unless you wrap with a try/catch [11:36] elliottcable: jasondavies: what! O_O [11:36] jasondavies: secondly, there was a bug in require("../foo") [11:36] the_undefined: The more eyes go over a patch before ryan merges it, the more likely errors will get caught [11:36] elliottcable: jasondavies: Wait, you just mean in `require`? Fine by me, I don’t care [11:36] jasondavies: they combined to make node exit without printing anything at all when running it on my code :) [11:36] elliottcable: Yeah, that’s no my problem. [11:36] jasondavies: elliottcable: yeah [11:36] elliottcable: I’m carefully inspecting the object returned from `require()`, [11:37] elliottcable: and it’s … empty. Just a blank fucking object. Nothing from my require’d file is there, at all. [11:37] elliottcable: I tried carefully inspecting `exports` from within the file, it works great [11:37] jasondavies: and did it work in previous versions of node? [11:37] elliottcable: Uh, no idea, I’m developing in real time, and updating Node fairly often. [11:37] elliottcable: Ugh, `require()` is such a CF. )-: [11:38] elliottcable: Okay, here’s the code. First off, I ensure `exports` is defined (I checked carefully; this has no effect) http://github.com/elliottcable/poopy.js/blob/b21bddc5b8b44d2ba5b5c7fcbf5ff483788c0e04/lib/from.js#L182-194 [11:38] elliottcable: Then I define a bunch of stuff, and return it: http://github.com/elliottcable/poopy.js/blob/b21bddc5b8b44d2ba5b5c7fcbf5ff483788c0e04/lib/from.js#L327 [11:38] elliottcable: However, `var from = require('/Users/elliottcable/Code/poopy.js/lib/from');` in a new file gives me … nothing. An empty object. [11:39] jasondavies: might want to revert to 4526308560201bfcb9ae927abb96c2103ba31344 as that was before the recent modifications to require() [11:39] elliottcable: I’m working from the latest stable, whatever that is [11:39] elliottcable: 0.1.21 [11:39] jasondavies: but I haven't had any problems other than the ../ problem [11:39] jasondavies: ah, ok, that should be fine then [11:43] elliottcable: ahaha [11:43] elliottcable: omg [11:43] elliottcable: Jenna… is a genius. [11:43] elliottcable: Okay, gonna have to patch Node with this. [11:44] elliottcable: jasondavies: Why don’t you pull request me as well, so I can pile my fix on top of yours, and hand ryah_away a single require()-fixing commit>? [11:44] jasondavies: elliottcable: done :) [11:45] jasondavies: oops I pull requested ry again by accident [11:45] jasondavies: I also posted a message to the ML in case anyone else has the same problem [11:46] elliottcable: heh [11:46] elliottcable: jasondavies: You shouldn’t merge-pull from ry, unless I forget how he wants to handle master [11:46] elliottcable: jasondavies: probably rebase on top of his work, and force-push to your own master, before pull-requesting? I could be wrong, though. [11:46] jasondavies: ah, ok [11:46] elliottcable: ACTION generally goes out of his way to make it easy on the person hosting the authoratative upstream [11:46] elliottcable: (a habit born of Max Howell’s requirements for mxcl/Homebrew) [11:46] saikko has joined the channel [11:48] elliottcable: aw damn [11:48] elliottcable: nobody replied to my thread about the build system yet [11:48] elliottcable: ugh! [11:48] elliottcable: does nobody know how SCONS works? /-: [11:49] elliottcable: God, I love git! http://cld.ly/f2u65 [11:51] the_undefined: elliottcable: what cmd? [11:51] mediacoder: hmm..im also having problems with require, it seems [11:51] the_undefined: git log --graph ? [11:52] elliottcable: jasondavies: http://github.com/elliottcable/node/commits/master [11:52] elliottcable: the_undefined: http://github.com/elliottcable/dotfiles/blob/master/profile#L145 [11:53] elliottcable: jasondavies: You might want to force pull your master from me, and push to your upstream. It’s up to you. [11:53] elliottcable: jasondavies: I’ll pull request ryah_away once I fix this `return` issue [11:53] jasondavies: elliottcable: cheers, I'll do that [11:53] the_undefined: elliottcable: wow, somebody had some fun with git aliases :) [11:54] elliottcable: the_undefined: I use `glog` damn near as often as I use `gist`. I’m considering doing an Ncurses (well, Nfoiled) app to combine the two [11:54] elliottcable: the_undefined: Indeed I did! [11:54] elliottcable: the_undefined: My dotfiles are full of interesting things like that, if I do say so myself. Feel free to poke around, I know at least three other people are using them wholesale. (-: [11:58] micheil: elliottcable: nice twitter nick dude [11:58] elliottcable: micheil: huh? o_O [11:59] elliottcable: micheil: it’s the same as my nick here… [11:59] micheil: the eye's [11:59] elliottcable: oh, the ‘Real Name,’ hgahaha. yeah. [11:59] elliottcable: Unicode <3 [11:59] micheil: erm, rather twitter realname [11:59] elliottcable: So yeah, barring any objections… I want files in Node.js to support `return` in the root context. [12:00] elliottcable: That’s not useful in the context of `require()` and securable modules, because they discard the return value. [12:00] elliottcable: However, it *is* useful in `from`; and since it causes no *problems* under `require()`, I’m going to patch Node to not blow up when you do it. [12:00] elliottcable: Specifically, I’m going to wrap the anonymous function wrapper in `require()` one more time. [12:00] the_undefined: elliottcable: interesting stuff indeed [12:01] jasondavies: ACTION just discovered posix.sendfile(), woohoo [12:04] jasondavies: oh, just discovered "Don't use sendfile(). It's not ready for use - I'm addressing this in the socket refactor" [12:04] elliottcable: … hahaha [12:04] jasondavies: :P [12:04] jasondavies: a good reason it's not documented then :) [12:04] micheil: yeah, problem [12:04] micheil: *probably [12:06] malte has joined the channel [12:06] malte: the_undefined: Yep [12:06] the_undefined: malte: hey : ) [12:06] the_undefined: what's the status of your worker slaves? [12:07] the_undefined: Do they rely on any hacks in node itself? [12:07] the_undefined: Or could I just copy the files I need? [12:07] malte: I think I made them stable yesterday [12:07] malte: you just need worker.js [12:07] the_undefined: oh sweet [12:07] elliottcable: Oh hi, malte [12:08] elliottcable: Chatzilla? lol [12:08] the_undefined: I'm thinking of creating a new worker for each job I have, this will spawn a nice process right? [12:08] the_undefined: * a new [12:09] malte: right [12:09] the_undefined: alright, that will work [12:09] the_undefined: perfec [12:09] malte: but, of course, you can reuse workers [12:10] the_undefined: hm, I'm thinking of replacing the workers whenever the code updates [12:10] the_undefined: but for now I might go even simpler and always replace them [12:10] the_undefined: I'll have to see how tricky this gets [12:10] the_undefined: I just have to finally decouple transload.it's upload server from the encoding logic [12:11] the_undefined: otherwise I kill everybodies uploads when I deploy [12:11] the_undefined: ;) [12:11] the_undefined: malte: are you using the workers for a project? [12:11] elliottcable: Uh. [12:11] elliottcable: Somebody explain to me wtf: http://github.com/elliottcable/node/blob/721fc5dc688f32616a7dac8bec9b6708ba4186f1/src/node.js#L904-914 [12:11] elliottcable: Why is `__wrap__;` useful? [12:11] malte: Starting workers is somewhat expensive [12:11] elliottcable: This isn’t Ruby, there are no explicit returns… [12:11] elliottcable: that seems like an empty statement to me [12:11] the_undefined: malte: right, but you have to put it into perspective of encoding videos :) [12:12] the_undefined: to me some operations are cheap other people would frown upon *g* [12:12] malte: the_undefined: hehe [12:12] malte: I dont use it in my own projects yet,but will soon [12:12] micheil: the_undefined / malte: where does this worker slave live? [12:12] malte: Building a front end content integration router for tuifly.com :) [12:12] the_undefined: nice [12:13] the_undefined: I'll let you know if I find any issues [12:13] elliottcable: W.T.F. [12:14] malte: micheil: workers are just node process [12:14] malte: YOu talk to them via the web worker API: http://www.whatwg.org/specs/web-workers/current-work/ [12:14] micheil: link? [12:15] micheil: where's the project on github? [12:15] micheil: or where ever [12:15] elliottcable: micheil: it’s in his node repo I believe [12:15] elliottcable: micheil: lib/worker.js [12:15] elliottcable: iirc [12:16] micheil: elliottcable: what's his github username? [12:16] malte: http://github.com/cramforce/node/blob/master/lib/worker.js [12:16] elliottcable: WTF [12:16] elliottcable: okay THAT is wrong. [12:16] elliottcable: process.compile simply returns the last statement! [12:17] elliottcable: process.compile has *implicit return*. That is totally *not JS*. [12:17] elliottcable: O_O [12:17] micheil: hmm.. I'm wondering if I could use these worker threads for testing [12:26] the_undefined: elliottcable: what do you expect it to do? [12:27] elliottcable: the_undefined: work exactly as any *other* scope in JS [12:27] mahemoff has joined the channel [12:27] elliottcable: the_undefined: return undefined unless you use the `return` keyword [12:27] the_undefined: elliottcable: afaik process.compile behaves like eval(), but it allows you to give a filename / line offset for debugging purposes as a context. However process.compile does not pick up its surrounding context like evil does [12:28] the_undefined: elliottcable: well, eval does an implicit return [12:28] elliottcable: That’s just it, compile is nothing like eval [12:29] elliottcable: *because* eval is attached to its surrounding context [12:29] elliottcable: thus it makes sense for it to return whatever the last value of the statement is; that’s expected [12:29] elliottcable: you’d think that `var foo = (2 + 3);` would behave the same as `var foo = (eval("2 + 3"));` [12:29] the_undefined: elliottcable: actually it would rock if process.compile would pick up the context, it's just currently very hard with v8 [12:30] elliottcable: the_undefined: why would that rock? We have `eval()` for that. The *point* of process.compile is to do a lower-level compilation; it’s a new compilation unit, separate from the context it is called in [12:30] the_undefined: elliottcable: why do you get to define what process.compile is? [12:30] elliottcable: thus it, just like any new compilation unit of JS, including the first compilation unit, has no scope or anything, beyond the global scope [12:30] the_undefined: it's not a separate compilation unit [12:30] the_undefined: the global context is shared [12:30] elliottcable: the_undefined: I don’t get to define it, I’m just pointing out what *I* expect, and thus what I assume is most discoverable [12:31] elliottcable: the_undefined: all compilation units have the global context; that’s why it’s *global* context? [12:31] the_undefined: elliottcable: no, in v8 you can easily have many environment [12:31] the_undefined: which are truly separate [12:31] the_undefined: but alas, that also means they cannot communicate and share objects [12:32] elliottcable: understandable, but generally speaking, compilation units in a single interpreter should share the global context. That’s why it’s global. [12:32] the_undefined: elliottcable: sure [12:32] the_undefined: so what's wrong with returning the last statments value? [12:33] elliottcable: That’s not how anything else in JS, except `eval()`, works? [12:33] the_undefined: I find that quite pleasant and its what I expect [12:33] elliottcable: there is never a return value unless you use the `return` keyword, that’s a truth [12:33] elliottcable: yes, it’s what I expect, coming from Ruby, as well. But this isn’t Ruby, this is JS. [12:33] shfx has joined the channel [12:33] elliottcable: I simply expect consistency at that level. *shrugs* [12:33] the_undefined: you shouldn't try to think of compile() as different from eval(). It actually uses a very similar implementation internally [12:34] the_undefined: maybe evalInContext() would be a better name [12:34] the_undefined: but compile is what v8 calls it internally [12:34] the_undefined: so not sure if node is to blame here [12:34] the_undefined: you can file a bug with v8 :) [12:34] elliottcable: evalOutOfContext, maybe? [12:35] elliottcable: anyway, yeah, I’m specifically looking for something that acts like a function—giving me a new scope, but, unlike a function, it’s not within another external scope, other than the global one [12:35] elliottcable: that’s what I assume compile to be [12:35] elliottcable: but, it acts like a new scope, in *every way*, except that it has implicit returns [12:35] elliottcable: which no other scope in JS has [12:35] elliottcable: afaik [12:35] elliottcable: ACTION shrugs [12:35] elliottcable: I’m relatively new, I suppose. [12:36] elliottcable: Anyway, it’s irrelevant. Was just very of-fputting to go try to ‘fix’ the extra `; __wrap__;`, and then have everything break in unexpected ways simply due to the loss of a no-op statement [12:36] elliottcable: I generally believe no-op statements should have no effect in a language like JS, without implicit returns. [12:36] the_undefined: no-op? [12:37] elliottcable: no-op [12:37] elliottcable: `var gaz; "string"; gaz = 123` [12:37] elliottcable: `"string";` is a no-op statement in that example [12:37] elliottcable: It seems inconsistent for a statement which normally has absolutely no meaning, to suddenly have meaning, but only if it’s the last statement in a scope [12:37] the_undefined: ok [12:37] elliottcable: whereas an explicit `return aValue;` statement isn’t no-op; it has a very specific operation, the return operation [12:38] elliottcable: ya get me? [12:38] elliottcable: Okay, so, I finally dug out my problem. This is *very* odd. [12:38] elliottcable: stick this in the top of a file somewhere, and `require()` that file: [12:38] elliottcable: `if (typeof exports === 'undefined') { process.stdio.write("exports is undefined" + '\n') };` [12:39] elliottcable: it will print! Which makes no sense, because exports is very much not undefined; you can then go ahead and define values on it, work with it as normal… [12:39] elliottcable: O_O hooooooly crap. [12:41] the_undefined: is that a bug introduced with the recent changes maybe? [12:43] elliottcable: http://gist.github.com/260067 [12:44] elliottcable: No, I’m pretty sure this is a V8 bug, unless I *comnpletel7* misunderstand everything about JS [12:45] elliottcable: the_undefined: am I going insane? is that not *completely broken*? [12:48] bryanl has joined the channel [12:49] the_undefined: elliottcable: which statement prints? [12:49] the_undefined: which of them that is [12:58] elliottcable: the_undefined: the first [12:58] elliottcable: the_undefined: reducing it as much as possible, right now [12:58] elliottcable: the_undefined: then I’m going to test it in Chrome, because I’m too lazy to manually build a V8 shell [12:59] elliottcable: the_undefined: to ensure it’s ot something in Node’s impl of process.compile [12:59] jasondavies has joined the channel [13:00] malkomalko has joined the channel [13:01] elliottcable: duced it a bit… http://gist.github.com/260067 [13:01] elliottcable: still workin [13:05] elliottcable: Woah. [13:05] elliottcable: o_o [13:05] elliottcable: Same thing happens in Safari 4’s engine. [13:05] elliottcable: o_o [13:06] elliottcable: the_undefined: try it: http://gist.github.com/260067 [13:08] the_undefined: elliottcable: what's the difference between both samples? [13:09] elliottcable: the_undefined: the presence of the `var` keyword on line 6/7 [13:11] the_undefined: elliottcable: well, I think that is a know property about JS [13:11] the_undefined: let me figure out what its called [13:11] the_undefined: but it has to do how var works I think [13:12] the_undefined: it's probably the interpreter lookin for var statements first and reserving them [13:12] the_undefined: or sth [13:12] jan____: party. [13:13] the_undefined: can't find it [13:13] the_undefined: post it to stackoverflow, somebody will know what its called [13:13] elliottcable: jan____: at [13:14] elliottcable: the_undefined: hm [13:14] the_undefined: elliottcable: hm, seems to be limited to the eval statement so, right? [13:14] jan____: elliottcable: co-up.de [13:14] elliottcable: the_undefined: I’m not sure if it’s limited to an eval statement [13:14] elliottcable: the_undefined: the same thing happens in a node.compile [13:15] elliottcable: the_undefined: and I don’t really have a way to do it *outside* a eval() or node.compile() call… because all files go through one or the other, eventually, you see? [13:15] elliottcable: UGH PROCESS.COMPILE [13:15] elliottcable: stupid namespace change [13:17] the_undefined: actually, its the inner closure [13:19] the_undefined: elliottcable: https://gist.github.com/bea60b5164012782cb17 [13:19] the_undefined: this prints 'undefined' in firefox [13:19] jan____: the_undefined: we should get together for some hacking some time [13:19] the_undefined: if I remove the var exports, it doesn't [13:19] the_undefined: jan____: yeah! I wish all the cool co-working stuff wasn't in kreuzberg - takes me 30-40min to get there : | [13:20] jan____: the_undefined: you live in the wrong place I guess. where are you at? [13:20] the_undefined: elliottcable: if you remove the inner closure, the behavior goes back to "normal" as well [13:20] the_undefined: jan____: schönhauser allee [13:20] the_undefined: jan____: you? [13:21] jan____: the_undefined: between Herrmanplatz and Kottbusser Tor [13:21] the_undefined: jan____: yeah, thats a bit closer : ) [13:21] the_undefined: elliottcable: anyway, this is really interesting behavior [13:21] jan____: yea :) [13:21] jan____: the_undefined: u2 - u8 should get your here in 20 minutes [13:22] the_undefined: jan____: I see [13:22] the_undefined: how is the party, maybe I should come [13:22] jan____: haha, there is no party :) [13:22] jan____: we're just doing some weekendcoworking [13:24] the_undefined: jan____: what ya working on? Couch? [13:26] micheil has joined the channel [13:27] jan____: the_undefined: right now, yea [13:27] jan____: hope to do some awesome hacking later [13:27] jan____: bbiab [13:28] elliottcable: http://stackoverflow.com/questions/1932910/confusing-operation-of-javascript-var-keyword [13:28] elliottcable: there we go [13:28] elliottcable: Feel free to respond if you like [13:29] the_undefined: elliottcable: any reason for not using my simplified version? [13:29] the_undefined: I think its much clearer [13:29] elliottcable: the_undefined: didn’t notice it. [13:29] elliottcable: the_undefined: link? [13:30] the_undefined: elliottcable: https://gist.github.com/bea60b5164012782cb17 [13:30] elliottcable: private? o_O [13:30] elliottcable: also, you should ahve forked d-: [13:30] the_undefined: hm [13:30] the_undefined: elliottcable: http://gist.github.com/260078 [13:31] the_undefined: try that one [13:32] elliottcable: the_undefined: added [13:33] Yuffster has joined the channel [14:02] micheil: has hassox left? [14:03] micheil: well, this is my progress so far on a test runner, https://gist.github.com/91eff2f48ede3cac59c6 [14:03] micheil: it's not awesome yet, but it works none the less [14:05] elliottcable: okay, the_undefined, jan____: ;version [14:05] elliottcable: oops [14:05] micheil: I'm still working on properly handling errors and stuff like that, but I think it's an O.K. proff of concept [14:05] micheil: proof* [14:05] elliottcable: the_undefined, jan____: It works, because I totally did not understand locals scoping: http://stackoverflow.com/questions/1932910/confusing-operation-of-javascript-var-keyword [14:05] jan____: why am I in this discussion? :) [14:06] hornbeck: because everyone loves you [14:07] shfx: http://stewdio.org/pong/ [14:07] elliottcable: jan____: you were replying to the_undefined [14:07] elliottcable: dude, it’s hornbeck [14:07] elliottcable: hornbeck: I remember arguing with you about harleys d-: [14:07] hornbeck: heh [14:08] jan____: elliottcable: but not on this topic :) [14:08] elliottcable: jan____: my bad, then [14:08] jan____: :) [14:09] elliottcable: Okay, then I’m adding a new stylistic constraint to my personal set. [14:09] elliottcable: If I’m going to scope a variable into my locals, I’m *always* going to do so at the very start of the function. [14:09] elliottcable: That way I can *pretend* it’s all proper and procedural. >,> [14:11] micheil: shfx: hate to say this but: "I don't git it." [14:11] micheil: *get [14:15] elliottcable: micheil: hit 'p' [14:15] jasondavies has joined the channel [14:15] michaelk^ has joined the channel [14:16] micheil: elliottcable: duh, then what. [14:16] elliottcable: micheil: … play? [14:17] elliottcable: micheil: http://cld.ly/2du6o [14:18] micheil: oh, right [14:18] micheil: I just get them in tabs >_> [14:18] elliottcable: … hahahaha [14:18] micheil: ugh... but kinda funny: http://benalman.com/news/2009/12/john-resig-javascripts-chuck-norris/ [14:20] elliottcable: ugh. [14:21] micheil: still, they are a good spin off on chuck norris jokes [14:21] mediacoder: whos john resig, when we have ryah :-) [14:22] elliottcable: lol [14:22] micheil: mediacoder: true [14:23] micheil: john resig is nothing compared to the ninja powers of dojo's dustin machi [14:24] micheil: wow, check out that rather impressive FTP server on the ML [14:25] mediacoder: kool [14:26] micheil: it looks rather impressive, and rather nice [14:26] mediacoder: is relative require broken for anyone else, besides me? [14:27] micheil: mediacoder: afaik, no [14:27] micheil: mediacoder: but I'm on os x 10.6.2 and HEAD [14:27] micheil: or, HEAD as to last night [14:28] mediacoder: looks like isaacs changes borked some stuff for me [14:48] bry has joined the channel [14:51] elliottcable: Okay, everybody listening, please weigh in. Which do you prefer? http://gist.github.com/260105 [14:52] soveran has joined the channel [14:53] michaelk^: #6 [14:56] shfx: #6 [14:56] shfx: duh [14:56] shfx: ;) [14:57] elliottcable: so odd. [14:57] elliottcable: I must be broken. I think #6 is by far, the least readable, the least scanable, and the most ugly. [14:58] michaelk^: ;) [14:58] elliottcable: Yet, (and this lightning poll was taken over multiple mediums) the results are overwhelmingly pro-#6 [14:58] michaelk^: i think the other ones look totally crappy and there's a reason why #6 is pretty much the standard in every language with curly braces [14:58] michaelk^: but it probably depends on where you come from [15:00] bryanl_ has joined the channel [15:00] elliottcable: See, that’s just it. I’ve been reading and writing code like #6 for years; I’ve *always* thought it ridiculously ugly and unreadable. [15:01] elliottcable: I think it’s a standard because it’s a standard, not because it’s actually readable. [15:01] elliottcable: But, the fact that more than 20 people have told me #6 in the last five minutes, makes me wonder. [15:01] elliottcable: I would generally assume that’s due to them being pre-programmed by having written code that way for so long, but *I* obviously haven’t been… do they truely prefer it? And if so, why? [15:02] michaelk^: strange, i think when you used #6 for years it's very easy to scan [15:02] michaelk^: you see the three parts easily because they are separated by enough space [15:11] elliottcable: inimino: Why’d you fork that? o_O [15:11] elliottcable: inimino: lol, and it’s your first gist *ever*/ [15:11] elliottcable: inimino: hell, did you just join to fork it?! [15:11] mediacoder: hehe [15:14] erichocean: ACTION is investigating embedding Redis in node.js [15:14] elliottcable: elliottcable: Embedding? [15:15] erichocean: yeah, so it wouldn't use a network connection or require callbacks [15:15] elliottcable: … what? erichocean* ^^ [15:15] elliottcable: haha [15:15] elliottcable: erichocean: Um. You mean… woah. Interesting. [15:16] erichocean: it's single-threaded, and the API is straigtforward [15:16] elliottcable: erichocean: Does Salvatore support that sort of application of Redis? [15:16] erichocean: I don't think so...yet ;-) [15:16] elliottcable: erichocean: Just OOC; he seems to intend it as a very light server. [15:16] dnolen has joined the channel [15:16] erichocean: ...which makes it easy to embed, no? [15:17] inimino: elliottcable: http://gist.github.com/260115 [15:18] inimino: elliottcable: just to show my alternatives [15:19] elliottcable: inimino: For #7, removing the braces is not an option, I have an absolute rule against ever doing that; [15:19] elliottcable: inimino: #8, the examples were badly written, the if/then is *not* intended to be the only code in the scope [15:19] elliottcable: inimino: and #9, yeah, that’s the obvious replacement; it was a contrived example [15:20] inimino: absolute rules can be changed :-) [15:20] elliottcable: hah [15:20] elliottcable: they can be broken, not changed [15:20] elliottcable: d-: [15:20] erichocean: the main weird thing is that redis forks a bunch of children for async IO at startup and then communicates with them via pipes [15:20] inimino: anyway, the point of #8 is to move the closing brace [15:21] elliottcable: inimino: yeah, I definately do that, all the time, but I updated the examples, so you’d see you can’t do that: http://gist.github.com/260105 [15:21] elliottcable: inimino: so you’d choose #2 over #1? [15:22] bryanl has joined the channel [15:22] erichocean: #6 +1 [15:22] inimino: elliottcable: of the ones you had originally, I prefer 2, 3, 1, 4, 5, and 6 in that order [15:23] elliottcable: inimino: A man after my own heart (except I prefer #1)! [15:23] elliottcable: Finally, someone who puts #6 last instead of first >,> [15:23] mediacoder: #6 [15:24] erichocean: in #6, the trailing semicolon is unnecessary [15:24] erichocean: line 9 [15:24] elliottcable: erichocean: I realize that. [15:24] erichocean: also, I would add semi-colons to the code itself [15:24] elliottcable: erichocean: that’s true of all of them. Another incontrovertible personal rule. [15:24] erichocean: well, I work on SproutCore [15:25] Connorhd: you put a semicolon at the end of if blocks as a personal rule? [15:25] jasondavies: mediacoder: relative requires are indeed broken, I pushed a fix to my github [15:25] elliottcable: erichocean: I religiously utilize semicolons after *every single disparate statement*, within a scope where there are multiple such disparate statements; and I *never* use a semicolon where there is only a single statement [15:25] jan____: erichocean: have you seen awesome? [15:25] mediacoder: jasondavies: ah, great.. ill have a look, thanks [15:25] erichocean: jan____: long time! [15:26] erichocean: how's couch? [15:26] elliottcable: erichocean: And what about SproutCore? [15:26] jan____: erichocean: couch's rockin', we just got funding for keeping it that way for some time :) [15:26] erichocean: sweet! [15:26] inimino: elliottcable: the reason I don't put 1 first is because I use indentation a little differently, the if and else are at the same level and to me should be aligned [15:27] jan____: erichocean: http://github.com/janl/awesome <- redis in node [15:27] elliottcable: inimino: Makes sense. [15:27] erichocean: jan____: yeah, I saw that [15:27] jan____: erichocean: you want that :D [15:28] erichocean: jan____: http://github.com/janl/awesome/blob/master/store.js#L160 [15:29] alex-desktop has joined the channel [15:29] brandon_beacher has joined the channel [15:29] elliottcable: 77 nicks! [15:29] jan____: erichocean: yes? [15:29] elliottcable: whaaa [15:30] jan____: elliottcable: we were up to 95 last week :) [15:30] erichocean: jan____: I needed the persistence stuff from Redis [15:30] elliottcable: I don’t remember that >,> [15:30] erichocean: elliottcable: >101 [15:30] elliottcable: This is the single most beautiful piece of music ever composed. [15:30] elliottcable: http://listen.grooveshark.com/#/playlist/Beethoven+S+Sonata+No+8+In+C+Minor/8060825 [15:30] jan____: erichocean: heh, yeah, that is still not fully implemented. but SAVE should "just work" [15:30] elliottcable: Hell, I’m going to go as far as saying that it’s the culimating achievement of the human race, to date. [15:31] jan____: erichocean: I mean, adding to Awesome should be easier that trying to mess with embedding redis [15:31] erichocean: jan____: you're probably write [15:31] erichocean: right [15:31] inimino: rite [15:31] erichocean: ./msg jan____ hey [15:31] elliottcable: Especially the second movement… [15:35] micheil: elliottcable: Beethoven reminds me of A Clockwork Orange [15:35] elliottcable: micheil: why? [15:35] elliottcable: micheil: I can’t remember *anything* from that movie [15:36] elliottcable: (I typed ‘I can’t remember *anything* from that Redis’ first, and I have no idea why o_O) [15:36] micheil: because that's what the main character in that movie listened to after raping and pilaging people [15:36] elliottcable: hahahaha [15:36] elliottcable: AWESOME [15:36] elliottcable: That rapist had some serious taste. [15:36] micheil: heh hhe [15:36] elliottcable: Which movement? [15:37] micheil: well, I don't know if it was rape, or whether it was nasel mask intrustion [15:37] micheil: *intrusion [15:37] micheil: http://en.wikipedia.org/wiki/A_clockwork_orange [15:44] elliottcable: FFFF awesome. [15:44] elliottcable: This solved a ton of my problems. [15:45] elliottcable: G’damn. I’m starting to get tired, will have to sleep soon, but… yeah. So, so much of my stuff is going to go smoothly now. [15:51] binary42 has joined the channel [16:06] elliottcable: Odd. [16:06] elliottcable: Reducing and passing a Promise doesn’t work. o_O [16:07] elliottcable: But if I replace that with a nested assertion, it works fine. >,> [16:13] elliottcable: Uh. [16:13] elliottcable: Is the pathModule exposed in any official way? [16:14] elliottcable: I’d really like to use path.join, is that valid/legal/#agoodidea? [16:29] elliottcable: Ugh, it’s not exposed. [16:29] elliottcable: ryah_away: )-: Why isn’t pathModule exposed to us in any way? It has some useful stuff. That I sort of need now. [16:32] jamiew_ has joined the channel [16:47] the_undefined has joined the channel [16:51] brandon_beacher_ has joined the channel [16:53] dnolen has joined the channel [16:54] scudco has joined the channel [16:56] dnolen has left the channel [17:01] dnolen has joined the channel [17:07] eviltwin has joined the channel [17:20] elliottcable: Woah. [17:20] elliottcable: I finally sat down and wrote out what code I have to write / projects I have to complete in the next few years: http://gist.github.com/260152 [17:20] elliottcable: That is a … discouragingly large quantity of code. [17:21] inimino: "stomach" [17:22] inimino: elliottcable: I have a file almost exactly like this, interesting [17:23] inimino: (in purpose and layout, not content) [17:23] Connorhd: writing todo lists is the best way to procrastinate about actually doing things �_� [17:26] elliottcable: heh [17:26] elliottcable: Connorhd: Actually, I’m feeling a lot more driven now that I’ve actually taken that map out of my head, and put it onto paper. [17:26] inimino: I wouldn't be able to keep track of my projects and their dependencies without it [17:27] elliottcable: Connorhd: I have this feeling that it is going to feel *ridiculously great* to cross projects off of that list as ‘done enough to move onto the next one’ [17:27] elliottcable: inimino: Stomache. [17:27] Connorhd: maybe its just me thats lazy then ;) [17:27] elliottcable: inimino: When I am ridiculously rich (which is obviously going to happen, when somebody pays me to write all that code! hah.), I’m going to fricking bribe whatever comittee I have to, to get ‘stomach’ officially re-spelled as ‘stomache.’ [17:27] inimino: http://www.urbandictionary.com/define.php?term=stomache [17:27] inimino: hehe [17:28] erichocean: bah, GnuTLS leaks memory [17:28] erichocean: :/ [17:28] jchris has joined the channel [17:28] elliottcable: inimino: And I’ll *also* bribe the Urban Dictionary peeps to permenantly lock that definition at 105 up, 15,185 down. [17:29] erichocean: http://lists.adiscon.net/pipermail/rsyslog/2009-November/003064.html [17:29] inimino: hehe [17:30] elliottcable: I should graph my Ruby projects like that. [17:30] elliottcable: Unfortunately, the entire freaking mind-tree of dependencies is on epic-hold, because I put everything Ruby-related aside for JS stuff. [17:32] inimino: heh [17:34] elliottcable: My stomache hurts ridiculously bad, I really should eat. Somehow, I’m not hungry, though. I just want to hack. [17:34] elliottcable: I can’t bear to stop hacking long enough to close the laptop and take it to a diner. [17:36] johan-s has joined the channel [17:37] inimino: ACTION hands elliottcable a small pyramid of mandarin oranges supported by a copy of Merriam-Webster's [17:38] the_undefined: has anybody else noticed that exceptions are totally broken in HEAD? [17:38] the_undefined: seems like ryan killed all of them here: http://github.com/ry/node/commit/bfa36136dac787793bc5106da57cccbb8db1ce14 [17:40] elliottcable: the_undefined: yeah, I have no idea WTF that was about. [17:40] elliottcable: the_undefined: Really odd for him to add that. Seems unnecessary, even wrong, to me. [17:41] the_undefined: well, I guess it makes sense to be able to catch errors in module definitions [17:41] the_undefined: but if you don't, they must propagate up [17:41] the_undefined: I'll post a patch [17:41] elliottcable: the_undefined: I don’t know about you, but I expect throwing an exception to, uh, throw an exception. I only expect an errback from a require() promise *if the node.compile fails* [17:42] the_undefined: elliottcable: good point [17:42] inimino: it looks very broken to me too [17:43] inimino: for the same reason [17:43] inimino: but I don't know what listeners there are on loadPromise, maybe it's re-thrown [17:43] Nailor has left the channel [17:44] elliottcable: Nope. [17:44] elliottcable: Which is the obvious solution, *if* we leave it that way. [17:44] elliottcable: But I think that should be scrapped anyway. [17:44] inimino: hm, no it seems it's just dropped on the floor [17:45] elliottcable: inimino, the_undefined, agreed? [17:45] the_undefined: nope, rethrowing sucks - it will mess up the stacktrace [17:45] the_undefined: I just dried it [17:45] the_undefined: * tried [17:45] inimino: yeah I think that's broken as it stands or with rethrowing [17:45] elliottcable: (agreed that exceptions in modules should raise exceptions, and only actual errors *in loading the file* should errback on the require() promise) [17:45] elliottcable: the_undefined: No, I would suggest only rethrowing *on the root require* [17:46] the_undefined: even then, it sucks [17:46] elliottcable: the_undefined: that is, the very first one, when you `node foo.js` [17:46] the_undefined: the stacktrace breaks [17:46] the_undefined: hm [17:46] the_undefined: well stack traces are somewhat broken anyway [17:46] inimino: I can see arguments for both [17:47] inimino: I actually have some module loading code that catches errors and handles them [17:47] elliottcable: speaking of stacktraces [17:47] elliottcable: is there any way we can fix those from ‘within node,’ so to speak? [17:47] inimino: but I think it's bad for the core require() to do it [17:48] elliottcable: V8’s stack traces are *completly useless*, to some extent, for normal Node.js code [17:48] elliottcable: and even *more* so for my poopy.js code, because there are no sensible constructors for it to use as the ‘class’ [17:48] elliottcable: the problem is that traditional stack traces are very classist in concept… and also very procedural. [17:48] elliottcable: They don’t help with debugging evented code, nor prototypal code, at all [17:49] elliottcable: combine Node.js (evented) with poopy.js (prototypal), and they come out as a clusterfuck of completely useless nothing >,> [17:49] elliottcable: I’ve been trying to think of some way to fix them, but I’m not really sure what the way is >,> [17:50] the_undefined: yeah, I'm not happy with them easier [17:50] the_undefined: but so far they've been helpful to me [17:50] inimino: submit patches to V8 [17:50] elliottcable: the only useful part, AFAICT, is the line numbers. Pretty much everything else is unreliable. [17:51] inimino: there are heuristics that assign names to anonymous functions, etc [17:51] elliottcable: inimino: Meh, any sort of patches I could provide would be very event/prototype oriented; That’s not exactly optimal for generalized V8 use. [17:51] elliottcable: I’m thinking about some sort of system to sit on *top* of those, catch errors, and print out useful event and prototype data [17:51] elliottcable: but really not sure of any specifics at the moment [17:57] sudoer has joined the channel [17:57] the_undefined: http://groups.google.com/group/nodejs/browse_thread/thread/1d13cef7ad136201 [17:57] the_undefined: lets see what ryan thinks [17:57] the_undefined: I included a sample of the changed stack trace output [17:58] jed has joined the channel [18:02] erichocean: it looks like TLS/HTTP overhead in node.js is about 24KB per connection [18:07] elliottcable: erichocean: Bandwidth or memory? [18:07] erichocean: memory [18:10] elliottcable: was gonna say… lol [18:10] elliottcable: I wonder if this is too DRY… [18:15] bentomas has joined the channel [18:24] isaacs has joined the channel [18:25] cloudhead has joined the channel [18:29] elliottcable: cloudhead! [18:29] elliottcable: cloudhead: good morning. [18:30] elliottcable: I’ve gotta stop doing the ‘person! \n person: hi’ thing. [18:31] the_undefined: is anybody here using something other than git? [18:31] the_undefined: I'm becoming more and more unhappy with it [18:31] sixtus42: the_undefined: what's the issue? tried hg yet? [18:31] the_undefined: sixtus42: haven't tried hg yet, no. [18:32] the_undefined: my issue is that I have a rebase conflict, and all I want are the sha1's of the 2 commits that are clashing [18:32] the_undefined: seems like its impossible [18:32] the_undefined: I just want to be able to look at both of those commits (with messages) side by side and understand what happens [18:32] the_undefined: the conflict markers are way too useless right now [18:34] cloudhead: elliottcable: ahoi [18:34] sixtus42: mmmh, my git literacy has not reached a level where I could help you [18:34] cloudhead: the_undefined: you want a diff? [18:36] the_undefined: cloudhead: Yes [18:36] the_undefined: but I want to see the two commits [18:37] cloudhead: did you try `git show MERGE_HEAD` [18:37] cloudhead: and `git show HEAD` ? [18:38] the_undefined: cloudhead: I don't think MERGE_HEAD is set for rebase [18:38] the_undefined: > fatal: ambiguous argument 'MERGE_HEAD': unknown revision or path not in the working tree. [18:38] cloudhead: hmm [18:38] the_undefined: anyway, the people in #git can't tell me either [18:38] cloudhead: crazy [18:39] the_undefined: git would probably have to find the first parent commit that my patch would apply to cleanly [18:39] the_undefined: but I blame git for that [18:39] cloudhead: ah I think I see what you're trying to do [18:39] elliottcable: what? [18:40] elliottcable: the_undefined: it should tell you while it’s rebasing. [18:40] cloudhead: the thing is, I don't think it's that simple [18:40] cloudhead: it could be several commits [18:40] elliottcable: the_undefined: Look at the last ‘Applying: ’ message, grep the log for that, grab the SHA1, `git show`. [18:40] cloudhead: within one merge conflict [18:40] elliottcable: the_undefined: not the cleanest/most-automated-possible solution, but it works [18:40] elliottcable: cloudhead: so, yeah [18:40] elliottcable: cloudhead: had a breakthrough last night, `from` is actually quite damn nearly done [18:40] the_undefined: elliottcable: it shows me the "subject" of the patch it applies, but not the sha1 [18:40] bentomas: the_undefined: do you have a log of your conversation with Kris yesterday (today?), I'm curious to read it but the commonjs irc log hasn't been working the last couple days [18:40] cloudhead: elliottcable: nice [18:41] elliottcable: cloudhead: like, I have to implement resolvePackage, but… all of the confusing infrastructure’s finally in place [18:41] cloudhead: : D [18:41] cloudhead: going for brkfst, I read your OSS plan for the year btw [18:41] cloudhead: fun stuff [18:41] cloudhead: hehe [18:42] elliottcable: the_undefined: `man 7 gitdiffcore`, read up on pickaxe, and `git log -S ""` [18:42] cloudhead: especially reading it from SE to NW [18:42] jan____: the_undefined: maybe http://progit.org/book/ch3-6.html helps? [18:42] elliottcable: cloudhead: )-: [18:42] elliottcable: cloudhead: You are now contractually bound to stop doing whatever you to do make Real Life Money™, and instead bum food off of people and spend 24/7 helping me with this shit. [18:42] cloudhead: lots of work for you [18:42] elliottcable: cloudhead: >,> [18:42] the_undefined: bentomas: I don't think I do [18:42] elliottcable: cloudhead: lol [18:42] cloudhead: haha [18:43] cloudhead: k bbl! [18:43] elliottcable: cloudhead: o7 [18:43] gwoo: did anyone see the etherpad release? [18:44] elliottcable: gwoo: I did [18:44] gwoo: nice [18:44] elliottcable: gwoo: Didn’t actually look through the source much, though [18:44] elliottcable: ACTION is busy [18:44] gwoo: i was just looking at it [18:44] elliottcable: cf. http://gist.github.com/260152 [18:44] elliottcable: shit [18:44] gwoo: and there might be some useful utilities [18:44] elliottcable: I tried to Spotlight ‘cf’ [18:44] elliottcable: and ended up opening OFXMLCFXMLTreeSink.h in Xcode. [19:22] bryanl has joined the channel [19:24] elliottcable: WHAT [19:24] the_undefined_ has joined the channel [19:34] elliottcable: Hm. [19:38] elliottcable: hm. [19:39] the_undefined_: oh boy, modules are so broken :( [19:39] elliottcable: hahah the_undefined_. Finally someone agrees with me d-: [19:40] the_undefined_: elliottcable: lol, I'm pretty sure my definition of broken is different from yours ;) [19:40] elliottcable: haha [19:40] elliottcable: almost certainly )-: [19:40] elliottcable: )-’: [19:41] the_undefined_: I habe a failing unit test for relative module inclusion after rebasing my delegate branch with master [19:41] the_undefined_: and I cannot explain why the same test isn't failing on master [19:41] the_undefined_: which means that either I have a bug in Deferreds, or somebody build his new stuff on a bug in the old promises which is now gone [19:42] the_undefined_: I want people to rebase with my branch from now on ... would make life so much easier for me ;) [19:42] jan____: the_undefined_: haha, "I habe" :) [19:45] the_undefined_: jan____: :) [19:46] mediacoder: i' hoab to eb exact [19:48] the_undefined_: ok, time to drown my pain in reasonable amounts of quality booze - *sigh* [19:48] mediacoder: the_undefined_: for me relative require is borked on the master (also jasondavies fix doesnt help me) [19:49] the_undefined_: mediacoder: ok, but does your test for it pass? [19:49] the_undefined_: test-module-loading.js ? [19:49] the_undefined_: it seems like it shouldn't pass, but it does on master [19:49] mediacoder: hm, didnt run the tests [19:49] the_undefined_: but my deferred branch finds the issue [19:49] the_undefined_: :| [19:50] mediacoder: im not sure, but ./../ is ok, but it chokes on multiple ../../../ [19:50] the_undefined_: mediacoder: what about the test case, does that run for you? [19:51] mediacoder: the_undefined_: yea, they pass [19:52] the_undefined_: bloody madness [19:52] alex-desktop: hello [19:52] alex-desktop: I'm trying to call: var result = sys.exec("node testing/run_test.js tests/some_test.js").wait(); [19:53] alex-desktop: but it errors. [19:53] alex-desktop: can anyone help? [19:53] isaacs has joined the channel [19:53] the_undefined_: LOL [19:53] the_undefined_: I figured it out [19:53] the_undefined_: damn, I'm an idiot [19:53] the_undefined_: mediacoder: all tests on master pass [19:53] the_undefined_: they cannot fail anymore since ryan disabled exceptions globally [19:53] the_undefined_: FUCK [19:54] mediacoder: heh [19:56] mikeal has joined the channel [19:56] aguynamedben has joined the channel [20:00] alex-desktop: never mind... I think I might have figured it out [20:08] elliottcable: hahahahahahaha the_undefined_ [20:08] elliottcable: that’s a pretty great error. [20:08] elliottcable: ALL TESTS PASS… BECAUSE EXCEPTIONS ARE BROKEN [20:08] elliottcable: hahahahahahahaha [20:08] elliottcable: the_undefined_: What’s your Twitter name, so I can tweet about that shit? d-: [20:13] isaacs has joined the channel [20:14] saimon_ has joined the channel [20:17] the_undefined_: elliottcable: @felixge [20:19] alex-desktop: really cool (though possibly somewhat dangerous): running each test simultaneously in separate processes using node.js both as the controller and individual test runners. [20:20] inimino: heh [20:20] alex-desktop: dangerous, because I'm pretty sure there is a process limit, so it may not work with a ton of tests :) [20:20] alex-desktop: (but seeing all 8 cores light up for the 1 second it takes is pretty neat) [20:22] elliottcable: alex-desktop: I’d ship out worker processes. [20:22] elliottcable: alex-desktop: which is what I’ll probably have grizzly do, for the async runner (perhaps through worker.js?) [20:23] bentomas: elliotcable: grizzly? [20:23] bentomas: (what's that?) [20:23] alex-desktop: elliottcable: yeah, that would be neat [20:23] elliottcable: bentomas: JS/Node.js port/implementation of the concepts behid http://github.com/elliottcable/Speck [20:23] elliottcable: bentomas: it’s a very … different … ‘testing’ framework. [20:24] bentomas: elliotcable: huh. do you have any examples? [20:24] elliottcable: bentomas: I say ‘testing’ in quotes, because a ‘test framework’ generally means `assertTrue()` and such, which has no relation to grizzly/Speck. But it’s also quite far, possibly farther, from being a ‘specification’ library, a lá Rspec [20:24] elliottcable: bentomas: Not really. Dropped Ruby (and thus Speck) when Speck was about 98% complete, but before ever doing any documentation/promoting of it [20:25] elliottcable: bentomas: I’ll certainly have some documentation and examples for grizzly, though. I’ll get to it soon enough (see http://gist.github.com/260152#LID40) [20:27] bentomas: bentomas: huh. interesting! [20:30] isaacs: ryah_away: hey, looks like throwing an error in a module doesn't print out a stack trace any more. [20:31] the_undefined_: isaacs: http://groups.google.com/group/nodejs/browse_thread/thread/1d13cef7ad136201 [20:31] the_undefined_: isaacs: I hope you were lucky enough to figure out what was going on before wasting half of your day ;) [20:31] isaacs: hehe [20:32] isaacs: yeah, i was like, "that's odd, this test should totally not be working." and then put a try/catch in there [20:32] the_undefined_: ;) [20:32] RayMorgan has joined the channel [20:32] the_undefined_: isaacs: yeah, you broke relative modules :) [20:33] isaacs: well, it looks like not all my changes got merged into ry's master. [20:33] the_undefined_: oh [20:33] the_undefined_: well, it seems like ryan ran the test suite while exceptions were broken, so who knows ;) [20:33] isaacs: heheh [20:33] isaacs: i'm trying to unravel it now. [20:34] isaacs: i know what changed, and it looks like the try/catch which makes the loadPromise emit failure in node.js should check whether or not its the root module, and rethrow in that case. [20:35] isaacs: breaking exceptions is pretty dangerous! [20:35] the_undefined_: isaacs: that's what my patch does [20:35] isaacs: it's like not being able to feel pain, and then walking into a burning building. [20:35] the_undefined_: I guess it would be even better if the main module wouldn't be invoked in a try..catch to begin with [20:36] the_undefined_: but I had too much pain in my fingers to type that out by the time I found the issue [20:36] the_undefined_: :D [20:36] isaacs: the_undefined_: you're felixge? [20:36] the_undefined_: isaacs: yes [20:36] isaacs: ahh, neat. [20:36] isaacs: that's like finding out that two people you know are the same person ^_^ [20:36] the_undefined_: isaacs: :D [20:36] the_undefined_: isaacs: I might change my IRC nick [20:36] isaacs: or your gh nick [20:37] isaacs: "the_undefined" is pretty cool [20:37] the_undefined_: yeah [20:37] the_undefined_: but I stole it from somebody else when I was like 13 [20:37] the_undefined_: and I'm afraid he'll hunt me down some day [20:37] isaacs: haha [20:37] the_undefined_: (this wasn't in IRC, some other chat) [20:38] isaacs: how do you run all the tests in the suite? just node test*.js? [20:38] the_undefined_: isaacs: make test [20:38] isaacs: oic [20:38] jan____: the_undefined_: "undef"'d be cool [20:38] jan____: or maybe just felixge :) [20:39] mediacoder: the_undefelixge_ [20:40] Hannan has joined the channel [20:40] isaacs: i've been isaacs everywhere that coding was concerned, from college, through every job i've had, and on gh. [20:45] isaacs: ack, found it. [20:45] isaacs: yeah, i broke require("../foo") [20:45] isaacs: but require("../foo/bar") still worked [20:46] mediacoder: multiple ../../ also borked [20:46] isaacs: ok, this is gonna take a proper uri parser, not just a clever little regexp [20:47] isaacs: i'd like not to reproduce the logic between path and uri, though [20:48] isaacs: mediacoder: right, because it tries to eliminate the parent dir, which itslef is another ".." so that breaks. [20:49] mediacoder: ah, ok [20:58] isaacs: i'm adding some tests, and abstracting that bit out to require("path").normalize, so that the uri module can use it, too, without being wet. [20:58] bentomas has left the channel [21:14] elliottcable: blah [21:14] elliottcable: the_undefined_: go with felixge, dude. [21:14] elliottcable: the_undefined_: unified nick ftw. [21:14] gwoo: ACTION agrees [21:14] elliottcable: the_undefined_: I’m ‘elliottcable’ *everywhere* (…except Ebay. I don’t even know how ‘elliottcable’ got taken there, I’m ‘elliottcabe_name’ instead, which pisses me off) [21:15] elliottcable: the_undefined_: unless the place uses address notation, such as JIDs, email, MSN, AIM, etc… in which case, I’m ‘me@ell.io’ [21:15] mediacoder: elliottcable: hehe, what about your "whateverlibrarian" experiment? :-P [21:15] elliottcable: mediacoder: That is not to be spoken of. >,> [21:15] mediacoder: hehe [21:17] sztanphet has joined the channel [21:19] felixge has joined the channel [21:19] ryanmcgrath has joined the channel [21:20] ryanmcgrath: Hey, has anyone written an "install module" style script for a Node project? [21:21] ryanmcgrath: e.g, I'm trying to figure out where I wanna copy files to, create symlinks, etc [21:22] felixge has joined the channel [21:22] felixge: so [21:22] felixge: I guess I have been defined [21:22] felixge: * gotten [21:24] elliottcable: felixge: woo! [21:24] elliottcable: ryanmcgrath: What do you mean? [21:24] elliottcable: ryanmcgrath: I was planning on writing a ‘package manager’ (install system) for `from` [21:24] ryanmcgrath: Let's say I wanna create something like "python django-admin.py startproject ", but for this framework I built around Node [21:24] elliottcable: ryanmcgrath: But first, I have to get somebody to answer http://groups.google.com/group/nodejs/browse_thread/thread/cf5ae41c5add16ac [21:25] ryanmcgrath: I want the core dependencies (server, etc) abstracted out of the full project [21:25] elliottcable: ryanmcgrath: Ugh, please, whatever you do, don’t copy *any* of Python’s install systems. [21:25] mikeal has joined the channel [21:25] elliottcable: ryanmcgrath: easy_install and all that crap are the single most annoying hell I’ve ever gone through. [21:25] ryanmcgrath: Lol, I'm not copying those shitty systems, relax. [21:25] ryanmcgrath: I just mean in the sense of Django [21:25] ryanmcgrath: Rails has something similar [21:25] elliottcable: ryanmcgrath: *including* hacking MediaWiki’s parser.php, and Ruby’s parse.y [21:25] ryanmcgrath: Basically, "clone me a new project, yo" [21:25] elliottcable: ryanmcgrath: I getcha, #justsayin d-: [21:26] elliottcable: wtf “if (!(x)) throw new Error(msg || "assertion error");” [21:26] ryanmcgrath: But so yeah, has anyone else been through this? [21:27] elliottcable: the_undefined: nooo )-: [21:27] the_undefined: elliottcable: trying to get my account registered [21:27] the_undefined: having issues [21:27] elliottcable: `typeof felixge !== 'undefined'`! [21:28] the_undefined: felixge: could you please stop that? [21:28] the_undefined: thx [21:28] felixge: sorry [21:28] felixge: aw great. [21:28] elliottcable: much better [21:30] sztanphet has joined the channel [21:31] the_undefined has joined the channel [21:32] felixge has joined the channel [21:33] felixge: ok [21:33] felixge: I guess this is it [21:33] felixge: elliottcable: can you try to be me again? [21:34] ryanmcgrath: Mmm, well, I guess I'm just gonna have this move my engine to the proper location, and create a symlink that gets referenced from that. [21:34] elliottcable: felixge_: I’m in ~70 channels, I already had one dude yell at me for the superfluous nick changes >,> [21:34] elliottcable: felixge_: hahahahaha [21:34] elliottcable: felixge_: The, like, *only downside* (other than gigs of logs) of massive lurking. I can’t participate easily in nick change battles )-: [21:35] elliottcable: felixge_: which are at least 8% of the fun of IRC! [21:35] Pilate: before you hit the age of 18, maybe [21:35] felixge: elliottcable: ok - maybe you want to rethink that 70 channel thing [21:36] elliottcable: Pilate: 20, and proud of lovin’ his nick changes. [21:36] elliottcable: What the hell. `process.assert(self._blocking == false);` is failing. o_O [21:37] elliottcable: woah. [21:37] elliottcable: If I have a promise that never emits, I get that weird-ass error. [21:38] elliottcable: felixge: meh, it’s more like 65 right now. [21:38] elliottcable: felixge: /whois elliottcable [21:38] elliottcable: felixge: I’m not sure how Freenode handles invisibility, so I don’t know what’ll show up to you when you do that [21:39] felixge: elliottcable: it gave me your social security # [21:39] elliottcable: felixge: I get: https://gist.github.com/6935810bc6e1d660cb32 [21:39] elliottcable: felixge: OMG! O_O_O_O [21:44] sr has left the channel [21:45] tlrobinson_ has joined the channel [21:47] elliottcable: oh dude sr was in here? [21:47] elliottcable: this room is just crawling with old acquaintences [21:58] chakrit: I'm not old yet. Been here only a day or two :) [22:01] elliottcable: chakrit: I meant from other places. [22:02] elliottcable: chakrit: I’ve been in here, uh, I dunno. [22:02] elliottcable: chakrit: the problem is that the instance I’m on right now hasn’t been up for very long, so its IRC logs aren’t comprehensive; before that, I was on a temporary desktop OS X install, and before that, several other instances. [22:03] elliottcable: Yeah, my logs on this instance only go back as far as Fri Nov 13 22:02:20 2009 [22:03] chakrit: Oh, misunderstood "acquaintences"... not my native lang sry [22:03] elliottcable: chakrit: Where’re you from? [22:03] chakrit: bangkok [22:03] elliottcable: chakrit: ah! [22:04] chakrit: hehe. not many asians I suppose [22:04] elliottcable: felixge: You run the logger, right? [22:04] elliottcable: felixge: is it rolling over, or is http://nodejs.debuggable.com/2009-11-23.txt the first log it ever ran? [22:04] elliottcable: chakrit: ain’t it getting late there? [22:05] chakrit: elliottcable: It's actually "morning"... it's 5am here B-) [22:05] elliottcable: chakrit: hahaha okay [22:05] elliottcable: chakrit: Ah, shit, I mis-read my Sydney dashboard clock. 9AM, not 9PM! [22:05] elliottcable: chakrit: And I knew you were several hours before Sydney… >,> [22:05] elliottcable: So, I have a method that reduces on an array. [22:05] chakrit: elliottcable: yup. I'm trying to maintain a proper sleep schedule so I can meet you guys during the night XD [22:06] elliottcable: But I don’t want to require that users pass it a safe-to-destruct Array. [22:06] elliottcable: chakrit: You’re actually shaping your schedule around #Node.js? o_O [22:06] elliottcable: The problem, is that I can’t copy-on-run, because I’m reducing [22:06] elliottcable: (i.e. it’d be copied for *every iteration*) [22:06] elliottcable: Anybody have a good solution? [22:07] elliottcable: I don’t consider an undocumented ‘amReducing’ argument (and copying on predicate of that) to be a ‘good solution’ either d-: [22:07] chakrit: elliottcable: lol, I'm kidding. It's just for my health :) ... but it's great to gets to meet lots of hackers during your "normal hours" too. [22:07] elliottcable: chakrit: it’s more healthy to stay up all night? what? o_O [22:07] elliottcable: chakrit: that’s generally considered *un*healthy… [22:07] chakrit: elliottcable: No you got it wrong haha, I've just woke up [22:07] elliottcable: chakrit: oh! [22:08] elliottcable: chakrit: Well, good morning. [22:08] elliottcable: chakrit: Any time I’m awake <9AM, it’s because I haven’t gone to sleep yet. [22:08] chakrit: elliottcable: Good morning, sir. [22:08] elliottcable: It’s 2PM right now, and I *still* haven’t gone to sleep <,< [22:08] inimino: hehe [22:08] chakrit: You mean 2PM since you last wakeup? or was that 2AM? [22:09] elliottcable: I last slept… [22:09] chakrit: oh i got it [22:09] elliottcable: I don’t remember. Some time a day or two ago? [22:09] chakrit: haha [22:09] elliottcable: I’ve *got* to finish this before I sleep. [22:09] elliottcable: Haven’t eaten anything in a while, too. Some Chex Mix early this morning, that’s all [22:09] elliottcable: but; code. >,> [22:09] inimino: heh [22:10] elliottcable: and, code. <,< [22:11] chakrit: elliottcable: That's some feat... staying up that long and still be able to debug [22:11] chakrit: props [22:14] elliottcable: chakrit: Dude. I’ve coded₁ on 9 days, 8 nights no-sleep before. [22:15] elliottcable: ⑴ Disclaimer: This is not to indicate, in any way, the *quality* of that code. [22:16] elliottcable: I actually have a, um, really odd brain. Buncha braindocs were scanning me throughout my teenage years; apparently I’m always asleep? [22:16] elliottcable: I can’t just fall asleep, I only become unconscious when I’m too tired to stay awake. [22:16] elliottcable: Keeping a schedule that lets me interact with normal day-wake night-sleep people is an absolute pain. [22:17] elliottcable: I’m considering switching to a decimal system, with ‘day’ cycles of 100Ks, split into 30Ks asleep and 70Ks awake. [22:17] elliottcable: Which would work out to a nice round ‘week’ period of 1Ms, split into ten ‘day’ periods (sleep/wake cycles) [22:18] elliottcable: I should move into Space™. Unfortunately, beam-internet would probably be laggy as *hell*. Imagine being on a sattelite uplink *all the time* >,> [22:18] elliottcable: heh, it’d be cool to make the first SSH tunnel from Space™, though… [22:18] chakrit: elliottcable: you have an x-gene [22:20] chakrit: I imagine there'd be a replica of the earth's internet on space. [22:20] chakrit: with several bots syncing' them over interplanetary link [22:20] chakrit: any modification would take days [22:21] elliottcable: I need to make a fuckton of money, so I can invest in a secret project to deorbit a Jovian body and ship an accelerator-sail out to Alpha Centauri with a payload of entangled qubits. [22:21] elliottcable: then I can figure out how to encode my state vector and ship myself over there. bye-bye, hyumanz. [22:22] elliottcable: d-: [22:23] chakrit: lol [22:30] chakrit has left the channel [22:38] chakrit has joined the channel [22:39] isaacs: so, with felix's patch, and a bit of testing, it seems like i've got the .. problem sorted. [22:43] JimBastard has joined the channel [22:44] elliottcable: this reduction problem is driving me a little crazy. [22:44] elliottcable: Seems like a *huge* API flaw to say ‘Oh, we’re going to destroy whatever Array you hand us!’ [22:45] elliottcable: yet, I can’t think of a clean way to solve it, that doesn’t involve creating a new copy of the array for every element reduced [22:45] JimBastard: elliotcable - the trick is to start with a high alchohol content before you start distilling [22:45] JimBastard: wait, wrong channel nm [22:45] JimBastard: :p [22:45] isaacs: elliottcable: reduction problem? [22:45] inimino: elliottcable: what's the issue? [22:47] sudoer has joined the channel [22:48] elliottcable: inimino, isaacs: function that reduces on an Array [22:49] inimino: so what's the issue that requires copying? [22:49] elliottcable: inimino, isaacs: reducing obviously involves destructivel modifying the array and passing it to myself again [22:49] inimino: ...it does? [22:49] elliottcable: inimino, isaacs: problem is, that if I clone the array argument, it will get cloned on every iteration; if I don’t, then the initial array provided by the user to the API will be destroyed [22:49] inimino: you don't do either [22:50] isaacs: elliottcable: what's wrong with https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/Array/Reduce? [22:50] inimino: use an additional variable for the state you are accumulating [22:50] elliottcable: inimino: Yes? That’s how reducing works… `arrayArgument.pop()`, work with it, pass `arrayArgument` to a new call to yourself [22:50] inimino: nope [22:50] elliottcable: inimino: example? [22:50] inimino: function add(a,b){return a+b} [22:51] inimino: function sum(a){return reduce(add, a)} [22:51] inimino: actually... [22:51] inimino: function sum(a){return reduce(add, a, 0)} [22:51] elliottcable: I’m completely unfamiliar with `reduce()`. [22:52] elliottcable: I’m not talking about a JS stdlib function here, I’m talking about the recursive pattern [22:52] inimino: I'm writing it out for you, just wait [22:52] elliottcable: of a function, that takes an array argument, calling itself after removing and operating on one element of the argument [22:52] elliottcable: inimino: okay [22:52] isaacs: what about [0,1,2,3,4].reduce(function(a,b){return a+b}) [22:52] isaacs: elliottcable: keep track of the index that your'e on. [22:52] inimino: function reduce(f, array, start){var i,l;for(i=0,l=array.length;i sum([1,2,3,4,5]) [22:54] inimino: 15 [22:54] isaacs: if you want to do it recursively, you have to do tail-recursion tricks to simulate iteration, which to me is just as wonky as using loops to simulate recursion. [22:54] elliottcable: ACTION only learned the meaning of ‘reduce’ a week ago, and he learned it as ‘the pattern wherein you recurse with an array argument that is gradually reduced’ [22:54] elliottcable: so, if that’s not what reduce means… then I don’t mean reduce d-: [22:54] isaacs: elliottcable: imo, that is a case of "jumping through hoops for the sake of functional purity" [22:54] elliottcable: In this case, it’s usually for eventual purity [22:54] inimino: elliottcable: the pattern is actually founded in functional programming without mutable state [22:55] inimino: elliottcable: if you're thinking of 'reduce' as something that requires mutation, you're doing it wrong [22:55] isaacs: in erlang or haskell, you'd implement it using immutable state. [22:55] elliottcable: loops make no sense in an evented context; you’ll suddenly have fifteen elements queued up, and all of them will run, regardless of what you try to operate on or return [22:55] isaacs: inimino: gmta [22:55] elliottcable: whereas reduction (if that is, indeed, the name) makes a lot more sense: at the end of each event, you reduce through the next element [22:55] chakrit: how about http://pastebin.com/m66bafa87 ... havn't tested though [22:56] isaacs: chakrit: syntax err [22:56] chakrit: Oops, this one instead: http://pastebin.com/m4d62fc34 [22:56] chakrit: it's just an idea [22:56] isaacs: right, but you see, without tail recursion, that's a problem. [22:56] inimino: elliottcable: if you want to do it the way it's meant to be done, I can give you an example of that too, but it's not as efficient in JavaScript [22:57] isaacs: sorry, i shouldn't call it "tail recursion". "tail call optimization" [22:57] isaacs: in a language that has loops, it's reasonable to use loops where they're better, rather than abusing recursion. [22:57] chakrit: isaacs: I see.. [22:57] isaacs: if you have 10000 elements in your loop, the js interpreter will run out of stack. [22:57] inimino: yes, but it's not the only problem [22:58] inimino: the problems include: blowing the stack, unnecessarily slow, and mutates the argument [22:58] isaacs: exactly [22:58] isaacs: if js didn't have arguments.callee.caller, and stack traces, etc., then tco would perhaps be an option. [22:58] ryanmcgrath: Hey, what's the overall consensus on adding to requires.paths at runtime? [22:58] isaacs: imo, if you need tco, you're doing it wrong. [22:58] ryanmcgrath: *require.paths [22:59] isaacs: ryanmcgrath: i dont' have a problem with modifying it in your app if you need to. [22:59] chakrit: ryanmcgrath: Fine with me. as long as you don't abuse it in every package you do [22:59] ryanmcgrath: Mmmm [22:59] isaacs: but you'd probably be better off just using relative paths. [22:59] ryanmcgrath: So lemme put it this way [22:59] inimino: elliottcable: the reason why all these problems arise is that you're using an algorithm founded on linked lists and applying it to arrays [22:59] inimino: if you want linked lists... [23:00] ryanmcgrath: I have a web framework, wherein I install the engine to /usr/local/luno (luno being the framework name) [23:00] ryanmcgrath: I want to add luno/ to the require.paths array, to load things from there [23:00] inimino: function cons(a,b){return [a,b]} function car(a){return a[0]} function cdr(b){return a[1]} [23:00] chakrit: ryanmcgrath: Sounds like a good idea to me :) [23:00] chakrit: ryanmcgrath: I've did that in my framework too [23:01] isaacs: inimino: cons should be [a].concat(b), no? [23:01] isaacs: since you can cons an item onto a list? [23:01] ryanmcgrath: So something like [23:01] ryanmcgrath: require.paths.push("/usr/local/luno"); [23:01] isaacs: oh, i see, you're doing it with a list as [x, [y, [z, []]]] [23:01] inimino: isaacs: lists are nested pairs, I'm just building pairs out of arrays since we don't have tuples [23:02] inimino: yes [23:02] isaacs: otherwise cdr would be return a.slice(1) [23:02] chakrit: ryanmcgrath: yup [23:02] isaacs: it'd be syntactically uglier, though more efficient to use {}s instead of []s [23:02] inimino: function reduce(f,array,start){if(empty(array))return start; return reduce(f,cdr(array),f(start,car(array))} [23:03] inimino: hm, would it? [23:03] inimino: ACTION hasn't benchmarked [23:03] isaacs: function cons(a,b) { return {h:a, t:b}}; function car(a){ return a.h}; function cdr(a) { return a.t } [23:04] inimino: I guess that would be faster in V8 [23:04] isaacs: 'twould. [23:04] inimino: don't know about in general [23:04] idris has joined the channel [23:05] isaacs: imo, it'd be semantically more accurate. [x, [y, [z, []]]] is a weird beast. [23:05] isaacs: because the items in teh array are not like or comparable. [23:05] isaacs: [x, [y, [z, []]]] is actually a collection of two things: an atom and a list. its an object, but the nametags have been stripped away. [23:05] binary42 has joined the channel [23:05] isaacs: you've dehumanized the members, given them numbers instead of proper names. [23:06] inimino: hehe [23:06] isaacs: it's almost a nazi thing. [23:06] chakrit: ooh. [23:06] inimino: cons to Godwin in record time [23:06] shiftb has joined the channel [23:06] isaacs: lolz [23:06] inimino: I just think of it as some kind of a tuple [23:07] inimino: there's no rule that JavaScript arrays have to be of type [a] [23:07] isaacs: inimino: true. it's more a convention [23:07] isaacs: but, imo, if you have to say "item 0 is this thing, and item 1 is this thing, and there's always two items", then that's better served (in js) with a hash. [23:07] inimino: elliottcable: did that make sense, by the way? [23:08] isaacs: you're never gonna pop or push or map on it [23:08] sixtus42 has joined the channel [23:09] inimino: hm, you may be right [23:10] isaacs: it would be nice if js had a "nameless tuple" concept. [23:10] isaacs: ie, something like: {1, foo, bar} [23:11] isaacs: without all the Array semantic overhead. [23:11] isaacs: (interestingly enough, {1, foo, bar} is valid js, provided that "foo" adn"bar" are defined) [23:11] inimino: not a valid expression though [23:12] isaacs: inimino: sure it is. [23:12] isaacs: try it :) [23:12] isaacs: {1, "foo", "bar" } to avoid the undefined issues. [23:12] isaacs: the {} is a code block. [23:12] inimino: it's a statement [23:12] isaacs: the ,s separate the different expressions in teh block. [23:13] isaacs: oh, expression vs statement, right [23:15] hornbeck: is there anyway to get tab completion in the repl? [23:22] JimBastard: <3 jQuery. just created a 4 line dynamic CSS parsing engine. just send it a nested JSON object with CSS values or classes as properties. [23:22] JimBastard: http://gist.github.com/260277 [23:23] jed has joined the channel [23:24] skampler: JimBastard: nice! [23:24] binary42: JimBastard: Yeah. I sometimes think browsers should support JSON as a CSS format. [23:25] binary42: Reminds me of JSSS [23:25] binary42: http://www.w3.org/Submission/1996/1/WD-jsss-960822 [23:25] JimBastard: binary42 i figured someone has done this before [23:25] JimBastard: css as json [23:26] binary42: Well, I've encoded a lot of shit as JSON but I don't think I've ever need to do CSS that way. [23:26] JimBastard: im doing a lot of injection / bookmarklet shit right now [23:26] binary42: What kind of hack is this? [23:26] JimBastard: so its helping a lot [23:26] binary42: Ah. [23:26] binary42: For drop.io? [23:26] JimBastard: its a pre jquery.require() [23:26] JimBastard: hell yeah [23:26] JimBastard: im in the drop chat for the contenst now [23:26] binary42: :-) At their HQ right now actually. [23:26] JimBastard: you should join [23:26] JimBastard: lolwut [23:26] binary42: What's the URL? [23:26] JimBastard: http://drop.io/hackathon [23:32] JimBastard: yeah im trying to win that shit [23:32] JimBastard: i think i might be able to pull it off [23:32] JimBastard: probaly like 600 lines of JS left now [23:32] JimBastard: :-\ [23:32] JimBastard: 300 down [23:32] JimBastard: also CSS slicing, ughhhh ffffffffuuuuuuuuuuu [23:34] micheil has joined the channel [23:35] micheil: elliottcable: you could've done what I did and fall asleep where every you were working [23:42] isaacs: anyone up for a quick code review? [23:43] binary42: JimBastard: Good luck man. I'd totally be down to try a hack contest later but this weekend was just bad timing. [23:44] chakrit has joined the channel [23:47] micheil: isaacs: sure, I can try and review your code [23:51] isaacs: micheil: thanks. if you like to stare at patches, there's this: http://gist.github.com/260278 or you can check out http://github.com/isaacs/node/blob/master/src/node.js#L669-694 and http://github.com/isaacs/node/blob/master/lib/uri.js#L83-104 [23:51] isaacs: i also added some code to tests/mjsunit/test-module-loading.js to verify that cycles with .. don't blow up [23:52] micheil: ?isaacs: do you think there could be a faster way to do some of those forloops [23:53] micheil: for(var directory; directory = parts.shift()){} perhaps? [23:54] nrstott has joined the channel [23:57] micheil: return exports.normalize((Array.prototype.join.call(Arguments, "/")); [23:57] micheil: does that do the same as exports.join? [23:57] mediacoder: isaacs: i can just confirm, that it works now for my project ..cant say anything besides that tho :-) [23:58] isaacs: mediacoder: fantastic. [23:59] micheil: isaacs: I'm wondering if there's a better way to achieve this.. [23:59] micheil: brb, getting a tea [23:59] isaacs: micheil: me too, ironically enough. bbiab [23:59] isaacs: well, the directory part might be empty (which would be falsey and abort the loop) and i don't want to mutate parts.