The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-03-12

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:07 Adura joined #mojo
00:08 meshl joined #mojo
00:17 good_news_everyone joined #mojo
00:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/zFVbfw
00:17 good_news_everyone mojo/master 206138f Sebastian Riedel: Mojolicious::Static was missing Mojo::Date
00:17 good_news_everyone left #mojo
00:23 jack joined #mojo
00:55 btyler joined #mojo
01:06 laouji joined #mojo
01:22 ka2u joined #mojo
02:08 klapperl joined #mojo
03:29 ua_1 joined #mojo
03:47 howitdo joined #mojo
04:30 laouji joined #mojo
04:58 sujithm_ joined #mojo
04:59 sujithm__ joined #mojo
05:31 laouji joined #mojo
05:34 ka2u joined #mojo
05:56 d4rkie joined #mojo
06:13 ua_1 joined #mojo
06:17 ka2u joined #mojo
06:48 trone joined #mojo
07:02 Eke- joined #mojo
07:10 laouji joined #mojo
07:16 basiliscos joined #mojo
07:35 Vandal joined #mojo
07:41 dpetrov_ joined #mojo
07:53 marcus I need to use a web service, but the cpan module is written using LWP and XML::Simple  (╯°□°)╯︵ ┻━┻)
08:00 eseyman joined #mojo
08:01 tianon always a sad moment
08:02 Bairdsy joined #mojo
08:05 Bairdsy hey - can anyone give me some advice - I have a prototype I have built for a Mojo web app which displays customer information through the web browser which can be searched by customer id.  The prototype works by reading up the (large) data file at startup and keeping all of the data in memory in a huge perl hash (keyed by customer id).  This works well up to about 100,000 customers, although Perl
08:05 Bairdsy is a memory hog and this is pushing 2GB RAM usage.  My plan is to deploy this on a 64 bit server with 64GB RAM and push it up to 1 million customers (predicted 20GB RAM) - is there any reason I shouldnt?
08:06 Bairdsy I cant find any discussion anywhere about Mojo's performance with a huge memory footprint - I know with Java etc it causes problems for the garbage collector - any issues for Mojo I should be aware of?
08:10 batman Bairdsy: why, oh why do you do that? :(
08:10 batman Bairdsy: have you heard of mysql, postgres, mongodb, ...?
08:10 Bairdsy lol - yes
08:10 Bairdsy tell me why I shouldnt though
08:11 batman "some advice" = do NOT do what you're doing now unless you have really specific needs.
08:11 batman because it doesn't scale well.
08:11 batman actually... you're already giving the reason why not in your description.
08:13 trone joined #mojo
08:18 Bairdsy I appreciate the advice - (and Im trying not to be a douche) - but I really want to know if anyone can tell me specifically how that will cause an issue - I know keeping it in memory means I can't scale beyond the RAM on the server - but is there a (theoretical or otherwise) limit to how big a Mojo app can get in memory before it grinds to a halt?
08:19 Bairdsy and I know I should be using a db or nosql solution, but Im not - so am I screwed or not?
08:22 batman no. perl can use all the memory there is, unless `ulimit` is set or other limitations are set
08:23 Bairdsy perfect - thanks mate
08:23 batman Bairdsy: http://www.perlmonks.org/?node_id=307382 # maybe this can be useful
08:24 batman or just google for "hash lookup speed" or something like that... maybe "benchmark"
08:25 sujithm joined #mojo
08:33 Foxcool joined #mojo
08:42 suy joined #mojo
08:55 rawler joined #mojo
09:03 ka2u joined #mojo
09:04 denis_boyun joined #mojo
09:10 al joined #mojo
09:20 marcus bairdsy: If you really want to keep everything in memory, I recommend using redis
09:20 marcus bairdsy: That way at least you can scale up by adding web frontends to do the processing
09:21 marcus (Redis is memory backed, and really fast)
09:29 spoot joined #mojo
09:29 spoot joined #mojo
09:49 cpan_mojo Mojolicious-Plugin-BootstrapPagination 0.08 by DOKECHIN - http://metacpan.org/release/DOKECHIN/Mojolicious-Plugin-BootstrapPagination-0.08
09:51 nikita how to link my test lite app to controllers from non-lite app?
09:52 sri so, i guess nobody cares about correct handling of <div /> in Mojo::DOM?
10:02 nikita sri: i personally not, because use it on a rare ocasion
10:02 nikita (Mojo::DOM)
10:04 crab i don't care much, if at all
10:07 spoot joined #mojo
10:09 sri hmmmm
10:09 sri the patchset in question https://github.com/kraih/mojo/compare/3e3e997811724182fde4b3ab0b77e8c16b34dd99...6c13b15b6f302392382f83be922e1744a62bce99
10:12 kurahaupo_ joined #mojo
10:14 sri https://scontent-a.xx.fbcdn.net/hphotos-ash3/t1/1912111_10151948431876837_2146856842_n.jpg
10:26 hrupp joined #mojo
10:41 ver joined #mojo
10:43 good_news_everyone joined #mojo
10:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ffWUxg
10:43 good_news_everyone mojo/master a64a603 Sebastian Riedel: && has a higher precedence than ||
10:43 good_news_everyone left #mojo
10:52 sri you may think this shit is rare... but even stuff like the <image> tag gets used by 0.2% of all web sites
10:53 sri self-closing tags with /> get used *a lot*, heck even we encourage it with the tag helpers
10:53 sri perl -Mojo -E 'say for g($ARGV[0])->body =~ m!<[^<]+/>!g' www.reddit.com
10:56 pernicious I've missed most of the discussion, but I'm interested in Mojo::DOM doing the right thing here
10:56 sri all you have to do is an <%= tag 'div' %> and you've got <div />
10:56 sri pernicious: for what reason?
10:56 * sri is arguing with himself here... trying to find out if it's worth it :)
11:01 pernicious Is there any measurable change to performance?  (I'm guessing not)
11:01 sri nope
11:01 sri there's a maintenance cost however
11:01 pernicious yeah
11:01 sri the list needs to be updated every now and then
11:02 pernicious which isn't easy
11:02 sri and compiling the list is really hard manual work
11:02 * sri nods
11:03 pernicious bah, I was wanting to support the mod, but I can't see the maintenance cost being justified
11:03 sri :(
11:04 pernicious Just to check, there's no easier source for that list?
11:05 sri not to my knowledge
11:05 pernicious Perhaps leave it on a branch in case that side of things improves
11:06 batman marcus: bairdsy was gone when you replied. is there a bug in convos or in marcus? :)
11:06 sri not to sound too dramatic... it's not every day that new html elements get added to the spec... so it doesn't have to get synced *that* often
11:07 marcus batman: I didn't see the quit because I switched to #mojo after it, and it was early in the morning :)
11:07 batman marcus: so you didn't use autocomplete?
11:09 marcus batman: not sure.
11:09 sri what i do like about handling <div /> correctly is that bugs can get found faster in Test::Mojo tests
11:09 batman marcus: i hope not :)
11:09 marcus sri: I think handling <div /> correctly seems like a good thing.
11:09 sri lets face it... who is really aware of which html5 elements allow self-closing and which don't
11:10 * sri was not until he made the list
11:10 pernicious The list being out-of-date is probably better than no list; updating it could be an annual event to mark the birthday of the unicorn
11:10 batman it makes me sad that <div/> is allowed as a starting tag :(
11:10 sri updating the *lists* (we need to keep multiple) could be a GSOC project
11:11 sri all the lists we need to maintain https://github.com/kraih/mojo/blob/master/lib/Mojo/DOM/HTML.pm#L52
11:29 tl joined #mojo
11:33 neilhwatson joined #mojo
11:40 denis_boyun joined #mojo
11:48 fhelmber_ joined #mojo
12:01 mattastrophe joined #mojo
12:25 denis_boyun joined #mojo
12:31 perl2012 joined #mojo
12:39 mire__ joined #mojo
12:46 jberger_ joined #mojo
12:54 d4rkie joined #mojo
13:38 jberger__ joined #mojo
13:40 spoot joined #mojo
14:02 btyler joined #mojo
14:29 gryphon joined #mojo
14:31 * sri wonders if the renderer should somehow support rails-ish variants
14:32 sri variant = iphone... $self->render('foo')... "templates/foo.html+iphone.ep" with fallback to "templates/foo.html.ep"
14:34 doby sri: that would be awesome if you could make it handle any breakpoint
14:34 sri what?
14:34 doby "templates/foo.html+1024.ep
14:35 sri what's a breakpoint?
14:35 purl it has been said that a breakpoint is already set i n the workspace
14:35 doby so based on screen width
14:35 doby one second
14:35 purl i think one second is second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom.
14:35 doby http://www.1stwebdesigner.com/design/overview-of-breakpoints-in-responsive-web-design/
14:35 sri variant is an arbitrary tag
14:36 sri $c->req->variant('1024');
14:36 doby ok, cool so anyone could create their own
14:36 doby ... i like it
14:37 sri layout 'test';... "templates/layouts/test.html+1024.ep", "templates/layouts/test.html.ep"
14:37 sri the biggest problem is actually where to store the variant tag
14:38 rj11 Are there any ways to localize the stash in calls to render? $c->render(template => 'menu', items => ...); keeps 'items' in the stash after the call.
14:38 rj11 I'm just waiting for this to bite me in the ass some day.
14:39 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Including_partial_templates
14:40 rj11 sri: I'm calling render(partial => 1) from one of my own tag helpers. I've found no way to call include that way.
14:41 sh4 joined #mojo
14:41 rj11 So in my template I have: %= render_menu 'menu-name'
14:41 rj11 and the render_menu tag helper performs the render(template..., items..., partial => 1) call.
14:42 sri hmmmm... a variant stash value seems silly... but $c->req->variant() also doesn't feel right
14:43 sri a buult-in helper is also not right if it's a real renderer feature
14:43 sri *built
14:43 bluescreen joined #mojo
14:44 rj11 sri: Built-in? I've added it via $app->helper(render_menu ...) in my custom Menus plugin.
14:45 sri i'm not talking to you
14:45 sri still musing over the variants feature
14:46 rj11 Ah.
15:02 rj11 I've noticed after using Mojolicious a few months that much of it is tightly integrated. Websockets, sessions, cookie handling, etc. The stash is flat and contains nearly everything concerning a single request, a stash keyword collision is just waiting to happen. Is there any particular rationale behind this design decision? (just wondering, no intention to criticize.)
15:06 malikai sounds good for simplicity.. but i'm not sure if that's "the reason"
15:07 malikai it's always a good idea to keep your stash close by
15:09 rj11 Yeah, decoupling is a good thing. I like the minimalism of Mojolicious and that's in written in Perl.
15:10 abra joined #mojo
15:11 rj11 But I don't understand why almost everything is mashed together in the same "namespace", i.e. helpers occupying the same namespace as methods of controllers, for example.
15:11 sujithm joined #mojo
15:11 moritz because you can call helpers are methods on a controller object?
15:13 rj11 Yes.
15:17 spoot joined #mojo
15:22 sri http://pastie.org/8911648 # this is how an implementation of variants could look like
15:22 mire__ joined #mojo
15:26 sri aside from cleaning up the renderer code... the biggest problem is where to store the variant tag
15:33 sri hmm... actually, the implementation sucks
15:39 bbery joined #mojo
15:44 bjoernfan rj11: you could always do $self->stash(main_menu => { title => 'foo', items => [] }); I guess, I haven't had any problems with the way stash works anyway
15:47 sh3 joined #mojo
15:54 meshl joined #mojo
15:56 jberger__ We take it very seriously when we consider adding reserved stash keys
15:57 jberger__ And in my plugins I always use a stash key that is namespaced with the plugin name and a dot
15:57 jberger__ Stash keys that are not purely alphanumeric are not localized to variables either
16:02 sri anyone care about variants?
16:02 * sri is close to abandoning it
16:04 rj11 jberger__: Yeah, that's a solution, a form of namespacing the name to avoid collisions. But I still don't understand why stash variables passed to render() are persistent after the call.
16:06 rj11 jberger__: Say the current visitor's username is in the stash as 'username', and then on some page a list of users is generated and each user is rendered by a specified template: render(template => 'components/user-details', username => ..., date_of_registration => ..., partial => 1); You're screwed.
16:06 stephan48 sri: i think its a nice idea
16:07 spoot joined #mojo
16:08 ua_1 joined #mojo
16:08 jberger__ That's on Mojolicious/Renderer.pm line 82
16:09 jberger__ You are suggesting that that be a copy and not a merge
16:10 rj11 jberger__: Yes, but the merged stash is persistent after the render() call. So after that call stash->{username} will no longer be the visitor's username, but instead the last username of the last row in the partially rendered list.
16:11 rj11 jberger__: Yes, precisely.
16:11 jberger__ That would at least be a fairly major backwards incompatibility if it was even possible
16:11 rj11 jberger__: The 'username' example is a bit simple, but such collisions are hard to predict and later debug/fix.
16:12 rj11 jberger__: Increased scoping of the stash and variables in templates would lessen the chance of such bugs occurring.
16:28 spoot Mojo::Util::get_line is DEPRECATED but I can't see what it has been deprecated in favour of. So what should I use in its place?
16:29 good_news_everyone joined #mojo
16:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5dqCtg
16:29 good_news_everyone mojo/master defc52f Sebastian Riedel: merged handler lookup
16:29 good_news_everyone left #mojo
16:29 sri spoot: there is no replacement
16:30 sri it's gone because we don't use it internally anymore
16:30 spoot That's shame. That was a handy util and I used it a lot.
16:30 sri performance cost was too high
16:31 spoot I can make a sub of my own then. It's not like it's a massive function.
16:33 jberger__ rj11: I don't disagree with you, but any change in stash/render behavior would be a major change
16:34 jberger__ Also the current behavior is documented, so there is no confusion on that point at least
16:34 sri jberger__: why is the include helper not enough?
16:36 jberger__ sri thanks, I knew there was a way to do that. My head is in $work space atm
16:36 jberger__ rj11: ^^
16:36 sri i actually linked to the section in the guides when the whole thing started
16:37 jberger__ So you did
16:37 jberger__ Shame on me for skimming the backlog
16:37 jberger__ Also I think it's time for me to re read the guides
16:38 jberger__ I like to do that from time to time as a refresher on features I don't use as often
16:39 sri you keep saying that :)
16:54 rj11 sri: The guide doesn't mention whether it is good or bad to use 'include' in places other than templates. :)
17:02 sri alright, anyone who cares about variants... help find a way to store the variant tag without adding a new reserved stash value
17:03 sri i don't think it would break much if it was a reserved stash value though
17:03 sri since it always falls back to the non-variant template
17:06 stephan48 mh, i don't know the mojo internals good enought, but by thinking about how f.e. format works(if i reacall correctly it is a reserved stash value), it would make sense to implement variant the same way
17:07 sri i'm not convinced yet that the feature is valuable enough for a reserved stash value
17:07 stephan48 that might be the case throu
17:08 stephan48 i can think of some use cases but probably won't use such a feature for some time
17:09 spoot joined #mojo
17:10 rj11 sri: Wouldn't it be possible to add such internal state to some context object? And that context could hold the stash as well.
17:10 sujithm joined #mojo
17:11 sri rj11: no
17:12 rj11 sri: Which would keep the stash free from any value not added by the application developer.
17:12 sri sorry, but i'm not interested in that discussion
17:13 sri if you want to redesign the stash, please make a real proposal with code we can discuss
17:14 rj11 I can't relly do that unless I know why it is as it is, now can I?
17:15 sri it is that way because nobody has made a convincing proposal for a replacement yet
17:15 cooper joined #mojo
17:15 rj11 There must be some reason why it was implemented like that in the first place.
17:16 sri lack of alternatives
17:17 sri you may choose not to believe me... but i was the one who made the decision for mojolicious and catalyst
17:18 sri now i really want to discuss only variants
17:19 rj11 Okay, have fun.
17:25 sri marcus, jberger, crab, tempire: how do you feel about variants?
17:26 cpan_mojo Mojo-SNMP 0.06 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-SNMP-0.06
17:26 * tempire supports it
17:26 stryx` joined #mojo
17:26 sri http://pastie.org/8911648#99
17:26 tempire I end up making something similar manually
17:26 tempire often
17:26 sri got an opinion on where to store the variant tag?
17:27 sri all i can think of atm is $c->req->variant() and $c->stash->{variant}
17:29 sri a helper $c->variant() with a mojo.variant stash value is also possible... but rather ugly
17:30 denisboyun joined #mojo
17:34 tempire stash seems best
17:35 marty joined #mojo
17:36 beyondcreed joined #mojo
17:39 sri i suppose so
17:39 sri tempire: you think it's worth it?
17:40 Andy2 joined #mojo
17:40 sri jberger, marcus, crab: MOAR OPINIONZ!!!1
17:43 tempire Yes. It helps structure for different platforms. Sure people could do it on their own, with includes, but this provides an obvious pattern.
17:45 marty joined #mojo
17:47 marty joined #mojo
17:49 meshl joined #mojo
18:02 * jberger__ trusts tempire given lack of time to investigate
18:10 rj11 sri: I guess you don't give a fuck about what I say, but $c->variant() and 'mojo.variant' is beautiful. It separates the data from data-access and doesn't pollute the stash. :)
18:49 jberger_ joined #mojo
18:52 tempire rj11: You misunderstand sri's words. It's not you, it's the topic. He just wanted to talk about variants.
18:52 tempire stash makes sense because it's essentially a sub-format, and format is already a variable in the stash.
18:53 sri tempire is of course correct
18:58 punter joined #mojo
19:11 jrbeilke joined #mojo
19:27 good_news_everyone joined #mojo
19:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/r2vlgQ
19:27 good_news_everyone mojo/master a385e46 Sebastian Riedel: added support for template variants
19:27 good_news_everyone left #mojo
19:27 sri \o/
19:29 Eke- joined #mojo
19:34 good_news_everyone joined #mojo
19:34 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/PlqBgg
19:34 good_news_everyone mojo/master 9e42457 Sebastian Riedel: no need to use all render options in variant example
19:34 good_news_everyone left #mojo
19:41 good_news_everyone joined #mojo
19:41 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/FtkhVw
19:41 good_news_everyone mojo/master 17b3511 Sebastian Riedel: mention that variants can be used very liberally
19:41 good_news_everyone left #mojo
19:42 sri it's really quite simple to explain in documentation
19:42 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Template_variants
19:55 crab damn, i hate /lastlog. all i ever see is sri asking me for opinions, and usually i don't know what about.
19:55 sri see topic
19:55 * crab dumps to a file to scroll through
19:55 sri the log site is pretty good
19:56 marty joined #mojo
19:56 crab is it written with mojo, i wonder?
19:56 crab (not that it matters)
19:56 sri anyway, it was about this https://github.com/kraih/mojo/compare/defc52f02de9c8a81bf9cf4b039ed35e34dd01b4...17b351156d000b2dbb62d9ab96ff426300f98ebc#diff-65cf575515a0ad467194433b39cd30d3R201
19:57 sri but tempire voted +1 on it and i believe jberger gave tempire his vote too :)
20:00 crab ok, i guess i don't care enough to disagree. but what you've done seems ok.
20:00 crab so actually there wasn't much between all this happening and my doing /lastlog
20:02 rawler joined #mojo
20:02 meshl joined #mojo
20:04 sri oh that's cute http://i.imgur.com/bhWDOw7.gif
20:06 doby ^ and sadly true
20:07 crab hah
20:07 genio well done, whoever did that!
20:18 stephan48 crab: its a psgi based application
20:18 stephan48 no mojo
20:25 tempire oh my
20:25 tempire someone should make that illegal
20:25 tempire for the sake of freedom
20:25 tempire remove it from the internet!
20:26 crab why? it's just a psgi app...
20:30 stephan48 its not written in mojo(surely the biggest problem!!!) and i don't know a fuck about psgi, but whats wrong withj that?
21:15 gryphon joined #mojo
21:35 meshl joined #mojo
21:39 btyler joined #mojo
21:54 tempire \o\
21:54 tempire /o/
22:00 rem_lex|pivo joined #mojo
22:01 sri \o\
22:01 sri /o/
22:02 marty ~o~
22:08 good_news_everyone joined #mojo
22:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_tjUFw
22:08 good_news_everyone mojo/master ecd39c9 Sebastian Riedel: test variant in file
22:08 good_news_everyone left #mojo
22:10 sri oh, i forgot to ask, everyone think variant is the right name for the feature?
22:10 sri i just stole the name from rails
22:14 tempire yes
22:16 tempire Rails blog posts are how I figured out what a variant was.
22:16 sri :)
22:46 paladinn joined #mojo
23:01 mire__ joined #mojo
23:32 mattastrophe joined #mojo
23:33 maxhq joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary