00:00:00  * ircretaryquit (Remote host closed the connection)
00:00:12  <mbalho>oh wait, nvm, got confused with all the r usernames
00:00:43  <rvagg>this would be good, bit pricey tho: http://www.logitech.com/en-au/product/illuminated-keyboard-for-mac-ipad-iphone
00:00:58  <mbalho>rvagg: updated my notes gist with more stuff
00:01:19  <rvagg>thursday morning's are supposed to be the most productive part of my week... you've ruined me now mbalho!
00:01:47  <mbalho>basically all of my work lately has the result of killing the productivity of others
00:02:02  <rvagg>well, at least you're honing a skill
00:02:17  <mbalho>hehe
00:02:18  <ralphtheninja>rvagg: that keyboard looks sweet
00:02:45  <mbalho>ok goin offline, cya
00:06:18  <Raynos>Dominictarr: its better to use and teach standards instead of propietory extensionw
00:08:39  <rvagg>kindle's quick to download and install firmware upgrades... downgraded to 5.3.1 and next reboot gets me 5.3.3... better enable airplane mode
00:08:48  <dominictarr>yeah, so say that
00:09:24  <dominictarr>Raynos: http://catb.org/esr/writings/homesteading/homesteading/ar01s06.html
00:24:08  * mikolalysenkoquit (Ping timeout: 272 seconds)
00:33:21  <substack>defunctzombie_zz, Raynos: https://github.com/substack/module-deps#transforms
00:36:10  <Raynos>dominictarr: I don't know how I fall into habit of telling people what to do instead of explaining it. Maybe stackoverflow.
00:36:41  <dominictarr>stackoverflow is totally different to github
00:37:23  <Raynos>agreed.
00:38:48  <dominictarr>you shouldn't try to make people like you, but you do need to show people respect.
00:54:48  * mikealquit (Quit: Leaving.)
00:56:34  * lyaunzbequit (Remote host closed the connection)
00:56:58  <dominictarr>LOUDBOT COME OUT OF YOUR HOLE
00:56:58  <LOUDBOT>OH SHIT THE LOUDNESS HAS BEGUN
00:58:31  <dominictarr>LOUDBOT: sshhh
00:58:32  <LOUDBOT>dominictarr: AVERAGE EMCEES IS LIKE A TEEVEE BLOOPER. MF DOOM HE LIKE D.B. COOPER
00:59:14  * mmckeggjoined
00:59:57  * mikealjoined
01:07:01  * mikealquit (Quit: Leaving.)
01:09:02  <mbalho>lol
01:12:52  * lyaunzbejoined
01:19:50  * dominictarrquit (Ping timeout: 246 seconds)
01:23:04  * dominictarrjoined
01:32:08  * spionjoined
01:32:34  <spion>yield is not hacky. other languages have had coroutines for ages now and they are fine.
01:36:36  <dominictarr>coroutines are just like streams too!
01:37:15  <dominictarr>number of cores is scaling out fast, need things like this to make use of them
01:37:17  * chrisdickinsonquit (Excess Flood)
01:37:20  * mikealjoined
01:37:53  <substack>they seem to work ok in lua which is very similar to js
01:38:09  <substack>although I rather like callbacks
01:38:36  * chrisdickinsonjoined
01:40:42  <spion>yield feels to me. yield db.query.bind(db, query, params); // hey computer. go do this and tell me when its done so I can continue.
01:40:46  <spion>feels great*
01:42:44  <spion>generator caller then goes like, okay, I call this with a callback, then in the callback if there is an error, I throw it to the generator, otherwise, i tell it to resume with the resulting value.
01:42:55  <spion>maps perfectly well. except for that extra .bind
01:45:34  <substack>for db queries and back-and-forth stateful apis that makes sense
01:45:57  * mikealquit (Ping timeout: 252 seconds)
01:46:58  <dominictarr>yeah, only for things that are sequential, which isn't the common case, we learn in node
01:47:33  <dominictarr>but it seems like that in other langs because that is easy, but doing anything else is really hard...
01:47:57  <spion>you could yield arrays of things, and they would execute in parallel
01:48:15  <spion>or arrays wrapped in a queue object with {concurrency :N}
01:48:29  <dominictarr>it's not always that simple
01:48:43  <dominictarr>like, what if one thing errors? do you stop right then?
01:48:52  <dominictarr>do you collect the errors?
01:49:06  <dominictarr>this can be done easily in userland code
01:51:52  <spion>well - i guess that would depend on the particular case. but you control both the generator and the generator caller (or task handler), so that can be decided inside the task handler depending on the yielded object received.
01:52:05  <spion>I think a good task library could solve that.
01:53:46  <spion>but yeah I wouldn't use yield for everything.
01:58:01  <dominictarr>no, if there is an actual performance benefit to having it, that is great though...
01:58:52  <spion>i think the benefit would be mostly in that boring sequential "do this then do that if this is blah otherwise do something else" code.
01:59:15  * st_lukequit (Remote host closed the connection)
01:59:54  * st_lukejoined
02:03:20  * mikealjoined
02:04:22  <spion>so I am not sure that there will bring any performance benefit - probably it will just bring more expressiveness to JS. a different way to do (some) async stuff.
02:05:20  * ins0mniaquit (Ping timeout: 246 seconds)
02:05:30  <spion>a less async way :)
02:06:13  <spion>i am probably confusing the terms there.
02:07:05  <spion>yield would be sync (in the sense that the generator waits to be called again) but non-blocking (in the sense that it won't block the event loop)
02:07:19  <spion>think I got it right
02:07:33  <Raynos>spion try something like reducers
02:22:52  <spion>hey, thanks, wish i found that before I wrote my async bfs function :)
02:25:08  <spion>its a bit hard to wrap my head around it though
02:25:20  <spion>maybe I should read up on clojure reducers
02:26:01  <spion>from what I read, looks very similar to point free programming - but for collections of stuff
02:56:13  * defunctzombie_zzchanged nick to defunctzombie
02:57:37  <defunctzombie>spion: with the right api you don't need the yield keyword
02:57:48  <defunctzombie>it all just happens behind the scenes and does the right thing :)
02:57:51  <spion>you mean, with something like promised()
02:58:25  * st_lukequit (Remote host closed the connection)
02:58:25  <spion>make all the api deal with promises and only at the end do a .then
02:59:32  <spion>well, that fails because if, for and operators are not functions.
03:00:33  <spion>however, they can be replaced with functions.
03:00:53  <spion>yeah I suppose you could do that and throw away most of the language.
03:02:20  <defunctzombie>spion: no
03:02:30  <defunctzombie>I mean with something like lua coroutines
03:02:38  <spion>oh.
03:02:39  * mikealquit (Quit: Leaving.)
03:02:54  <spion>ah.
03:02:55  <spion>:)
03:02:56  <defunctzombie>if the db library uses a network api that is made to yield on the backend properly
03:03:03  <defunctzombie>you can write code that looks blocking, but isn't
03:03:10  <defunctzombie>just depends on your goals
03:03:23  <defunctzombie>substack: did you get my comments on browser-resolve?
03:04:27  <spion>i am okay with a mandatory yield. its good to have a visual cue about the point where you leave the generator (and things may change under your feet in the meantime)
03:05:50  * tphummelquit (Quit: tphummel)
03:18:48  <defunctzombie>the user should not have to worry about it
03:18:54  <defunctzombie>also, what happens if you forget to yield
03:19:02  <defunctzombie>I think underlying libs should do it
03:21:25  <substack>defunctzombie: comments on insert-module-global?
03:21:33  <defunctzombie>nope
03:21:41  <substack>link?
03:21:43  <defunctzombie>I am thinking of changing the browser-resolve api a bit
03:21:49  <defunctzombie>no link, they were irc comments iirc
03:21:59  <defunctzombie>instead of browser-resolve shipping with core-shims
03:22:12  <defunctzombie>it will instead take an object of shim_name -> filepath mappings
03:22:17  <substack>yes I saw that
03:22:33  <substack>however you want to do it
03:22:40  <defunctzombie>cool, I will bump version when I do that to make it clear
03:22:44  <substack>I have no strong opinions about that
03:22:48  <defunctzombie>kk
03:23:07  <defunctzombie>there is some work going into the node-libs-browser module with lots of tests on testling
03:23:15  <defunctzombie>to get a better comfort level of these shims
03:23:36  <substack>I seem to have found and fixed the bug where sometimes there would be some undefined id
03:23:44  <defunctzombie>substack: fuck, really? nice
03:23:47  <substack>the dependency mapper reduce wasn't checking self._expose
03:23:56  <defunctzombie>have you pushed out the change?
03:24:04  <substack>just published 2.2.6
03:24:05  <defunctzombie>I have a failing thing I can try it on
03:24:06  <substack>just now
03:24:07  <defunctzombie>cool
03:24:09  <defunctzombie>nice
03:24:12  <substack>tests pass on travis
03:24:17  <defunctzombie>also, plans to get v2 on testling?
03:24:17  <substack>it's using the new module-deps code
03:24:20  <substack>with the transform stuff
03:24:21  <defunctzombie>cool
03:24:24  <defunctzombie>awesome!
03:24:26  <substack>defunctzombie: after transforms
03:24:44  <defunctzombie>if you do find time, please revisit the global detection slowness
03:24:53  <defunctzombie>it is a major pain point for enchilada with jquery
03:24:54  <substack>and I want testling to look at your package.json to see what browserify version it should use
03:24:59  <defunctzombie>over 4 seconds to respond
03:25:12  <substack>yes it's a thing I can fix in lexical-scope
03:26:19  <substack>defunctzombie: for now you can b.bundle({ insertGlobals: true })
03:26:22  <substack>to make it fast
03:26:25  <substack>that's what --fast does
03:26:52  <defunctzombie>gotcha
03:26:57  * lyaunzbequit (Remote host closed the connection)
03:27:04  <defunctzombie>but that will also insert process?
03:27:09  <substack>yes
03:27:28  <defunctzombie>I kinda feel like global can be an always insert :/
03:27:40  <defunctzombie>I don't care about process as much
03:27:42  <substack>unacceptable for winning over projects like d3
03:27:51  <defunctzombie>and would gladly opt out of detecting that
03:27:55  * lyaunzbejoined
03:28:22  <defunctzombie>substack: really? it adds 1 character in the minified version
03:28:38  <defunctzombie>two I guess, the comma haha
03:29:10  <substack>I'll just make lexical-scope fast
03:29:15  <defunctzombie>cool
03:29:23  <defunctzombie>for now I will skip the insert globals in enchilada
03:29:33  <defunctzombie>substack: it should be as fast as teh regex ;)
03:29:41  <defunctzombie>for that jquery test
03:29:44  <substack>regex isn't correct
03:29:47  <substack>correct > fast
03:30:21  <substack>cat *.js > bundle.js is fastest of all!
03:31:27  <defunctzombie>haha
03:31:51  <defunctzombie>does regex fail in any case where lexical scope succeeds?
03:32:12  <substack>// process the file
03:32:17  <defunctzombie>no, fail
03:32:25  <defunctzombie>as in fails to add process if it should be
03:32:29  <substack>nope
03:32:31  <defunctzombie>false positive is not a fail
03:32:36  <defunctzombie>also, it won't detect that
03:32:40  <defunctzombie>you have to do process.
03:32:51  <substack>regex only has false positives
03:32:52  * lyaunzbequit (Ping timeout: 272 seconds)
03:33:28  <defunctzombie>meh
03:37:20  <dominictarr>comments are pretty easy to filter out with regexp
03:38:35  <substack>comments, strings
03:38:46  <substack>regex is strictly not powerful enough
03:39:16  <substack>regex is too low on the hierarchy of languages to parse source code
03:40:00  <substack>http://stackoverflow.com/questions/442325/chomsky-hierarchy-and-ll-parsers
03:40:17  <dominictarr>it could handle comments, since they have no syntax anyway
03:40:22  * jibayquit (Read error: Connection reset by peer)
03:40:23  <dominictarr>they are just ignored
03:40:37  <substack>LL grammars like js are context-sensitive
03:41:09  <dominictarr>oh, but then you could have "/* not a comment!*/"
03:41:35  <substack>hahaha http://www.conservapedia.com/Chomsky_hierarchy
03:41:40  <dominictarr>and "// not comment"; process[regularJS]
03:41:42  <substack>dominictarr: yep, among other edge-cases
03:42:01  <substack>why is there a conservapedia entry for chomsky hierarchies
03:42:15  <defunctzombie>I guess my point was that it was good enough
03:42:31  <defunctzombie>and that the current speed loss is worse than the false positive you *may* get
03:42:57  <substack>--fast
03:43:13  <defunctzombie>substack: to be really good, the global wrapper should just be once around the whole bundle
03:43:21  <defunctzombie>and with process actually if needed
03:43:50  <defunctzombie>right now if you have global in every file you will get function(global) { ... file ... } for all the files hahaha
03:44:08  <dominictarr>defunctzombie: what if you do a fast check with regexp, and then parse the regexp test returned positive?
03:44:28  <defunctzombie>fascinating
03:44:33  <defunctzombie>substack: ^
03:44:45  <dominictarr>improving the general case
03:45:03  <defunctzombie>(which is still unrelated to the whole adding global for every file thing)
03:45:05  <substack>dominictarr: that is what insert-module-global already does
03:45:18  <dominictarr>oh, okay, great
03:45:26  <substack>dominictarr: https://github.com/substack/insert-module-globals/blob/master/index.js#L32-L37
03:45:39  <substack>the problem is that massive js blobs like jquery use the word "process" and "global"
03:45:55  <defunctzombie>oh.. that is why I narroed to global.
03:46:38  <dominictarr>what if you memoized by the hash of the code
03:46:47  <defunctzombie>I guess that won't catch the case of global then .foo() on the next line.. but you can make a regex for that actually too
03:47:15  <dominictarr>if the hash is the same, and you already know whether that hash has globals, then you don't need to parse it
03:47:30  <substack>dominictarr: early versions of detective that were slow did that
03:47:32  <dominictarr>and jquery and d3 don't change often
03:47:36  <substack>but now it's fast so it doesn't matter
03:47:36  <defunctzombie>well, this isn't about that
03:47:54  <defunctzombie>this is about the initial bundle time and dynamic rebundling :/
03:48:05  <defunctzombie>it isn't fast enough! more power!!!
03:55:40  <defunctzombie>substack: ran latest browserify on a failing test case I had
03:55:43  <defunctzombie>substack: works
03:55:45  <defunctzombie>nice job
03:58:23  <substack>need to get browserify incredibly solid
03:58:42  <substack>then we get everybody to put their browser modules on npm with a solid testling-ci test suite
03:58:51  <substack>then everybody wins! yay modularity
03:58:58  <defunctzombie>did you see the stuff Raynos asked about mock and the .cache and .resolve stuff?
03:59:13  <substack>didn't follow that
04:00:01  <defunctzombie>after thinking about it some more, I don't think it will be as easy to do as I first thought
04:00:09  <defunctzombie>basically, he has a module "mock"
04:00:17  <defunctzombie>which uncaches a require
04:00:37  <defunctzombie>then re-requires some module passing in a different require function that has some requires replaced
04:00:40  <substack>what about using the fallback mechanism?
04:01:07  <substack>or just the { expose: 'fs' } trick
04:01:11  <defunctzombie>substack: would need a way to uncache a module tho I think
04:01:18  <substack>why's that?
04:01:26  <defunctzombie>let me show you his code example
04:01:28  <defunctzombie>it will be clearer
04:01:42  <defunctzombie>https://github.com/Colingo/mock
04:02:30  <defunctzombie>if you look at what it basically has to do which is to pass the same require string to the "mock" call
04:02:47  <defunctzombie>pass in what we call the "cache" in browser-pack land
04:02:55  <defunctzombie>and then the require function I guess
04:02:56  <substack>what about just masking the require() function?
04:03:26  <defunctzombie>yea, but how would that happen within the code?
04:03:31  <substack>var oldRequire = require; require = function (x) { if (x === 'fs') { /* ... */ } else return oldRequire(x) }
04:03:51  <defunctzombie>so he does this on a per require basis
04:04:03  <defunctzombie>so this mock is only for ./fixtures/b
04:04:04  <dominictarr>oh no, mocking is an anti pattern
04:04:08  <defunctzombie>and the things it loads
04:04:11  * coffeecupquit (Ping timeout: 245 seconds)
04:04:25  <dominictarr>use dependency injection if you want to mock stuff
04:04:32  <dominictarr>because you should feel the pain
04:04:40  <defunctzombie>dominictarr: and how would you dependency inject in this case?
04:04:49  * guybrushquit (Ping timeout: 248 seconds)
04:05:02  <dominictarr>module.exports = function (dbConnection) { return myModule }
04:05:03  <defunctzombie>so lets say he has something that calls some other functions in modules which do ajax stuff or whatnot
04:05:09  <defunctzombie>hm
04:05:19  <dominictarr>pass the dep you want to mock
04:05:22  <defunctzombie>this is worse imho as it makes your apis very strange
04:05:35  <defunctzombie>mock is a way to do dependency injection
04:05:37  <dominictarr>it is bad, because mocking is bad
04:05:53  <defunctzombie>you are injecting what those dependencies will become
04:06:01  <defunctzombie>dominictarr: pretend it is called "require_replace"
04:06:12  <dominictarr>building it into the module system puts uglyness where is doesn't belong
04:06:22  <isaacs>whoa whoa whoa...
04:06:25  <isaacs>you guys
04:06:30  <defunctzombie>hahaha
04:06:40  <isaacs>are you talking about a full on generalized mocking whatever?
04:06:47  <defunctzombie>no
04:06:52  <defunctzombie>I am talking about this little module
04:07:03  <isaacs>ok
04:07:04  * isaacswhew
04:07:16  * defunctzombiecrisis averted
04:07:27  <isaacs>haha
04:07:39  <dominictarr>but the little module does mocking, right?
04:08:04  * lyaunzbejoined
04:08:20  <defunctzombie>dominictarr: this is the same as dependency injection
04:08:20  <dominictarr>brb eats
04:08:27  <defunctzombie>you are just injecting at the require level
04:10:49  <dominictarr>doesn't bfy already have that feature, because it does something like that to inject browserify-* modules?
04:11:58  <defunctzombie>dominictarr: that is at the bundling level, this is within the code itself (for testing as I have been told)
04:13:06  <defunctzombie>since testling doesn't have a good way to test ajax requests really, this stuff becomes more important for libs that need it I think
04:13:28  <defunctzombie>in any case, I thought it was a neat trick that works on node and bfy v1 but not v2
04:16:46  * coffeecupjoined
04:16:46  * guybrushjoined
04:28:34  * dguttmanquit (Quit: dguttman)
04:32:38  <isaacs>mocking IS the same as dependency injection
04:38:28  * dguttmanjoined
04:40:45  <defunctzombie>isaacs: yes
04:41:08  <dools>dominictarr: haha not bad
04:41:30  <dools>dominictarr: incidentally that was me replying to something you said about 8 days ago (was paged up)
04:41:30  <dominictarr>dools: huh?
04:41:37  <dools>(and didn't realise it)
04:41:39  <dominictarr>ha
04:41:47  <dools>IT'S SEMANTIC VERSIONING NOT SENTIMENTAL VERSIONING
04:41:48  <LOUDBOT>BECAUSE MOFINO SAYS NOTHING MATTERS AND HAS NO EFFECT
04:42:12  <defunctzombie>wow
04:57:28  <Raynos>dominictarr: mocking is an anti pattern but its useful for unit tests
04:59:03  <Raynos>substack: this is useful for tests and only tests. I don't care if the mock API is dirty / ugly / a disaster. It just needs to work somehow
04:59:38  * spionquit (Ping timeout: 246 seconds)
05:03:13  <defunctzombie>Raynos: did that browser /a -> browser/a thing work as expected for you?
05:03:23  <Raynos>dont know
05:03:28  <Raynos>not using browserify2.0 in prod
05:03:43  <Raynos>building an `EventLogHttpServer` atm
05:03:44  <defunctzombie>ah ok
05:03:53  <Raynos>I should put some java beans in that function name
05:06:41  <defunctzombie>yes
05:17:21  * defunctzombiechanged nick to defunctzombie_zz
05:26:08  <mbalho>rvagg: do you have any thoughts on if its possible to run node on kindle?
05:26:34  <rvagg>mbalho: I just got kterm going actually; still getting to the node bit
05:26:37  <rvagg>BUT WHY NOT?
05:26:37  <LOUDBOT>WHAT THE FUCK *IS* THAT.
05:26:43  <rvagg>NODE!
05:26:59  <mbalho>rvagg: ah cool
05:27:06  <rvagg>mbalho: listening to your lxjs talk in the background as it so happens
05:27:32  <mbalho>rvagg: its probably uninteresting to you since you 'get it' already :P
05:27:58  <mbalho>rvagg: also forgot if i mentioned it earlier but i figured out how to get kterm to rotate into landscape but it breaks the on screen keyboard
05:28:18  <substack>Raynos: fs.readFileSync() asset loading plugin coming soon
05:28:26  <substack>a good reason to upgrade
05:28:37  <rvagg>mbalho: yeah, I have your kterm github issue open for that
05:28:51  <rvagg>tho I haven't downloaded that binary yet
05:29:11  <mbalho>rvagg: i was thinking that if http://www.evilpaul.org/wp/?p=504 ran we could write our own
05:29:32  <mbalho>rvagg: but i dont know if kindle browser does canvas or not
05:29:53  <rvagg>mm, I have no idea about the browser on there, I try not to touch it
05:30:41  <mbalho>rvagg: apparently the new ebook format they use is just html5
05:31:08  <rvagg>with shiny drm
05:31:12  <mbalho>hah
05:40:34  <mbalho>rvagg: http://i.imgur.com/Jxvq8iN.png is http://evilpaul.org/content/textmode/example2/
05:40:48  <mbalho>:(
05:41:07  * dguttmanquit (Quit: dguttman)
05:41:20  <rvagg>mm, that's not happy
05:41:27  <rvagg>closeish
05:46:08  <mbalho>rvagg: how awesome would it be to run node + leveldb on the kindle and use the browser to open localhost:8080 and you code in browser and it syncs it up to the internets whenever you next go online
05:46:56  <rvagg>too awesome to imagine....
05:52:28  <rvagg>mbalho: got a node to cross compile fine, but need to match the glibc version on kindle
05:52:38  <Raynos>substack: Nice! I also need to hack on --debug back on it
05:52:39  <rvagg>2.12
05:52:41  <Raynos>maybe as a transform plugin
05:57:22  * Correnjoined
06:02:12  <substack>yep
06:21:27  * shamaquit (Remote host closed the connection)
06:31:25  * Raynoschrisdickinson: https://github.com/chrisdickinson/browservefy/pull/11
06:38:12  * substacktopic: Unofficial browserling/testling mad science channel. For official help /join #browserling
06:40:06  * niftylettucequit (Ping timeout: 272 seconds)
06:43:30  * substacktopic: Unofficial browserling/testling mad science channel. For official help /join #browserling
06:46:08  * substackquit (Ping timeout: 255 seconds)
06:46:48  * substackjoined
06:47:04  * mirkokquit (Quit: mirkok)
06:51:22  <substack>beep boop
06:51:25  * mirkokjoined
06:58:17  * dominictarrquit (Ping timeout: 255 seconds)
06:58:53  <substack>https://github.com/substack/node-browserify#btransformtr
07:00:56  <substack>defunctzombie_zz, Raynos: ^^^
07:07:23  * dominictarrjoined
07:21:43  * dominictarrquit (Quit: dominictarr)