--- Log opened Wed Jul 10 00:00:33 2013 00:41 < niftylettuce> #9 on Gittip! http://gittip.com 00:41 < niftylettuce> (sorry substack lol) 00:47 < ralphtheninja> https://www.b1txr.com/pages/about 00:54 < mikolalysenko> Is there a way in npm to make binary dependencies optional? 00:54 < mikolalysenko> for example, could I write a library that say tries to link to fftw 00:55 < mikolalysenko> but if it isn't installed, then falls back to using a native javascript library 00:55 < rch> node-redis does that with hiredis iirc 00:55 < mikolalysenko> interesting, I will need to take a look at it 00:56 < rch> https://github.com/mranney/node_redis/blob/master/index.js#L18 00:56 < rch> same idiom as in python 00:57 < mikolalysenko> I see 00:57 < mikolalysenko> how does it manage the build part of it? 00:58 < rch> it doesn't install hiredis, that's a different npm package 00:58 < mikolalysenko> hmm 00:58 < mikolalysenko> so to use that you have to install hiredis separately first? 00:58 < mikolalysenko> I guess that isn't quite what I had in mind... 00:59 < mikolalysenko> I was thinking about making a module that automatically tries to install fftw bindings 00:59 < mikolalysenko> but if the system doesn't have them it fallsback to not using them 00:59 < mikolalysenko> though maybe I am overthinking it 00:59 < rch> install via package.json or gyp? 00:59 < mikolalysenko> yeah 00:59 < rch> if i wanted to do something like that i'd probably cheat in a makefile x.x 00:59 < mikolalysenko> hmm 01:00 < mikolalysenko> maybe it makes more sense to have one library for fftw bindings and then just check if they are available before doing anything 01:00 < mikolalysenko> though it could get annoying with dependencies 01:00 < mikolalysenko> like library x uses library y and library y can optionally use the native library z if it is installed 01:00 < mikolalysenko> so if I use x, I have to know to install library z if available... 01:01 < mikolalysenko> I guess what I am looking for is a way to hook a fail event on gyp 01:01 < rch> right. like if you just add node-redis to package.json you miss out on hiredis 01:01 < mikolalysenko> yeah 01:01 < rch> or if you use something that does that 01:02 < mikolalysenko> or if I use a library that uses node-redis, then I'd have to know to add hiredis if I wanted binary performance 01:02 < mikolalysenko> for one or two libraries this isn't bad, but if you have a lot of them it could suck 01:03 < mikolalysenko> for example, there are lots of places in ndarray where it would makes sense to call out to a native library to do something if you have the option available 01:03 < mikolalysenko> like call out to blas, fftw, etc. 01:03 < mikolalysenko> since there are tons of very mature and optimized libraries for numerical code out there 01:03 < mikolalysenko> but I would also like it to work in a browser or have some fallback if they aren't available 01:03 < mikolalysenko> so there could be a slower native js fallback if things don't work 01:05 < jcrugzz> isnt there an optionalDependencies field? 01:05 < rch> so basically you want to be able to define a polyfill for a native binding 01:05 < jcrugzz> not sure how it can be used though 01:05 < mikolalysenko> yeah 01:05 < mikolalysenko> and also use that in a browser too 01:05 < rch> heh 01:05 < mikolalysenko> so I already have a polly fill for fftw 01:05 < mikolalysenko> but on node it would be awesome to actually use fftw if you have it installed 01:06 < mikolalysenko> writing the bindings is easy, but I don't want to force fftw on people if they don't have it set up on their system 01:06 < jesusabdullah> jcrugzz: yeah but it's brittle. Ask AvianFlu and Maciej about the old issues with hiredis linker errors sometime 01:06 < jesusabdullah> mikolalysenko: There *are* optionalDependencies, they'll just glaze over if they fail to compile or install 01:07 < mikolalysenko> jesusabdullah: cool, that sounds like the right thing 01:07 < jesusabdullah> mikolalysenko: only issue is linker errors cause the dep won't fail to build, only to run 01:07 < mikolalysenko> I think you could detect those at module load time probably 01:07 < jesusabdullah> Yeah, if you're smart about it. 01:07 < jesusabdullah> Not at require-time, that'll work too 01:07 < jesusabdullah> or at least that used to be the case 01:09 < jesusabdullah> ugh this lazagna has TOO MUCH BLEU CHEESE 01:32 < dominictarr> chrisdickinson: how do I get the length with bops? 02:06 < st_luke> jesusabdullah: what the fuck 02:11 < thl0> Raynos: shit's starting to come together :) https://github.com/thlorenz/configurate/blob/master/examples/new-config-given-partial-default-edit-step-async.js 02:11 < thl0> wish I had more time with this, gonna release this soon though 02:23 < jesusabdullah> st_luke: wat 02:24 < jesusabdullah> st_luke: seriously confused 02:24 < st_luke> why did you put blue cheese in it 02:24 < jesusabdullah> I didn't 02:24 < jesusabdullah> Mom did 02:24 < jesusabdullah> it was a "bufallo chicken" lazagna 02:24 < st_luke> oh wow 02:24 < st_luke> wow 02:24 < st_luke> haha wowowowow 02:24 < st_luke> you are so alaskan hahaha 02:24 < jesusabdullah> I guess? 02:26 < st_luke> thats cool 04:04 < dominictarr> Raynos: ping? 05:06 < chrisdickinson> dominictarr: get the byte length? `bops.from(buf, 'encoding').length` 05:07 < dominictarr> but that creates a new buffer, doesn't it? 05:08 < dominictarr> like if it's a typed array… will it still have the same length? 05:13 < chrisdickinson> ah, it'll have a .length 05:13 < chrisdickinson> so anything that comes out of bops should have a .length 05:13 < chrisdickinson> which'll match up to the byte length 05:14 < chrisdickinson> i thought you were looking for a Buffer.byteLength equivalent 05:20 < dominictarr> oh, no I was working on a pull request, adding bops to bytewise, and worried about getting the wrong length. 05:25 < substack> building a worker queue for testling jobs on top of level 05:30 < dominictarr> sweet! 05:46 < substack> dominictarr: would it make sense to use level-trigger for this or is that only meant for jobs that do db io? 05:47 < dominictarr> it's intended for any job that is idempotent, and are triggered by data base inserts 05:48 < dominictarr> that can be anything - as long as it's okay that it only runs once. 05:53 < substack> ok this should work 07:13 < Raynos> dominictarr: pong 07:37 < dominictarr> Raynos: hey what up - 07:37 < dominictarr> I have a thing you might be interested in! 08:15 < Raynos> dominictarr: sweet 08:21 < dominictarr> Raynos: what if you had a immutable database, that was fully replicatable? 08:21 < Raynos> yes 08:21 < Raynos> that's just read only leveldb with replication 08:21 < dominictarr> and if any arbitary subset of the database is also replicatable 08:22 < dominictarr> no, it's writable 08:22 < dominictarr> but just not overwritable 08:22 < Raynos> Oh ok 08:22 < dominictarr> so, every object is hashed 08:22 < dominictarr> and the hash is used for the key 08:22 < dominictarr> you can trust that, because no one can change it 08:23 < Raynos> what about hash collisions? 08:23 < dominictarr> if I give you the data, you can never lie about what the data was 08:23 < dominictarr> okay, you can still change it if you find a hash collision 08:23 < dominictarr> but you can't change it unless you can find a hash collision 08:24 < Raynos> Ok. 08:24 < Raynos> Oh wait 08:24 < Raynos> your saying I can have a local immutable database 08:24 < Raynos> and replicate with a remote 08:24 < Raynos> and he won't mutate my keys 08:24 < Raynos> and just add new ones 08:24 < dominictarr> yes 08:24 < Raynos> Ok so how does this effect searching? 08:25 < dominictarr> so, you do every access by searching for properties instead 08:25 < dominictarr> you just index every value 08:25 < Raynos> I see 08:26 < dominictarr> also, if you store the hash of one document in another document 08:26 < dominictarr> you have created a reference 08:26 < dominictarr> and you can traverse those references as a kind of query too 08:26 < dominictarr> so you can create trees 08:27 < dominictarr> (note, that is is not possible to create a cycle without having a hash collision) 08:28 < dominictarr> because othewise… you would have to have some X; Y = HASH(Y + X) 08:29 < dominictarr> you can replicate this sort of data trivially 08:29 < dominictarr> it's what GIT does! 08:30 < dominictarr> git does this in a messy way 08:30 < dominictarr> but you can do it better with a merkle tree 08:32 < dominictarr> anyway… so basically, you get replication, immutability, search, and tree traversal. 08:33 < dominictarr> (every very complex queryies/tree traversals are feasible, because you can just replicate that data locally if necessary, and if it's deterministic you can also veryify that something was done correctly, 08:33 < dominictarr> even independently. 08:34 < dominictarr> i.e. another phrasing would that you get security 08:38 < Raynos> so how do you get security 08:38 < Raynos> say you replicate only values 08:38 < Raynos> and every peer stores incoming values under the hash 08:38 < Raynos> you would get eventual consistency if there are zero hash collisions 08:44 < dominictarr> Raynos: well the security you get is that no one can change your data without you knowing 08:45 < Raynos> :p 08:45 < Raynos> every local database has that 08:45 < dominictarr> defunctzombie: whats up? are you still in the bay area or are you back in ny? 08:46 < dominictarr> Raynos: but ONLY if it's local! 08:46 < dominictarr> with other databases you have to trust that the data hasn't been changed maliciously. 09:16 < substack> pow, fixed all extant trumpet issues 09:27 < jesusabdullah> gg 09:27 < jesusabdullah> I have almost as many open issues on browserify-cdn as closed ones 09:27 < jesusabdullah> too bad I have real work now 09:27 < jesusabdullah> XD 09:37 < substack> OK THEN 09:37 < LOUDBOT_> THAT'S JUST SO WEIRD 09:49 < jesusabdullah> mbalho: I thought that hypernal table with the npmsearch stuff was a screenshot, I shat bricks when I realized that was live 09:49 < jesusabdullah> mbalho: so cool 09:55 < jesusabdullah> mbalho: it warms my cold frigid heart 11:25 < juliangruber> new module: repo-url. so you can do `$ git clone $(repo-url browserify)`. https://github.com/juliangruber/repo-url 11:26 < st_luke> juliangruber: neat, I use a bash function for that 11:27 < juliangruber> st_luke: cool, would you mind sharing? 11:27 < substack> nifty 11:28 < substack> dominictarr: zerovm is a beast to get running and installed 11:28 < substack> docker is being pretty straight-forward though 11:28 < st_luke> juliangruber: function repourl () { npm view $1 repository.url | tee >(pbcopy) ; } 11:28 < st_luke> it also copies to the clipboard on os x 11:31 < juliangruber> st_luke: didn't know npm view could do that 11:31 < juliangruber> st_luke: npm view browserify repository.url 2> /dev/null | head -n1 | tr -d '\n' 11:31 < juliangruber> that would be a replacement for repo-url 11:32 < st_luke> juliangruber: yea npm view is awesome i use it all the time for random crap 11:39 < st_luke> I hate when I see an interesting looking module and the main file is 450 lines and `this` shows up 134 times 11:40 < st_luke> juliangruber: lmao, you made that a repo? 11:46 < juliangruber> st_luke: that's how I roll 11:47 < st_luke> juliangruber: do you use a separate file for each shell function? 11:47 < juliangruber> st_luke: i don't really use shell functions that much 11:48 < juliangruber> but I like just putting `source ~/pro/repo-url.sh/repo-url.sh` into my bash_profile 11:48 < st_luke> i dont either, usually have ~5 and add/remove when I notice im repeating myself a lot and sick of it 11:48 < juliangruber> mhm 11:51 < st_luke> you could make a repo for `ls -G` next 11:59 < juliangruber> st_luke: only use ls ;) 12:04 < st_luke> fuck that 14:30 < spion> hmm, i suppose my announcement didn't make it into the channel because I disconnected 14:30 < spion> oh well 14:30 * spion announces https://github.com/spion/amd2cjs (converts old AMD modules to commonjs modules, either command-line or as a browserify transform) 14:32 < spion> oh wow, I should've checked out browserify-ftw first 14:32 < spion> I don't remember it having that many options the last time I tried it 14:34 * spion kills it 15:48 < juliangruber> substack defunctzombie_zz : where is browserify's `-r` logic defined? trying to fix https://github.com/substack/node-browserify/issues/450 15:52 < jjjohnny_> whatup soldair 15:52 < soldair> jjjohnny_: nothin much man just getting started 15:54 < jjjohnny_> you mean... boot strapping 15:55 < soldair> jjjohnny_: how are the chickens 15:55 < jjjohnny_> very cute! 15:56 < jjjohnny_> only 4 months old, but pretty big 15:57 < jjjohnny_> no eggs yet 15:57 < jjjohnny_> pretty good company, a bunch of chickens 15:59 < soldair> cool. perhaps ill get one or two 15:59 < soldair> hacking anything today? 16:00 < jjjohnny_> more than one at least, they are groupies 16:00 < jjjohnny_> i have 5 in a medium/small yard 16:00 < soldair> yeah i dont want lonely chickens 16:01 < jjjohnny_> soldair: been hacking a web audio music thingy for a little while 16:02 < jjjohnny_> synthesizers, sampling, etc 16:02 < jjjohnny_> soldair: you been doing any js/node groups in LA? 16:03 < soldair> im going to try to connect with the js.la guys and run some workshop style meet ups nodeconf style. leveldb streams bots etc. 16:04 < jjjohnny_> yay 16:05 < jjjohnny_> soldair: im just now spec-ing a live-code JS tour of the west coast 16:05 < soldair> sounds neat 16:06 < jjjohnny_> for ~september 16:06 < jjjohnny_> soldair: let me know if you get any things going on down there, I may try to make it 16:06 < soldair> jjjohnny_: ok, i will =) 16:12 < defunctzombie> juliangruber: the flags are handled in the bin launcher 16:12 < defunctzombie> juliangruber: for that specific issue with constants, maybe we need to add constants to the default replaced modules list 16:34 < mbalho> jesusabdullah: you should try to get your asciimator to work! i couldnt figure it out 16:34 < mbalho> jesusabdullah: on requirebin that is 16:35 < mbalho> jlord_: https://github.com/taka-wang/art-of-node/commit/9f13439ebda062e9086e5855fc4d362805afd151 16:44 < juliangruber> defunctzombie: already did that :) 17:03 < Domenic_> this is fascinating. https://github.com/soldair/node-s3-npm /cc thl0 thlorenz 17:05 < thlorenz> Domenic_: if this works that'd be a game changer ;) 17:05 < Domenic_> thlorenz: it looks pretty innovative. simple but brilliant. postinstall hooks on the app that parse s3Dependencies, and a command-line s3npm that lets you publish to s3. 17:09 < soldair> Domenic_: sounds good? 17:09 < soldair> Domenic_: it would be super helpful for people to open issues with thoughts etc that are interested 17:11 < soldair> Domenic_: thlorenz im so happy i started hanging in the irc =) its like all of my favorite internet people are real ;) 17:12 < Domenic_> ^_^ 17:13 < Domenic_> i'd be afraid to open too many issues from the sidelines without actually using it. but i'm tempted to give it a try just so i can, because it seems really cool. 17:17 < defunctzombie> Domenic_: that would be interesting once the workflow is better 17:17 < defunctzombie> as in, maybe don't need the extra module 17:18 < Domenic_> you expect npm to integrate s3 support directly? 17:18 < soldair> you dont need the extra module if you dont mind running s3npm install 17:18 < defunctzombie> Domenic_: nope, don't expect that 17:18 < defunctzombie> soldair: interesting 17:18 < soldair> Domenic_: the biggest issues right now are that i don't have a list/search command which means you have to use another tool to list the bucket which is silly. and its hard to figure out why it may not be working if you have your user policies configured incorrectly in aws. 17:18 < defunctzombie> Domenic_: if npm supported custom install location prefixes that could make it work 17:19 < defunctzombie> Domenic_: so like we used to do with git://... 17:19 < defunctzombie> in deps 17:19 < defunctzombie> you could do s3:// 17:19 < soldair> but thats only from my use case. im sure as more people think about it other things will be bigger pain points 17:19 < Domenic_> soldair: hmm yeah getting a list/search (or, if we're dreaming, an npmjs.org) working seems important 17:19 < defunctzombie> and it would maybe use a globally installed module to handle that 17:19 < defunctzombie> or a plugin 17:19 < soldair> like defunctzombie said 17:19 < Domenic_> defunctzombie: that's a really fascinating idea, hrm. 17:20 < defunctzombie> Domenic_: :) 17:22 < soldair> do you think the postinstall hook is more mad science style and people would like to run npm install && s3npm install when they deploy thier apps? 17:23 < Domenic_> I mean both work, right? I think the postinstall hook is just a way of automating the && version and is something you might think of yourself anyway after a week or so. 17:23 < defunctzombie> Domenic_: if npm queried a plugin or something for special prefixes it would do it 17:25 < Domenic_> isaacs: what do you think of allowing custom URL protocol handlers for npm dependency URLs. This could help modularize npm itself by making the git handlers a plug-in for this system. It could also open up easy `file:` URL handling or similar. Plus this `s3:` idea. 17:36 < isaacs> Domenic_: i dunno. sounds complicated. 17:36 < isaacs> Domenic_: what's "this s3 idea"? 17:38 < Domenic_> isaacs: soldair has this cool project https://github.com/soldair/node-s3-npm which uses a `s3npm` binary to interpret `s3Dependencies` and install from s3. defunctzombie_zz suggested that if npm had a pluggable protocol thing, we could instead use "s3://"-type URLs in the normal `dependencies` hash. 17:39 < isaacs> hm 17:40 < isaacs> i think custom url protocols, to indicate a hostname, is kind of the wrong approach 17:40 < isaacs> why not just specify the public url to the s3 thing? 17:40 < isaacs> if the answer is, "i have custom login magic", well, ok, then that's shitty, becasue now you have a published package that can't be installed. 17:40 < isaacs> that's just like depending on a package that doesn't exist. 17:41 < isaacs> or a file:// url 17:42 < Domenic_> I think I see what you're saying. But this is for apps. Companies set up their s3 bucket, redistribute .s3npm files to their employees (or use more complicated Amazon auth stuff that solidair is still working on), and their internal projects can use `s3Dependencies` or `s3://` URLs. 17:42 < Domenic_> In the s3:// URL idea, s3npm becomes an npm plugin that companies distribute to their employees. 17:43 < Domenic_> although, wait, this is weird, the fields end up looking like `{ "my-dep": "s3://~1.2" }` 17:46 < Domenic_> yeah maybe URLs aren't the best fit for this, it loses some elegance compared to the existing `s3Dependencies` solution. 18:34 < defunctzombie> Domenic_: the files could end up looking like many things 18:34 < defunctzombie> Domenic_: the protocol just identifies what tool fetches it 18:34 < Domenic_> defunctzombie: ok, but what do you envision the dependencies hash looking like in this case (or ones like it) 18:35 < defunctzombie> Domenic_: I don't like the existing solution cause it breaks the deps section apart and makes it not clear what all the deps are I feel 18:35 < defunctzombie> Domenic_: s3://bucket-name/module#version maybe, I dunno 18:36 < Domenic_> defunctzombie: I guess, but that loses the elegance of `"my-dep": "~1.2"` in both not allowing fuzzy matching and in making you repeat the module name. 18:36 < Domenic_> Maybe @~1.2 18:36 < defunctzombie> sure 18:36 < defunctzombie> personally, I don't care about fuzzy matching :) 18:36 < defunctzombie> so don't cry over not having that 18:36 < Domenic_> yeah i know :P 18:37 < defunctzombie> but sure, use whatever separator you want 18:37 < defunctzombie> the nice thing is that it allows for you to have better private modules 20:15 < Raynos> Domenic_: What are you storing in s3? 20:21 < Raynos> Oh I see 20:21 < Raynos> entire packages 20:26 < soldair> Raynos: i made it for work. not useful if you can open everything but the patterns are interesting too if you think storage backend agnostic... 20:35 < Raynos> cool 21:38 < jesusabdullah> mbalho: asciimator? 21:56 < anvaka> Is there any way to print v8 version used by node? I can look into the github repository too, but just wondering if there is a CLI to get that... 21:59 < soldair> process.versions anvaka ? 21:59 < anvaka> nice! Thank you soldair 23:01 < jden> ls 23:02 < jden> ENOTTERM 23:07 < soldair> ha jden i think everything should support ls 23:07 < maksimlin> isaacs: I'm using the same node-irc module as you do for ircretary for a basic logging bot I wrote ( but its a bit newer version of node-irc) but I keep getting disconnect due to "network connection reset by peer" but node-irc never notices them, have you ever had that issue with ircretary? 23:11 < anvaka> Wow, I've just tried asm.js demo of Unreal Engine (http://www.unrealengine.com/html5/ ) in Canary. Got 40fps at 1280x800 on macbook pro. 23:14 < anvaka> v8 folks are awesome. They also made huge improvements in GC behavior for double values stored on objects 23:15 < maksimlin> yep its very impressive how well v8 can run asm.js style code *without* AOT compilation 23:29 < jesusabdullah> maksimlin: I have 23:29 < jesusabdullah> maksimlin: node-irc is really buggy unfortunately 23:30 < jesusabdullah> maksimlin: you know when you write a library out of necessity, but then everyone expects you to maintain it and you don't really want to? 23:30 < jesusabdullah> maksimlin: it's kinda like that. 23:30 < maksimlin> jesusabdullah: thanks for confirming I thought I was going nuts 23:30 < jesusabdullah> maksimlin: mmalecki has a promising new irc lib coming out, but while it's less buggy it's also way way way less feature complete 23:30 < maksimlin> oh is ther a repo? 23:30 < jesusabdullah> maksimlin: Yeah, ddgbot drops off the face of the earth every once in a while and I *never* really figured out why cause the bot is happily running but yeah 23:31 < maksimlin> I don't need many features, mine is just a logging bot 23:31 < jesusabdullah> maksimlin: https://github.com/mmalecki/ircb yeah 23:31 < jesusabdullah> maksimlin: biggest thing for me is, last I checked it didn't have any startup error catching/handling 23:31 < maksimlin> way more minimal than ircretary: https://github.com/maks/mkbot 23:31 < jesusabdullah> maksimlin: but once it's connected it seems pretty solid 23:32 < maksimlin> jesusabdullah: great, thaks for that I'll check it out 23:32 < maksimlin> but what do you mean by "startup error catching/handling" 23:33 < jesusabdullah> maksimlin: like, if nick is already taken it has no way of even detecting it, much less handling it. 23:34 < jesusabdullah> maksimlin: stuff like that. 23:34 < maksimlin> your description of what you see with ddgbot is exactly what I see to, node-irc listenere for all errors from the socket and I even add log output in there and never saw a thing 23:34 < jesusabdullah> that reminds me 23:34 < jesusabdullah> yup 23:34 < jesusabdullah> brb restarting ddgbot 23:34 < maksimlin> oh ok, I can live with those limiations 23:34 < isaacs> maksimlin: yeah, i just restart ircretary every day 23:35 < maksimlin> guys it makes me slightly suspicious of an underlying bug in nodes socket code 23:36 < jesusabdullah> naw I can almost guarantee it's an issue with the irc lib 23:36 < jesusabdullah> look at its issues 23:36 < maksimlin> isaacs: yep I'm at the point of writing a cron job to do that to mine too 23:36 < jesusabdullah> look at how often martyn does work on it 23:36 < jesusabdullah> it's just a hairy problem that nobody wants to fix 23:36 < isaacs> maksimlin: yeah, that's what i did 23:37 < maksimlin> jesusabdullah: sure but on the other hand its code is quite straight forward and I add logging into it conn error handler and it never gets called on those disconnect events 23:37 < jesusabdullah> maksimlin: it doesn't seem to straight disconnect for me either 23:37 < jesusabdullah> maksimlin: like it's subtly different 23:39 < maksimlin> jesusabdullah: yes but when I'm in my irc client at the same time by chance that it disconnects I see the "connection reset by peer" from the irc server in my client UI 23:39 < maksimlin> shouldn't that cause a error cb from the node socket conn ? 23:41 < maksimlin> I put logging line into func: https://github.com/martynsmith/node-irc/blob/master/lib/irc.js#L668-L670 23:41 < maksimlin> but it never gets called on those "connection reset by peer" disconnects from the irc server 23:43 < isaacs> Raynos: you remember how you complained that graceful-fs monkey patches the builtin fs module? 23:43 < isaacs> Raynos: yeah... i'm encountering the reason why that wasy 23:43 < Raynos> isaacs: yes 23:43 < Raynos> isaacs: is it because RAGEQUIT 23:43 < isaacs> Raynos: not really 23:43 < isaacs> Raynos: you see... there are a lot of things that call fs.open 23:44 < isaacs> Raynos: like, streams etc. 23:44 < Raynos> but aren't they all in fs 23:44 < Raynos> Well I guess patching fs.createReadStream 23:44 < Raynos> with the same code 23:44 < isaacs> Raynos: yes, but... that doesn't actually work 23:44 < Raynos> except fs.gracefulOpen 23:44 < Raynos> would be a bit silly 23:44 < isaacs> Raynos: also, you end up with cases where you don't really know how many things were *actually* opened 23:44 < isaacs> so you queue up, let's say 500 streams your'e trying to read from 23:45 < Raynos> I understand the reasoning for monkey patching 23:45 < Raynos> I agree it's a pretty good use 23:45 < isaacs> and then also try to do fs.readFile on 1000 files 23:45 < isaacs> there's a lot of little edge cases in there 23:45 < isaacs> also, readdir uses a fd, and so does process.cdw 23:45 < isaacs> *cwd 23:45 < Raynos> the only alternative is to be a fancy pants and say "all file functions are just higher order functions that take open and read as arguments" 23:46 < isaacs> Raynos: not gonna happen 23:46 < Raynos> of course not 23:46 < Raynos> but if you writing node-haskell or something 23:46 < isaacs> noted. 23:46 < Raynos> I looked at haskell TCP examples and I'm like ;_; why no simple 23:46 < isaacs> Raynos: what i could do is have graceful-fs enqueue everything 23:47 < isaacs> and only proceed to the next item in the queue when I get a non-EMFILE response 23:47 < isaacs> but slooooowwwwwwww 23:47 < substack> because haskell makes everything hard for dubious reasons 23:47 < isaacs> substack: you only say that beecause you hate purity 23:47 < substack> yes. yes I do 23:47 < substack> humans are actually pretty good at reasoning about mutable state in small doses 23:48 < substack> the answer is just to keep the doses small and modular 23:48 < isaacs> substack: if you loved purity more, you'd have small modular purity 23:48 < isaacs> substack: and then you'd be pure. 23:49 < substack> haskell frees you from worrying about mutable state by forcing you to worry about mutable state even more 23:49 < isaacs> substack: it frees you from dirtiness by making you pure 23:50 < isaacs> substack: it is like a purifying bath in chlorine bleach 23:50 < isaacs> substack: ZERO SIDE EFFECTS 23:51 < substack> gotta be clean, gotta be pure 23:51 < substack> wash your hands 30 times per day 23:51 < substack> to keep the side effects at bay 23:51 < jjjohnny_> what's haskell? 23:52 < jjjohnny_> just kidding! I don't care! 23:53 < substack> isaacs: related http://prog21.dadgum.com/38.html --- Log closed Thu Jul 11 00:00:39 2013