00:00:00  * ircretaryquit (Remote host closed the connection)
00:00:03  <Raynos>:D
00:00:04  <Raynos>sec
00:00:06  <Raynos>ill fix it
00:00:07  * ircretaryjoined
00:07:26  * st_luke_quit (Remote host closed the connection)
00:07:57  <defunctzombie>browser field use makes me happy
00:12:49  <substack>https://github.com/substack/hyperspace#requesting-more-data
00:14:01  <substack>shows how to load updates on demand in addition to the realtime feed
00:15:21  <substack>juliangruber: ^^^^
00:15:29  <substack>also Raynos et all
00:16:11  <Raynos>substack: thats a bad idea most of the time
00:16:18  <Raynos>I wrote a more streaming thing with sockjs one time
00:16:33  <Raynos>100% over engineered. XHR polling with offset over a REST interface is so much simpler and better
00:19:16  <defunctzombie>I actually like the angular js approach to templates/binding (at least hte idea of it) have yet to actually try it myself
00:19:24  <defunctzombie>I like their notion of directives and scope
00:19:24  <Raynos>:(
00:20:13  <defunctzombie>I looked for modules that would do it
00:20:19  <defunctzombie>cause their tutorials don't make sense to me
00:20:26  <defunctzombie>thus I have never used it really
00:21:03  <defunctzombie>I want to pick and choose parts of it but because it is one whole thing I cannot :(
00:21:15  <substack>defunctzombie: I hate the angular approach so much.
00:21:22  <defunctzombie>which part of it?
00:21:36  <substack>the part where it adds a bunch of logic to the html
00:21:50  <substack>click handlers, stream targets
00:22:04  <defunctzombie>I dunno how I feel about that stuff yet (click handlers)
00:22:14  <defunctzombie>the model stuff I am not totally against, but dunno yet
00:22:50  <substack>Raynos: it seems to work really well here, the only data going over the wire is newline-separated json that looks like {"who":"substack","message:"beep boop"}
00:23:06  <Raynos>It doesnt work cleanly at scale
00:23:11  <Raynos>or is hard to do at scale
00:23:16  <Raynos>i did a similar thing and piped a mongodb cursor down it
00:23:18  <Raynos>worst idea ever
00:23:20  <substack>everything is hard to do at scale
00:23:33  <substack>are you sure that wasn't a mongodb thing?
00:23:35  <Raynos>streams are an order of magnitude harder to do at scale then HTTP
00:24:05  <Raynos>it was partly mongo's fault, partly my shitty stream abstractions, partly that sockJS memory leak and partly just "WHY ARE THERE SO MANY PIECES. THIS IS EASY AS A HTTP GET"
00:26:15  <substack>dunno, there aren't very many pieces in this at all
00:26:24  <substack>and the only data going over the wire is the row data
00:26:35  <substack>so it's like http but much less overhead
00:26:50  <substack>and the server renders the first chunk of content using the same rendering logic that the client users
00:26:53  <substack>*uses
00:27:28  <yorick>http gets are terribly hard
00:28:28  <yorick>well, 1.1 is where the trouble starts with pipelining and keepalive
00:29:35  * ralphtheninjaquit (Ping timeout: 256 seconds)
00:29:49  * defunctzombiechanged nick to defunctzombie_zz
00:29:57  <Raynos>substack: server side rendering is definetely a good idea
00:30:04  * yorickquit (Remote host closed the connection)
00:40:03  * st_lukejoined
00:54:59  * thl0quit (Remote host closed the connection)
01:19:52  * mcollinaquit (Read error: Connection reset by peer)
01:19:58  * mcollina_joined
01:33:09  * AvianFluquit (Remote host closed the connection)
01:41:32  * defunctzombie_zzchanged nick to defunctzombie
02:05:08  * thl0joined
02:06:14  * thl0quit (Remote host closed the connection)
02:11:13  * mikolalysenkoquit (Ping timeout: 252 seconds)
02:28:41  * mikolalysenkojoined
02:33:11  * jolissjoined
02:36:25  * timoxleyjoined
02:42:38  * thl0joined
02:43:33  * st_lukequit (Remote host closed the connection)
02:51:12  * jcrugzzquit (Read error: Connection reset by peer)
02:51:56  * jcrugzzjoined
02:53:24  * mikolalysenkoquit (Ping timeout: 245 seconds)
03:19:39  * mikolalysenkojoined
03:27:58  * mikolalysenkoquit (Ping timeout: 246 seconds)
03:45:04  * mikolalysenkojoined
04:22:34  * vitorpachecoquit (Remote host closed the connection)
04:22:43  * timoxleyquit (Quit: Computer has gone to sleep.)
04:23:11  <thl0>Raynos: substack: testlingify is now a thing - npm install testlingify - same interface as travisify
04:23:46  <substack>yay!
04:24:09  <substack>does it update the package.json?
04:24:16  <thl0>of course!
04:24:17  * vitorpachecojoined
04:24:21  <substack>right-o
04:24:24  <thl0>and preserves formatting for minmal diffs
04:24:33  <substack>installing
04:25:38  <substack>I'll give it a spin on my next repo
04:25:43  <thl0>cool
04:26:09  <thl0>I did not do the readline thing, requireing to edit the config it not too much to ask I thinkg ;)
04:27:53  <thl0>substack: you could also try test and badge on your existing once to see it working
04:30:39  * thl0quit (Remote host closed the connection)
04:45:11  * timoxleyjoined
04:45:53  * timoxleyquit (Client Quit)
04:48:57  <owen1>i am working on a repo that demonstrate building website with no frameworks. i want to write the issues with express, but for people that are not experts. i know of 2 main issues - not working well with node streams and connect/middleware has a 'style' that is not competible with the node style so middleware can't be used outside of connect. can someone help me understand the details of those 2 claims and
04:48:59  <owen1>maybe correct and expand on it?
04:49:51  <owen1>(i want to drill down to connect code base if needed)
04:50:20  <owen1>i heard something about continuation passing but not sure if it's related.
04:57:12  * thl0joined
04:57:55  * thl0quit (Remote host closed the connection)
05:01:50  <substack>owen1: what's wrong with http.createServer?
05:02:12  <substack>if you want routing, use a routing module
05:02:21  <substack>if you want to serve static assets, use a static asset module
05:02:41  <substack>you can just use modules on top of a vanilla http server
05:02:41  <owen1>substack: yeah. that's what i want to demonstrate! https://github.com/oren/node-website-template
05:03:14  <owen1>i want to create a project that newcomers can use as an example.
05:03:38  <substack>oh wait so what part will use express then?
05:03:39  <owen1>but i want to elaborate about the issues with connect/middleware
05:03:56  <owen1>i want to tell them why express is not the best choice.
05:04:09  <substack>it's just annoying since you've got to worry about the order of middleware and you've got to apply the middleware correctly
05:04:17  <owen1>but it's hard for me to understand why.
05:04:28  <jesusabdullah>because a lot of time what you want to do is non-linear
05:04:40  <substack>and middleware often sets properties like req.cookeies that don't compose well
05:05:33  <owen1>sorry. but everything u just said is great if u really understand node. or middleware. is there a simple explanation? i don't understand what you guys just said.
05:06:09  <owen1>maybe it's just me?
05:06:16  <owen1>non-linear
05:06:21  <owen1>compose
05:06:28  <substack>suppose you have a middleware that needs cookie data
05:06:34  * timoxleyjoined
05:06:34  <owen1>ok
05:06:40  <substack>it expects req.cookies to exist
05:06:55  <owen1>ok. so middlewares add properties to the request object?
05:07:04  <substack>so now either: 1) the middleware forces users to use a cookie parser strictly before it
05:07:32  <substack>or 2) the middleware requires the cookie middleware internally, which introduces extra side effects and duplicates parsing
05:07:46  <substack>whereas if it just took cookies as an input parameter instead, it wouldn't have that problem
05:08:07  <substack>owen1: cookieParser and bodyParser do
05:08:24  <substack>bodyParser concatenates POST data to populate req.body
05:08:41  <substack>which obviously doesn't play well with streams because it buffers all the content
05:08:47  <owen1>i lost u. let me look at the code base of those middleware
05:08:50  <owen1>s
05:08:59  <substack>so you've got to be really careful to never do app.use(express.bodyParser())
05:09:18  <owen1>so if i use middleware i can use node streams?
05:10:09  <substack>yes you've just got to be careful
05:10:11  <substack>but also
05:10:16  <substack>one huge problem
05:10:22  <substack>is that if you have an async middleware stack
05:10:34  <substack>the middlewares are going to be firing
05:10:43  <substack>meanwhile data is coming in from the request
05:10:55  <substack>so it needs to be buffered by the engine or explicitly paused and buffered
05:11:02  <substack>and then resumed once it hits user code
05:11:12  <substack>there is no clean way to do that aside from making it explicit
05:11:31  <substack>streams2 addresses that somewhat but it will still buffer if the other side keeps sending data
05:11:38  <substack>inflating memory usage
05:11:49  * timoxleyquit (Quit: Computer has gone to sleep.)
05:12:16  <substack>of course, if you try to set up async actions before consuming a stream with core http you will have the same problem
05:12:23  <substack>but you get the (req,res) immediately
05:12:29  <substack>so it's completely your fault
05:13:36  <owen1>so by using express u are more prone to memory inflation due to using async middlewares.
05:18:25  <owen1>i'll read your explanations again and also look ot cookieParser and bodyParser to get a better idea of the first issue (composition) you talked about. thanks
05:21:54  * timoxleyjoined
05:24:34  <substack>it's mostly just not a very useful approach for handling the kinds of things you need a webserver to do
05:25:48  <substack>serving static files, parsing POST data, parsing cookies, routing, auth
05:26:06  <substack>all can be handled quite nicely just by explicitly passing req and res around as necessary
05:26:18  <substack>or by returning a stream and piping that to res as the case may warrant
05:26:52  <substack>middleware forces a pre-declared stack of (req,res,next) functions on top of your routes
05:30:05  <jesusabdullah>middleware was a hack invented while solving a problem node doesn't have
05:32:32  <substack>in ruby and perl middleware is a thing that people care about
05:35:56  <owen1>yeah. i am coming from ruby/sinatra world
05:36:10  <owen1>jesusabdullah: what problem was it trying to solve?
05:36:30  <owen1>commond way to build apps on top of dispatcher?
05:36:51  <owen1>(dispatcher = webrick/thin/mongrel/unicorn)
05:40:25  * mikolalysenkoquit (Ping timeout: 252 seconds)
05:41:10  * mikolalysenkojoined
05:54:57  * chrisdickinsonquit (Ping timeout: 361 seconds)
05:55:57  * chrisdicojoined
06:31:02  <jesusabdullah>owen1: the problem wsgi solves, which is creating a common interface for web servers such that you can either use something like gunicorn or write a x-to-wsgi handler
06:31:29  <jesusabdullah>owen1: middleware was the realization that you could write a "wsgi-to-wsgi adapter"
06:32:36  <substack>I'm going to start referring to browsers as "surfers"
06:32:39  <substack>servers and surfers
06:32:47  <substack>downright symmetric
06:35:38  * vitorpachecoquit (Quit: Saindo)
06:38:19  <owen1>jesusabdullah: got it
06:45:43  * mikolalysenkoquit (Ping timeout: 246 seconds)
06:53:14  * mikealquit (Read error: Connection reset by peer)
06:58:36  * mikealjoined
07:08:11  * stagasjoined
07:21:12  * FireFlyquit (Excess Flood)
07:21:38  * FireFlyjoined
07:28:04  * FireFlyquit (Ping timeout: 246 seconds)
07:38:28  * jcrugzzquit (Ping timeout: 256 seconds)
07:39:18  <substack>hey look I made a hater news comment https://news.ycombinator.com/item?id=5770000
07:40:21  * FireFlyjoined
07:43:26  <rvagg>substack: "dwindled in size" is not true, backbone is the smallest of the "modern" frameworks sadly
07:43:50  <rvagg>Ember, because it's already huge and depends on both handlebars and jquery apparently bloats in at 269K minified!
07:44:19  <rvagg>there seems to be a trend towards embiggining
07:48:28  <substack>there is!
07:48:35  <substack>I had no idea.
07:48:39  <substack>this is most worrying
07:48:48  <substack>well at least it will be their undoing
08:00:37  <juliangruber>substack: so hyperspace just replaced sorta?
08:02:09  <substack>it does what sorta does better but it has a broader scope
08:02:50  <substack>even though the whole thing is just 111 sloc
08:04:04  <substack>sorta put the sort function on the server but it makes much more sense to put it on the client
08:04:25  <substack>that way the server can just send dumb objects from the realtime stream and from on-demand content
08:04:45  <substack>and the client will figure out the correct place to put everything on its own using a simple insertion sort over the childNodes of the container
08:05:59  <substack>and the best part is that this approach works even if the server rendered some of the rows and the browser rendered some of the rows
08:06:18  <substack>because both sides use the same rendering logic so the browser can just step through the dom to enumerate the rows
08:06:43  <substack>this is such a nice way of doing it
08:08:31  <juliangruber>:O
08:08:36  <juliangruber>hyperspace is big
08:08:59  <juliangruber>your explanation just solved some problems of my current app
08:09:07  <juliangruber><3
08:19:46  <substack>the big problem is that you've got the realtime updates and then you've got the on-demand loads
08:19:49  <substack>like on twitter
08:20:03  <substack>you get new tweets but if you scroll to the bottom it lazy loads old tweets
08:20:09  <substack>both of those go through the same data pipe
08:20:33  <substack>with hyperspace you just write a sort function and the browser code figures out where to render each row on its own
08:20:44  <substack>and the server can be dumb and just send the raw objects
08:27:38  <juliangruber>in my case the realtime updates arrive via another server / api, but just works too
08:29:01  <substack>oh even better actually
08:29:15  <substack>otherwise you would need to coordinate the ordering server-side from multiple data sources
08:29:34  <substack>but my moving that sorting browser-side it all just SORTS ITSELF OUT
08:29:37  <substack>so to speak
08:29:45  <juliangruber>haha :D
08:51:29  * ralphtheninjajoined
09:06:51  <substack>I'll rewrite my blog to use hyperstream then do a proper blog post about it
09:07:10  <substack>then I'll do another post about hyperspace+hyperglue
09:09:19  <juliangruber>and make music honoring all the hyper
09:17:39  <rvagg>+1 for the blog posts
09:22:56  <ralphtheninja>hyperstream looks neat
09:32:37  * purrquit (Remote host closed the connection)
09:32:44  * purrjoined
09:33:54  * juliangruber_joined
09:37:04  * ralphtheninjaquit (Read error: Operation timed out)
09:38:48  <juliangruber_>to build znc on smartos, pass --disable-tdns
09:39:18  <juliangruber_>g++ doesn't understand -mt there
10:00:58  * juliangruberquit (Remote host closed the connection)
10:00:58  * juliangruber_changed nick to juliangruber
10:19:46  * jibayjoined
10:30:21  * stagasquit (Read error: Connection reset by peer)
10:37:01  * mcollina_quit (Read error: Connection reset by peer)
10:42:30  * Madars_quit (Ping timeout: 240 seconds)
11:10:37  * ins0mniajoined
11:15:06  * Madarsjoined
11:38:27  * jolissquit (Quit: joliss)
11:39:36  * jolissjoined
11:56:18  * mcollinajoined
11:56:44  * yorickjoined
12:00:01  * mint_xianquit (Ping timeout: 246 seconds)
12:01:14  * mint_xianjoined
12:02:28  * chrisdicoquit (Ping timeout: 246 seconds)
12:03:52  * chrisdickinsonjoined
12:10:23  * st_lukejoined
12:13:54  * jolissquit (Quit: joliss)
12:58:32  * ins0mniaquit (Ping timeout: 252 seconds)
13:05:05  * st_lukequit (Read error: Connection reset by peer)
13:22:33  * ins0mniajoined
13:36:28  <tanepiper>making an irc bouncer/server?
13:45:29  * mikolalysenkojoined
14:03:04  <elliottcable>Er.
14:03:06  <elliottcable>https://ci.testling.com/elliottcable/Paws.js
14:03:22  <elliottcable>Image doesn't match the latest push. Or am I missing something? Seems completely unrelated, in fact.
14:14:50  * st_lukejoined
14:39:41  * thl0joined
14:40:58  <timoxley>elliottcable what is paws
14:48:26  * AvianFlujoined
14:48:27  * timoxleyquit (Quit: Computer has gone to sleep.)
14:48:41  * AvianFluquit (Client Quit)
14:51:40  <elliottcable>prog language of mine
14:52:34  <elliottcable>was described earlier today thus:
14:52:43  <elliottcable><devyn> whitequark: baaasically, it's a language designed around concurrency. think coroutine procedures (but not quite, and more flexible) + a data access model somewhat like STM
14:52:55  <elliottcable>close 'nuff, I suppose.
14:57:31  * mikolalysenkoquit (Ping timeout: 264 seconds)
15:22:09  * mikolalysenkojoined
15:35:30  <owen1>i need your help guys: http://www.reddit.com/r/node/comments/1f2ps0/template_for_vanilla_nodejs_website_or_web_service/
15:35:41  <owen1>"I think middleware in Express is probably the best abstraction I've seen in any framework I used so far. It allows me to create small building blocks which gives me fast development and is easy to understand."
15:35:55  <owen1>"You don't say why it isn't a good approach for middleware. I find an array of functions that works on a set of data very straight forward, functional and easy to test."
15:36:00  <owen1>stack(req, res, [ formParser, cookieParser, Router, Auth ]);
15:36:42  <owen1>if you can articulate your opinions in english, please reply to that guy
15:39:31  * eccloudquit (Ping timeout: 264 seconds)
15:39:31  * mcollinaquit (Read error: Connection reset by peer)
15:39:49  * Raynosquit (Ping timeout: 246 seconds)
15:40:19  * mcollinajoined
15:40:56  <juliangruber>sadly I think the npmjs website rewritten in express would work better too
15:41:03  <juliangruber>look better / be more maintainable
15:41:03  * mcollinaquit (Read error: Connection reset by peer)
15:41:18  <juliangruber>we just don't have all the right abstractions yet
15:41:34  <juliangruber>which doesn't mean that it's good to go with express or another framework!
15:43:03  <owen1>agree
15:43:05  <juliangruber>owen1: in the example of app.get('/', db.user('id')) …, if you were to write that with callbacks it would be 3 levels of nesting, that's not bad at all
15:44:30  <juliangruber>oh, and (re npmjs website again): he is right that when you compose simple libraries while writing an app you're likely to have a framework for your app. but that's ok! it only exists there and consists of decoupled parts
15:44:43  <owen1>yeah! let me try it writing it myself.
15:45:06  <juliangruber>you should def. write an example where streaming is super useful, possible using JSONStream
15:45:21  <juliangruber>*possibly
15:45:33  * mcollinajoined
15:45:46  <owen1>juliangruber: i would not be able to do that since i am not good at streaming yet ):
15:46:01  <owen1>things will change after nodeconf!
15:46:08  <juliangruber>owen1: but that's kinda helpful in arguing against express :P
15:46:32  <owen1>that's why i am asking here. where smart people live (:
15:47:04  <owen1>i know there are 2 big issues with connect - hard to compose and buffering when using async middlewares and streams.
15:47:18  <owen1>it just that i never had to deal with kind of stuff yet.
15:48:17  <owen1>but someone that tried it and can write a concide code sample to show those issue would be awesome.
15:48:24  <owen1>concise
15:48:47  <juliangruber>but why did you start to argue against express in the first place then?
15:49:02  <owen1>i trust smarter people like substack..
15:49:40  <owen1>even if i haven't had issues with express. i want to adopt a simple and node echo-friendly approach in my apps.
15:50:30  <owen1>and it's kind of sad that express is the only suggestion that newcomers hear about.
15:51:37  <juliangruber>coming from php it's still freaking amazing :P
15:51:46  <owen1>so i wrote this no express template that can be an alternative option for newcomers. but now it's about articulating (with good code samples) what pain does it mitigate.
15:52:05  <owen1>(composability, streaming, etc)
15:55:00  * purrquit (Remote host closed the connection)
15:55:08  * purrjoined
15:56:37  * purrquit (Remote host closed the connection)
15:56:45  * purrjoined
15:57:36  * purrquit (Remote host closed the connection)
15:57:42  * purrjoined
16:02:16  * purrquit (Remote host closed the connection)
16:02:24  * purrjoined
16:02:29  <owen1>juliangruber: is that a good callback example? http://pastebin.com/eBjMnZ8F i don't think the validation function should be async, correct me if i am wrong
16:03:24  * purrquit (Remote host closed the connection)
16:03:31  * purrjoined
16:04:03  * isaacs_joined
16:04:06  * shadghos1joined
16:04:07  * pkrumins_joined
16:04:07  * gildean_joined
16:04:13  * pkrumins_quit (Changing host)
16:04:13  * pkrumins_joined
16:04:18  * purrquit (Remote host closed the connection)
16:04:21  * jez0990_joined
16:04:26  * isaacsquit (Disconnected by services)
16:04:31  * isaacs_changed nick to isaacs
16:04:45  * purrjoined
16:11:20  <owen1>substack: http://www.reddit.com/r/node/comments/1f2ps0/template_for_vanilla_nodejs_website_or_web_service/ca6bwng
16:11:36  <owen1>about tape: "I am fairly amused at the author's insistence of using a test library that doesn't even use the nodejs builtins for testing."
16:11:48  <owen1>"pssst, mocha does it better"
16:12:17  * purrquit (Remote host closed the connection)
16:12:25  * purrjoined
16:15:54  * purrquit (Remote host closed the connection)
16:16:17  * purrjoined
16:16:20  <juliangruber>:D
16:16:30  <juliangruber>owen1: yeah the example looks good
16:16:40  <juliangruber>except that I wouldn't have res.error and res.template
16:17:10  <juliangruber>you can do `var error = _error(req, res)` and then later `return error(err)`
16:17:10  * purrquit (Remote host closed the connection)
16:17:11  * mcollinaquit (*.net *.split)
16:17:14  * gildeanquit (*.net *.split)
16:17:15  * jez0990quit (*.net *.split)
16:17:15  * shadghostquit (*.net *.split)
16:17:16  * pkruminsquit (*.net *.split)
16:17:18  <juliangruber>so error knows about req and res
16:17:19  * purrjoined
16:17:29  <juliangruber>but you didn't augment the `res` object
16:17:35  * shuaibjoined
16:18:26  <juliangruber>owen1: or http://pastebin.com/QXVSGvQt
16:26:33  <owen1>juliangruber: just to make sure we are on the same page - res.error and res.template are functions that I added in the server.js file - res.error = ErrorPage(req, res, { 404: 'not found!' }); res.template = Templar(req, res, templarOptions);
16:27:04  <juliangruber>yes
16:27:18  <owen1>so i am not sure what error = _error(req, res) does. what is _error
16:27:18  <juliangruber>but i don't think etending res is a good thing
16:27:46  <owen1>that's what isaacs is doing in www-npm
16:28:35  <owen1>https://github.com/isaacs/npm-www/blob/master/decorate.js
16:29:18  <juliangruber>owen1: https://gist.github.com/juliangruber/5653265
16:29:55  <juliangruber>owen1: that isaacs does it doesn't mean it's good to do
16:29:58  <mikolalysenko>I don't really accept the hypothesis that npm is terrible
16:30:21  <mikolalysenko>it actually looks pretty good to me, though I haven't looked at the code for any big express sites to compare
16:30:25  <mikolalysenko>maybe they are better, not sure
16:30:40  <owen1>juliangruber: nice! u encapsulate the res,req in a closure
16:31:01  <juliangruber>owen1: this disadvantage is that you have to pass `error` everywhere that's called
16:31:17  <juliangruber>you could make an object of all those functions (like error and template) though
16:31:19  <mikolalysenko>juliangruber: other problem with that is you allocate an extra closure per request
16:31:28  <mikolalysenko>or actually two to be more precise
16:31:31  <owen1>good point
16:31:33  <juliangruber>and don't get the nasty feeling of extending native things
16:31:56  <juliangruber>mikolalysenko: if that's a serious problem for your app then yes, don't do that
16:32:09  <juliangruber>but I've not run anything where creating extra closures is a problem
16:32:11  <mikolalysenko>juliangruber: sure, and it probably isn't an issue for most things
16:32:14  <mikolalysenko>well, it can be
16:32:36  <juliangruber>and if that's a problem, then just do `error(req, res, "FOOO")`
16:32:42  <mikolalysenko>if you are processing socket messages you don't want to do that
16:32:48  <juliangruber>yes
16:32:56  <mikolalysenko>this is also why socket.io hogs up tons of memory is because it uses that style all over the place
16:33:30  <juliangruber>but we're not talking about those kinds of things
16:33:37  <juliangruber>its about just another webapp
16:33:44  <mikolalysenko>sure, for serving html pages that approach is fine
16:34:11  <mikolalysenko>but it might be worth considering other options if you are doing ajax/websockets/real time stuff
16:35:25  <juliangruber>if you're running on super high load, sure
16:35:30  <juliangruber>but that's the 1% use case
16:35:38  <mikolalysenko>or making a web game for example
16:35:42  <owen1>are you guys talking about _error that holds req and res in it?
16:35:56  <juliangruber>we're talking about creating closures on each request
16:35:58  <juliangruber>which is nice
16:36:04  <juliangruber>but costs performance
16:36:08  <juliangruber>marginally
16:36:14  <mikolalysenko>depends how often it happens
16:36:25  <mikolalysenko>it does create a lot of garbage
16:36:36  <mikolalysenko>and the closures aren't short lived either since they go off to the event loop
16:36:41  <mikolalysenko>which makes collection slower
16:37:05  <owen1>juliangruber: 'creating closure' means allocating memory space for the req, and res objects (in our case), right?
16:37:17  <juliangruber>owen1: yes
16:38:13  * mcollinajoined
16:38:16  <mikolalysenko>I think it is ok, and even a good idea to use that style for making http pages/simple templating/database stuff
16:38:52  <mikolalysenko>but it is bad to create closures in a real time setting, like handling web socket/ajax data
16:39:24  <juliangruber>mikolalysenko: a 1000 req/s simple website is as high load as a 10 req/s webapp with 100 socket messages per second
16:39:29  <juliangruber>it really depends on the scale
16:40:24  <mikolalysenko>absolutely
16:40:34  * jcrugzzjoined
16:40:35  <mikolalysenko>anyway, sorry to interrupt this is probably just distracting
16:40:47  <owen1>it's actually very insightful
16:47:09  * pkrumins_changed nick to pkrumins
16:48:07  * thl0quit (Remote host closed the connection)
16:49:45  * thl0joined
16:52:35  * thl0quit (Remote host closed the connection)
16:55:32  * thl0joined
16:58:34  * jcrugzzquit (Ping timeout: 246 seconds)
16:59:20  * ralphtheninjajoined
16:59:58  * thl0quit (Ping timeout: 246 seconds)
17:04:25  * stagasjoined
17:06:25  * gildean_changed nick to gildean
17:08:34  * mikealquit (Quit: Leaving.)
17:13:44  * mikealjoined
17:25:20  * defunctzombiechanged nick to defunctzombie_zz
17:31:39  * mikealquit (Quit: Leaving.)
17:37:22  * eccloudjoined
17:37:50  * saijanai_joined
17:37:51  * saijanai_quit (Remote host closed the connection)
17:38:23  * brianloveswordsquit (Excess Flood)
17:40:37  * brianloveswordsjoined
17:49:21  * Raynosjoined
17:49:38  * yorickquit (Remote host closed the connection)
18:12:43  * st_lukequit (Ping timeout: 276 seconds)
18:14:48  * AvianFlujoined
18:33:16  * AvianFluquit (Remote host closed the connection)
18:49:07  * mikolalysenkoquit (Ping timeout: 264 seconds)
18:49:18  * mikolalysenkojoined
19:21:32  * st_lukejoined
19:27:57  * jcrugzzjoined
19:52:07  * nicholasfquit (Read error: Connection reset by peer)
19:52:37  * nicholasfjoined
20:00:28  * st_lukequit (Remote host closed the connection)
20:04:39  * ins0mniaquit (Remote host closed the connection)
20:12:36  * mikealjoined
20:17:28  * AvianFlujoined
20:39:19  <jesusabdullah>substack: AvianFlu you guys see these lulz? https://groups.google.com/forum/#!msg/nodejs/mhRUeX8EX2g/rJzP8DnSQFIJ
21:06:23  * shuaibquit (Quit: Textual IRC Client: http://www.textualapp.com/)
21:12:39  <juliangruber>my mom probably can `npm register`
21:24:30  * dominictarrjoined
21:37:42  * dominictarrquit (Quit: Page closed)
21:39:20  <jesusabdullah>but macgrubar, componint
21:40:33  * ins0mniajoined
21:46:06  * jcrugzz_joined
21:46:53  * jcrugzz_changed nick to jcrugzz|afk
21:48:01  * jcrugzzquit (Ping timeout: 246 seconds)
21:52:17  * st_lukejoined
21:53:38  * ins0mniaquit (Remote host closed the connection)
21:55:45  <mikolalysenko>jesusabdullah: I wonder if he realizes how ridiculous that arguments sounds. He just asserts "but component is better!" without giving anything to back it up. I also don't understand what he means by node_modules is a weak structuring pattern.
21:56:21  <mikolalysenko>or even what a "structuring pattern" is supposed to be. sounds like just line noise/word salad
22:00:10  <substack>having a combination user/repo and modulename hybrid seems strictly "weaker"
22:02:06  * AvianFluquit (Remote host closed the connection)
22:02:09  <mikolalysenko>also the statement that component is better for browsers is a little weird
22:02:44  <mikolalysenko>the only real feature it has over npm is the ability to specify non-js assets
22:03:01  <mikolalysenko>though I think this could probably be fixed by just adding some field to the package.json
22:05:51  <jesusabdullah>mikolalysenko: inorite? I couldn't even really parse it I was just like, "huh??"
22:06:51  * thl0joined
22:07:40  <jesusabdullah>mikolalysenko: for me all this shit really just comes down to laughing at baseless self-importance
22:07:51  <jesusabdullah>**I** have an **opinion**
22:07:55  * timoxleyjoined
22:08:10  <jesusabdullah>As a mother and army wife, I think blah blah blah
22:08:38  <jesusabdullah>maybe "As a parent in an army family" is more appropriate
22:08:38  <jesusabdullah>yeah
22:08:43  <jesusabdullah>I like that better ^__^
22:09:05  <jesusabdullah>**AS a PARENT** I think **bolded things**
22:09:25  <jesusabdullah>AS A PARENT I THINK MODULES ARE TERRIBLE
22:09:26  <LOUDBOT>HOW THE HELL CAN YOU FUCK THIS UP, ITS NOT THAT HARD
22:09:43  <mikolalysenko>well, as long as you preface it with "I think" you can say whatever you want, anyone can have any opinion. but if you state an opinion in a public space, it is going to be subject to scrutiny and criticism
22:09:50  <jesusabdullah>AS A PARENT I THINK YOU ShOULD BUY STOCK IN YUM
22:10:24  <mikolalysenko>and I don't think that guy's opinion was really well supported at all, which is a thing that I find common to most of the articles for component
22:10:28  <jesusabdullah>yeah, sure, and like it's fine to state your opinion, it's just the attitude
22:10:47  <jesusabdullah>for all I know component is really cool2
22:10:52  <mikolalysenko>in the end the only one I can see that sort of stands up is that component lets you package css/html stuff with your js
22:11:10  * thl0quit (Ping timeout: 240 seconds)
22:11:18  <jesusabdullah>I'm guessing it doesn't build step (at least on the browser) ?
22:11:21  <mikolalysenko>I think though that a better solution is to figure out how to solve this evolutionarily rather than trying to scrap everything and reboot
22:11:32  <jesusabdullah>I mean there isn't a whole hell of a lot to reoot
22:11:36  <jesusabdullah>reboot*
22:11:40  <mikolalysenko>yeah, I agree
22:11:54  <mikolalysenko>which is why I think component goes way overboard for what it is trying to solve
22:12:22  <jesusabdullah>like, as much as I like npm and think commonjs was/is the most "canonical" set of expectations to evolve from
22:12:36  <mikolalysenko>the other thing is that if you use component (or anything that packages css/images/whatever) you have to adhere to certain dogmas in how you build your pages
22:12:38  <jesusabdullah>you have to admit that there's still a lot of space, y'know?
22:12:44  <mikolalysenko>yeah, I agree
22:12:44  <jesusabdullah>mikolalysenko: oh?
22:12:59  <mikolalysenko>when it is done you get a couple of files you have to put in your page
22:13:18  <mikolalysenko>and you have to follow certain conventions with how you name css selectors, or how you serve assets
22:13:35  <mikolalysenko>these things are necessary for anything that handles static assets to work
22:13:43  <jesusabdullah>sounds needlessly restrictive from here
22:13:53  <mikolalysenko>well, that is kind of my opinion on it
22:13:56  <mikolalysenko>but there is some merit
22:13:59  <jesusabdullah>but for all I know it's a fundamental limitation on the browser that I'm not thinking of
22:14:12  <mikolalysenko>classic example is building ui widgets
22:14:22  <mikolalysenko>typically you need to use some style sheet to make everything look pretty
22:14:37  <mikolalysenko>or even to create certain effects, like using buttons for file upload
22:14:42  <jesusabdullah>sure
22:15:07  <mikolalysenko>in component, the idea is that these things should be modular so you just install and drop them into your page
22:15:13  <mikolalysenko>that is a good idea I think
22:15:27  <mikolalysenko>but to make this happen you need to add special css stuff for each of those widgets
22:15:51  <mikolalysenko>and so component builds a couple of files for you when you are done
22:16:04  <mikolalysenko>you get a build.css and build.js that you have to stick in your page somewhere
22:16:24  <mikolalysenko>not sure how it does images and other static stuff yet
22:16:36  <Wraithan>mikolalysenko: most of the time when I see something includes its own css, my first thought is 'well, I'm going to have to rip that out and replace it with something less identifiable and actually fits my layout'
22:16:57  <mikolalysenko>Wraithan: well, then you might not like component...
22:17:09  <jesusabdullah>oh sure, I mean, a standardized set of classes to base your css off is a good idea but it doesn't need to necessarily be conflated with package management
22:17:26  <mikolalysenko>that is what component is all about afaik
22:17:29  <jesusabdullah>it sounds like the scope of component is much larger than a module system
22:17:41  <mikolalysenko>yeah it is a module system + ui tool kit
22:17:45  <mikolalysenko>it does too much I think
22:17:51  <jesusabdullah>like, manifests and a css framework in one thing?
22:17:59  <mikolalysenko>they could have easily added all the css building stuff on top of npm
22:18:13  <jesusabdullah>well as parts of a larger framework I could dig it
22:18:27  <mikolalysenko>also in component you have to statically specify which modules get loaded at which require point
22:18:29  <jesusabdullah>they're just separable concerns is all
22:18:42  <mikolalysenko>which makes masochistic people feel happy I suppose
22:19:27  <jesusabdullah>How does that work?
22:19:43  <mikolalysenko>basically component doesn't do static analysis for looking up files
22:19:46  <jesusabdullah>oh, like, you manually specify the filesystem mapping in json?
22:19:50  <mikolalysenko>so you have to list them all in your component.json
22:19:51  <mikolalysenko>yeah
22:20:05  <mikolalysenko>you manually specify which files you want to load when you require() stuff
22:20:15  <jesusabdullah>hmmm
22:20:17  <mikolalysenko>you know, just you really make sure you require them or something
22:20:35  <mikolalysenko>and so you have two files you need to edit when you are building things
22:21:32  <mikolalysenko>this is sort of unavoidable because of the way component handles namespaces
22:21:43  <mikolalysenko>you need to say which module comes from which namespace when you use it
22:21:56  <mikolalysenko>which means writing a lot more stuff
22:22:09  <mikolalysenko>which also means lots more busy work to make people feel happy/productive
22:22:22  <mikolalysenko>kind of like gigantic xml build files in Java or whatever
22:23:54  <mikolalysenko>but these are all kind of superficial arguments
22:24:18  <mikolalysenko>the real reason not to use component is that it splits the javascript package ecosystem
22:25:17  <mikolalysenko>I also find it ironic that in order to even install component you need to install npm in the first place
22:25:51  <Wraithan>Oh man, those giant java xml files... I worked at a company with a 4k line ANT file
22:26:12  <mikolalysenko>some people swear by them. kind of like using semicolons in js
22:26:51  <Wraithan>I get in trouble at work because I am used to writing JS without semicolons in my spare time
22:27:03  <Wraithan>And I rarely write JS at work, usually leave that to front end people
22:27:27  <mikolalysenko>yeah, my armchair psychoanalysis is that it is a kind of ritualistic thinking
22:27:59  <Wraithan>Well, in this cases we have TONS and TONS of JS, changing style would be silly
22:28:08  <mikolalysenko>like people see C programs that are fast and awesome, and assume by a sort of cargo-cult-like reasoning that if you use semicolons in js it will also improve your code quality
22:28:15  <mikolalysenko>or some other nebulous imprecise concept
22:28:34  <mikolalysenko>there is a similar cult around tools like jslint, or require.js
22:29:50  <Wraithan>I like linters, pep8/pyflakes (the combined project, flake8) are pretty great, jshint mostly like but had to customize it
22:30:05  <Wraithan>And am still running into an issue in jshint that I need to figure out
22:30:37  <Wraithan>There is no option to turn Harmony off, and I am getting a redef error when I do var Set = require('Set')
22:31:01  <mikolalysenko>that is weird
22:31:14  <mikolalysenko>why even have that on by default? nothing even supports harmony yet
22:32:01  <Wraithan>Well, Anton the main dev works where I work, Mozilla, and running it on firefox internal JS files it makes sense
22:32:23  <mikolalysenko>fair enough
22:33:18  <Wraithan>I try to write firefox style JS in addons, web agnostic JS for websites that I actually work on, and then node-style JS for personal projects, it's a mess :(
22:33:38  <Wraithan>doesn't help that I am new to the JS communities, especially the node ones
22:34:16  <mikolalysenko>well, I don't really know all the js stuff too and am similarly just learning how things work
22:35:07  <mikolalysenko>though I don't do js stuff in any official capacity; my day job is grad student
22:35:28  <mikolalysenko>I suppose it must seem terribly arrogant all of these things that I was saying about component...
22:38:07  <Wraithan>:)
22:38:57  <mikolalysenko>perhaps there are good reasons to use it, and there are a lot of people who seem to really like it
22:39:26  <Wraithan>I sat and argued with thl0 for a while about how the node ecosystem has issues, partially stemming from the small module ideas
22:39:29  <mikolalysenko>and I think that creating composable ui widgets is a really good idea, and definitely a goal to work toward
22:39:38  <Wraithan>and have argued it a number of times with chrisdickinson, a friend of mine
22:40:03  <mikolalysenko>actually, I think the small module aspect is one of the best parts of node.js!
22:40:21  <Wraithan>It is a debatable thing
22:40:24  <Wraithan>I think it for some stuff
22:40:52  <mikolalysenko>what things is it bad at?
22:41:26  <Wraithan>Building anything larger
22:41:37  * jolissjoined
22:41:58  <Wraithan>dilution of the eco system
22:42:00  <Wraithan>etc
22:44:25  <mikolalysenko>not sure I agree with those points, but I have to go so maybe we can talk about some other time.
22:44:35  * nicholasfquit (Remote host closed the connection)
22:46:58  <Wraithan>mikolalysenko: It will be the same arguements I always put forth and they wont be addressed, *shrug*
22:55:41  <chrisdickinson>Wraithan: i think that your contention with small modules -- difficulty building larger projects, dilution of ecosystem -- would be more convincing with metrics :)
22:56:56  <chrisdickinson>re: the first, voxel.js, level, browserling, testling are all good example of "larger" projects comprised of small modules
22:57:23  <chrisdickinson>re: the second -- i haven't personally experienced much trouble with the npm namespace being gradually taken
22:57:31  <chrisdickinson>things are kept relatively civil
22:57:34  <chrisdickinson>but!
22:57:38  <chrisdickinson>i have to go, too
22:57:47  <chrisdickinson>sorry for the drive-by comment :)
23:00:15  <Wraithan>The first, is a few people who are very closely tied with the ecosystem, writing dozens and dozens of their own modules to do this.
23:00:16  * mikolalysenkoquit (Ping timeout: 252 seconds)
23:00:29  <Wraithan>Not people newly coming to node.
23:00:48  <Wraithan>The second I run into every time I need a module for something
23:01:45  <Wraithan>A bonus third: I fix a bug in one of my modules, I now have to bump required version and do releases of everything that depends on that (that I control), then going up a couple levels to get to my main project that I am actually working on
23:03:36  <Wraithan>I'm not saying it is all bad, I've enjoyed some of the benefits
23:05:27  <substack>the alternative is that you can't push breaking changes without breaking everything
23:05:41  <substack>anyhow if you let the patch version float then you automatically get bugfixes
23:05:45  <substack>~1.2.3
23:06:57  <Wraithan>will that upgrade if you already have something installed that satisfies it?
23:07:20  <substack>yes if you do a clean install or `npm update`
23:08:10  <Wraithan>Ok, that covers the minor bugfix case
23:08:45  <jesusabdullah>I mean, those are real trade-ffs
23:09:00  <jesusabdullah>you do have to make more decisions without a framework
23:09:15  <Wraithan>making things less approachable
23:09:27  <Wraithan>imo
23:09:37  <jesusabdullah>the fact that you can have granular control over these things if desired is of course fantastic
23:10:02  <Wraithan>By if desired you mean you have to take granular control over everything
23:10:13  <jesusabdullah>well, without a framework yeah
23:10:35  <jesusabdullah>or with a good framework, it lets you have more granular control **if you want it** that is, it stays out of the way
23:10:54  <jesusabdullah>Stick around and I'll show you a blog post I'm working on
23:11:03  <Wraithan>Sure, i mean that is how django is still relavent to companies like Mozilla
23:11:05  * jolissquit (Quit: joliss)
23:11:08  <Wraithan>where we replace chunks of it
23:11:15  * jolissjoined
23:11:22  <jesusabdullah>right
23:11:32  <jesusabdullah>though perhaps that could be easier
23:11:33  <jesusabdullah>idk
23:12:05  <Wraithan>Sure, it could be easier
23:12:11  <jesusabdullah>I like the constructive direction versus the destructive one
23:12:13  <Wraithan>But it at least provides a path to start
23:12:13  <jesusabdullah>if that makes sense
23:12:19  <Wraithan>Where node has none
23:12:33  <Wraithan>Node has no good stories for getting started doing things like making a website
23:12:41  <jesusabdullah>like I said Wraithan stick around and I'll show you a blog post I'm working on that I think you'll like
23:12:50  <jesusabdullah>based on what you're saying
23:13:01  <jesusabdullah>in the meantime check out https://github.com/bigcompany/big
23:13:02  <Wraithan>I don't plan on leaving, I'm hanging out in here to learn more and discuss with folks
23:13:06  <jesusabdullah>cool
23:13:09  <jesusabdullah>:D
23:13:22  <substack>node has plenty of great ways to make websites
23:13:38  <substack>it just doesn't have a single "best practice" way of doing it
23:13:48  <jesusabdullah>or an "obvious practice"
23:13:53  <jesusabdullah>whether it's "best" or not
23:13:53  <substack>because there are genuinely a lot of good ways of doing it
23:14:07  <Wraithan>substack: all of them start with 'pick from this dozen of things, then pick from these 2 dozen ways of dealing with cookies, then these 50 ways of connecting to a db, etc etc'
23:14:38  <jesusabdullah>y'know, and then you have to write plumbing
23:14:47  <jesusabdullah>api-->api mappings
23:15:04  <jesusabdullah>which isn't bad per se if you're not lazy
23:15:08  <jesusabdullah>but you might be lazy
23:15:12  <jesusabdullah>and laziness should be allowed
23:15:16  <Wraithan>not just lazy
23:15:29  <Wraithan>You need to understand both sides of things you are trying to tie together
23:15:33  <Wraithan>to make a proper mapping
23:16:13  <Wraithan>It isn't a laziness thing it is approchability that I am more concerned with
23:17:15  <Wraithan>Partially because as an experienced webdeveloper in multiple langauges, I don't have a good time writing websites in node
23:17:42  <Wraithan>If *I* have a hard time, I don't immagine folks who are newer will have any easier of a time
23:18:18  <owen1>substack: if u got a minute to reply here - http://www.reddit.com/r/node/comments/1f2ps0/template_for_vanilla_nodejs_website_or_web_service/ they are even bashing tape!
23:18:31  <ralphtheninja>node isn't primarily something for making websites though, which might have something to do with that
23:18:40  <owen1>by they i mean someone on the internets
23:18:46  <Wraithan>ralphtheninja: python isn't either
23:19:02  <substack>Wraithan: "Anxiety is the dizziness of freedom.'
23:19:21  <ralphtheninja>so you are saying python is easier to create a website with?
23:20:02  <ralphtheninja>or easier to get started with
23:20:20  <jesusabdullah>well that's a bad comparison
23:20:23  <Wraithan>substack: 'What is not constrained is not creative.'
23:20:38  <substack>owen1: I think `mkdir website` is the best template for a vanilla nodejs website
23:20:43  <jesusabdullah>at this point it's something like, "werkzeug or node?"
23:20:48  <jesusabdullah>"python or javascript?"
23:20:56  <jesusabdullah>"sinatra or express?"
23:21:22  <Wraithan>jesusabdullah: werkzeug is typically not recommended for new people, because it doesn't have a clear happy path to a website
23:22:00  <Wraithan>node style would say to use werkzeug directly and then build/use small modules on top of it until you have a working thing
23:22:05  <substack>owen1: I think your example also has too many files and directories
23:22:49  <substack>Wraithan: dunno, when I did python django was completely impenetrable but werkzeug made complete sense
23:23:04  <Wraithan>substack:
23:23:33  <Wraithan>substack: Depends on what you need in your stack
23:23:55  <substack>I don't think of programs that happen to speak http in terms of "stacks"
23:23:56  <Wraithan>If you want a relational db, some views, templates, and a couple middleware, django works out of box
23:24:03  <substack>I think of what the inputs are and what the outputs need to be
23:24:08  <owen1>substack: true. it's how i currently structure my project. people can rm everything
23:24:22  <owen1>maybe i should have made it a single file? server.js?
23:24:27  <substack>other people think about programming differently and I don't think about programs they way that they do
23:24:30  <owen1>with routes and templar inside?
23:24:37  <jesusabdullah>yeah exactly
23:24:42  <jesusabdullah>I see the value in both approaches
23:24:49  <substack>owen1: I don't even use routes or templates
23:25:03  <owen1>i know. u use regex and test
23:25:06  <Wraithan>jesusabdullah: Sure, I do as well, I just don't see one as approachable as the other
23:25:15  <jesusabdullah>right
23:25:18  <jesusabdullah>!
23:25:21  <owen1>substack: but when u have more routes it might get complex
23:25:29  <substack>I don't have more routes
23:25:36  <ralphtheninja>hehe
23:25:43  <substack>and if I do, I just split that up into multiple files
23:25:44  <owen1>oh.. can't argue with that
23:26:18  <owen1>substack: so u'll have a giant if else statement in your server.js
23:27:43  <substack>use early returns
23:27:51  <substack>split things up into functions
23:28:16  <substack>use objects and arrays to programmatically enumerate over routes as necessary
23:29:08  <substack>my apps mostly just look like this: https://github.com/substack/hyperspace/tree/master/example/feed
23:29:19  <substack>and then I'll make a lib/ and a browser/ as those parts grow
23:29:25  <owen1>['/', '/:post', '/:post/:topic', etc] ?
23:29:39  <substack>:post?
23:29:50  <Wraithan>substack: variable
23:29:55  <substack>yes but
23:30:05  <substack>var parts = req.url.split('/')
23:30:09  <substack>then just check `parts`
23:30:10  <owen1>i build google group site. i have / and /cats and /cats/cat-video-topic
23:30:15  <substack>so easy
23:30:41  <owen1>and sometimes /cat-videos?format=application/json
23:30:47  <owen1>(for ajax requests)
23:31:10  <substack>var params = querystring.parse(url.parse(req.url).search.slice(1))
23:31:56  <owen1>is that cleaner or easier than this - router.addRoute('/', require('./routes/index.js'));
23:39:36  * jcrugzz|afkchanged nick to jcrugzz
23:43:02  <substack>not sure what that does
23:45:30  <owen1>router.match('/').fn(req, res); will the matched function
23:45:38  <owen1>in this case whatever in index.js
23:57:24  <substack>if (req.url === '/') return doAThing(req,res)