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

IRC log for #mojo, 2015-03-13

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

All times shown according to UTC.

Time Nick Message
00:05 sri say what you will about php, those laravel folks get a lot of things right
00:10 jberger if they are doing it right, they must be extra good at what they do
00:11 jberger someone get those guys a better language!
00:13 bpmedley sri: Would a Mojolicious::Lite app that aggregates a person’s facebook, instagram, and other posts be a good Mojo::Pg example?
00:14 jberger bpmedley: it would be pretty huge before you could demo it
00:14 bpmedley Even with just 3 integrations?
00:16 sri i've reduced my blog example to just create/read, and it's still borderline too big for my taste
00:17 bpmedley May I ask how many lines it currently is?
00:17 zivester joined #mojo
00:21 sri 59 lines of Perl
00:21 bpmedley There’s no hope for an aggregator.. :)
00:22 sri 2 lines of SQL, 35 lines of templates, 8 lines of CSS
00:23 sri it's a well formatted full app, with controller, model, config file, external migrations and css
00:23 sri which kinda makes it look big
00:24 sri oh and validation
00:24 sri which adds the most lines
00:30 sri http://i.imgur.com/eBHDOhT.png
00:34 bpmedley I assume line 16 is very important.  Is it too dense?
00:38 OmarOthman joined #mojo
00:45 sri the real question is if external css and config files add any value
00:46 hesperaux joined #mojo
00:46 sri hmm, the goal is only to teach a clean basic app layout
00:46 sri i guess they do in that context
00:48 mattastrophe joined #mojo
00:49 marmez joined #mojo
01:00 sri committed it for now... not sure yet if it stays and in which form https://github.com/kraih/mojo-pg/commit/45e9d9134e7e7a243099c95ab8bec1b5308fde81
01:00 sri no tests and docs, which is in line with other examples
01:07 hesperaux_ joined #mojo
01:09 hesperaux__ joined #mojo
01:16 hesperaux_ joined #mojo
01:21 hesperaux joined #mojo
01:25 nicomen ice
01:26 nicomen *nice
01:26 sri already slightly reworked https://github.com/kraih/mojo-pg/tree/master/examples/blog
01:27 sri external css didn't really add much value
01:33 Averna joined #mojo
01:35 hesperaux_ joined #mojo
01:36 absolut_todd joined #mojo
02:21 klapperl joined #mojo
02:36 hshong joined #mojo
02:39 kaare joined #mojo
02:48 hesperaux joined #mojo
03:21 noganex joined #mojo
03:32 hesperaux_ joined #mojo
03:34 Vertig0 joined #mojo
03:48 Grinnz using Mojo::Util slurp and spurt in my code makes it read a bit ... more interesting
03:58 arpadszasz joined #mojo
04:52 Oleg joined #mojo
04:53 irq joined #mojo
05:05 sri wtf? is erlang so expressive that you can implement spdy in like 313 lines of code :O https://github.com/ninenines/cowlib/blob/master/src/cow_spdy.erl
05:08 sri actual server code is a little more code though https://github.com/ninenines/cowboy/blob/master/src/cowboy_spdy.erl
05:09 crab time for erlicious?
05:10 sri more like elixilicious
05:12 sri guess it would be more correct for Mojo::Server::Daemon to send a 100 Continue response automatically for Expect: 100-continue requests
05:12 sri hmm
05:12 sri but it would break the hack i posted to the list earlier:S
05:16 Adura http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=hipe&lang2=perl Comperable...
05:35 absolut_todd joined #mojo
05:49 melo joined #mojo
05:56 sri proposal for crud method naming convention https://groups.google.com/d/msg/mojolicious/O1Hhl6OfxeA/KJ6pSbqSu6MJ
05:59 sri also, would be nice if someone else could close this (he's been around for some time and know better)  https://github.com/kraih/mojo/issues/762
06:06 inokenty-w joined #mojo
06:06 Grinnz damn... there wasn't actually a way for me to turn off IPv6 resolution in the Mojo::IOLoop->client connection in Mojo::IRC was there
06:09 Grinnz local_address, i guess
06:09 Grinnz but that's not exposed in Mojo::IRC
06:14 Grinnz and tht didnt work anyway
06:24 reneeb joined #mojo
06:55 Grinnz well, i just killed my ipv6 tunnel, so it won't bother trying ipv6
06:57 dod joined #mojo
06:59 bramirez joined #mojo
07:01 memowe joined #mojo
07:03 dod joined #mojo
07:29 cpan_mojo Mojolicious-Plugin-CGI 0.20 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-CGI-0.20
07:49 cpan_mojo Clustericious 0.9943 by PLICEASE - http://metacpan.org/release/PLICEASE/Clustericious-0.9943 (depends on Mojolicious)
07:53 cpan_mojo Clustericious 0.9944 by PLICEASE - http://metacpan.org/release/PLICEASE/Clustericious-0.9944 (depends on Mojolicious)
07:57 cpan_mojo PlugAuth 0.30 by PLICEASE - http://metacpan.org/release/PLICEASE/PlugAuth-0.30 (depends on Mojolicious)
08:00 Vandal joined #mojo
08:01 amon joined #mojo
08:01 cpan_mojo Yars 1.08 by PLICEASE - http://metacpan.org/release/PLICEASE/Yars-1.08 (depends on Mojolicious)
08:14 trone joined #mojo
08:29 martin joined #mojo
09:02 AndrewIsh joined #mojo
09:03 bramirez joined #mojo
09:43 mattastrophe joined #mojo
09:44 irq joined #mojo
09:51 meshl joined #mojo
09:53 fhelmber_ joined #mojo
10:26 alnewkirk joined #mojo
10:29 bramirez joined #mojo
11:22 mattastrophe joined #mojo
11:36 meshl joined #mojo
11:36 * tempire is surprised that apple chose a usb standard
11:37 marcusr tempire: I'm delighted.
11:37 tempire I'm good with it, except for the disappearance of magsafe
11:37 tempire That was such a great thing
11:38 marcusr All my magsafe cables are torn tho.
11:38 marcusr I think with 9h battery life, I will have my laptop connected less.
11:51 neilhwatson joined #mojo
11:59 mattastrophe joined #mojo
12:01 ver joined #mojo
13:11 gryphon joined #mojo
13:15 zivester joined #mojo
13:21 OmarOthman joined #mojo
13:21 Ralesk joined #mojo
13:23 tempire Call for papers announcement has been tweeted from @mojoconf
13:23 tempire Retweet as necessary.
13:28 marmez left #mojo
13:36 marcusr i haz retweeted
13:42 marcusr is someone emailing the list as well?
13:51 tempire Looks like you've volunteered.
13:51 tempire else, jberger probably will
13:52 Dandre left #mojo
13:56 marcusr https://www.evernote.com/shard/s22/sh/dd606428-da1b-40f1-abc0-7dd12489b76e/27912e49cc142d3ceb785d708070d1f6
13:56 marcusr should I send it?
13:57 jberger marcusr: On Behalf of ...'
13:58 jberger MojoConf 2015?
13:58 marcusr Behind your mother
13:58 jberger Mojo core isn't really the issuing body is it?
13:58 jberger :o
13:59 marcusr I'll just remove the line entirely
14:06 Grinnz #762 - oy vey
14:32 mattastrophe joined #mojo
14:32 gtodd tempire: in your MetaCPAN  profile photo there are cats
14:34 gtodd or maybe kittens .. are they about to be .... you know ... "sacrificed" in order to overcome some coding problem
14:35 tempire They're my posse
14:35 gtodd ... perhaps ironman coding allow kittens to be *saved* ...
14:35 gtodd haha
14:35 marcusr tempire is a cool cat.
14:37 tempire they're devops, security, hardware, and design, starting from the top right
14:37 tempire all with questionable backgrounds
14:37 tempire but we've come together to solve problems
14:37 tempire they all love milk
14:37 tempire except for one.
14:37 tempire he has to be drugged to travel
14:38 ispyhumanfly joined #mojo
14:42 jberger Grinnz: #762 has become the Vardebedian Papers
14:43 gtodd heh
14:43 gtodd love the Eponymous::Hash
14:50 tempire The module or the blog entry?
14:54 sri what the...? 47 new messages in a github issue?
14:57 sri do you want that kind of questions on github?
14:57 sri i don't understand why you try to answer
14:57 jberger I'm done
14:58 jberger I tried to end it in my first message. The following two were probably taking the bait, but trying to curtly end it. My Woody Allen quote, if anyone chooses to try to understand it, has a certain implication to it
15:01 jberger locked
15:02 Grinnz_ inb4 he opens another issue ignoring everything we've said
15:03 kwa joined #mojo
15:03 bramirez joined #mojo
15:05 sri jberger: we do use github issues for feature requests now
15:05 jberger orly?
15:05 purl YA RLY.
15:05 pink_mist botsnack
15:05 purl :)
15:05 jberger well I guess I unlock it then?
15:05 * jberger sighs
15:05 sri just not for everyday support questions
15:06 jberger he is requesting a change, he wants to remove the fieldhash for performance reason
15:06 sri which is what the issue started out as before it got edited completely
15:06 sri it should have never reached that stage
15:06 jberger he is convinced (without a shred of proof) that the fieldhash does nothing
15:07 sri yesterday it was "i asked on the list bug got no answer yet, why you use fieldhash?"
15:07 sri and so i asked to get it closed, which crab did
15:14 sh4 joined #mojo
15:15 batman sri: I'm very sorry :(
15:18 Grinnz_ he's removed all his comments in the issue now
15:18 Grinnz_ lol
15:18 sri and he keeps editing everything he ever wrote
15:18 sri it's entirely incoherent when you read it now
15:20 jberger a very mature response, to be sure
15:20 sri i will delete his code comments now
15:20 sri he uses them to communicate with jberger
15:20 sri by editing...
15:21 sri one more and i block him
15:21 genio ugh.  Why not just join the channel and talk about it here rather than annoying you guys to death with comment editing?
15:21 jberger well wether my reasoning the lock message was correct, I stand by the lock
15:22 dod joined #mojo
15:22 jberger his arguments consisted of "I'm convinced that your mechanism for detecting leaks is flawed, therefore I will reject that, without evidence. Now prove that your code is useful"
15:22 sri he wanted to force someone to defend fieldhash use
15:23 jberger I did
15:23 mattastrophe joined #mojo
15:23 sri yes, that was wrong
15:23 sri at least on github
15:23 jberger my blog post takes your old example and explains it quite nicely, he rejected that, so I ended the discussion
15:23 sri you could have done it on the mailing-list
15:24 Dandre joined #mojo
15:25 sri this is not the first time it happened, people repost list questions because they are getting the impression github issues get more attention
15:26 jberger indeed
15:26 sri and this one went totally out the window because comments were edited beyond recognition
15:26 crab they must be summarily crushed.
15:26 sri github is not a mailing-list
15:26 jberger well the only comment I regret was this one: https://github.com/kraih/mojo/issues/762#issuecomment-78984018, the others were are pointedly about ending it
15:27 jberger s/are/all/
15:28 * marcusr crushes all resistance
15:28 sri for the record, this is the original question https://groups.google.com/d/msg/mojolicious/vhsbMULsA8A/1OfTHuQ0lI8J
15:29 asarch joined #mojo
15:33 Grinnz_ i like how this tirade started with "sorry for stupid question"
15:39 cereal joined #mojo
15:48 hesperaux__ joined #mojo
16:04 sh4 joined #mojo
16:07 OmarOthman left #mojo
16:11 hesperaux__ joined #mojo
16:17 sri hmm, i can make circular references without using fieldhash in Mojo::IOLoop::Delay, but somehow not leak memeory
16:20 sri https://gist.github.com/anonymous/53a09d0023f170c1a637
16:20 sri that test should leak
16:21 sri once this patch is applied https://gist.github.com/anonymous/bf8262d50738682cfcb5
16:22 sri alexbyk might have had a point
16:23 jberger his point was that you leak even with it, so I wouldn't give too much credit there
16:24 sri either fieldhash is useless, or os x memory usage stats are completely useless
16:30 sri seriously, i can't get the example to leak
16:30 sri the explicit clearing of ->remaining() might be enough for perl to be able to garbage collect
16:31 sri it's not os x memory stats, i just forced a leak and it was very visible
16:32 sri batman, jberger: now would be a good time to talk :)
16:39 crab joined #mojo
16:41 jberger I don't have any compelling arguments to make, and I really have to keep $work-ing, I have been too lax about that this week as it is :/
16:47 sri i don't want an argument, i want help
16:48 sri something is wrong here
16:48 sri you've been arguing for hours about nothing, this is actual code that needs looking into
16:49 sri batman: you've even posted code earlier
16:50 Oleg joined #mojo
16:51 Grinnz_ how do i test it? just run leak.pl then watch its mem usage?
16:51 Grinnz_ with the patch applied
16:52 sri jberger, batman, marcus, tempire, crab: this is a fieldhash removal patch https://gist.github.com/anonymous/bf8262d50738682cfcb5
16:52 sri this is a leak test https://gist.github.com/anonymous/53a09d0023f170c1a637
16:53 Grinnz_ it's maxing a cpu core but holding steady on mem usage
16:54 Grinnz_ going to try on my fedora machine
16:54 sri this is a more traditional case https://gist.github.com/anonymous/7428e08e481e04912ee0
16:54 sri somehow nothing leaks
16:56 sri i'm very confused right now
16:56 Oleg sri: it was garbage collected because Delay deletes steps when executed it
16:57 Grinnz_ the one without a delay isn't leaking either, though
16:57 sri right, neither is leaking
16:57 Grinnz_ same on both my machines
17:00 Oleg I think so: step has circular reference, but then Delay executes it and deletes, so circular reference removed. No chance to leak
17:01 acochran joined #mojo
17:01 Grinnz_ Oleg: the second one does not use a delay
17:01 Grinnz_ 12:54:11               <sri> this is a more traditional case https://gist.github.com/anonymous/7428e08e481e04912ee0
17:01 Oleg let me see
17:02 sri i fscking hate ref counting
17:04 sri there totally is a cycle in $ua after the the first ->get call
17:07 sri i suspect it gets resolved when the request succeeds and the callback is deleted too
17:08 jberger what is the performance loss on fieldhash, is this worth wondering about?
17:08 sri this is about doing the right thing
17:08 sri if fieldhash doesn't gain us anything, why the hell would we use it?
17:08 btyler I think from a pure design perspective the onus is on using fieldhash
17:09 Oleg but $ua didn't store callback somewhere inside like $ua->{cb} = $cb, so there was no circular references. Am I wrong? :p
17:09 sri Oleg: you're wrong
17:09 sri there is a circular ref
17:10 sri just find_cycle $ua
17:12 sri let me make it more obvious
17:12 sri this one leaks like crazy https://gist.github.com/anonymous/3efd2fc405b04d2da90e
17:13 sri the delay example without ->wait leaks like crazy too https://gist.github.com/anonymous/52e7c7b557141d44fef7
17:14 Grinnz_ that one just dies with Too many open files
17:14 Grinnz_ lol
17:14 sri fieldhash or not makes no difference whatsoever
17:15 sri Grinnz_: that's the point, you leak enough user agents
17:15 gtodd ref counting makes you weaken
17:15 Oleg how this even works without started event loop?
17:16 sri delay still provides a certain leak protection, but fieldhash contributes nothing to it
17:16 sri it merely hides cycles from Devel::Cycle
17:18 perigrin joined #mojo
17:18 Oleg i agree
17:18 perigrin left #mojo
17:20 sri where alexbyk had a point was that it not just hides false positives, but also positive positives... like using the delay instance in a circular manner
17:20 Oleg sri: don't understand, who starts event loop in this example https://gist.github.com/anonymous/52e7c7b557141d44fef7 ?
17:20 sri Oleg: nobody, that's the point
17:21 sri it leaks because the user agent can't fire callbacks
17:21 sri which i used to prove that fieldhash steps behaves exactly like steps stored in the delay object
17:23 disputin1 joined #mojo
17:23 sri Devel::Cycle can't find them with fieldhash, but they are just hidden, in both cases they only get cleaned up after callbacks have fired and steps explicitly cleared by the delay object
17:23 Oleg Ah, I see
17:24 tgt joined #mojo
17:26 disputin joined #mojo
17:26 Kripton I am trying to develop some kind of sql abstract to Mojo::Pg
17:27 jberger sri: interesting
17:27 Kripton this should be done in Mojo::Pg:Database right ?
17:27 Kripton so we can use $db->query or $db->insert
17:28 disputin joined #mojo
17:29 Kripton am I on the right path ?
17:31 punter joined #mojo
17:33 Grinnz_ Kripton: sri was doing something like that the other day
17:36 sri let me sum it up... fieldhash: Devel::Cycle does not see the curcular references we can clean up and the ones we can't clean up (circular $delay)... no fieldhash: Devel::Cycle sees everything, cycles we can and can't clean up
17:37 sri fieldhash can make actual leaks very very very hard to detect, but without fieldhash e will see lots of false positives
17:39 Kripton Grinnz_: there is nothing on github about that, but I will try do it anyway, because I need this for yesterday :)
17:40 Grinnz_ Kripton: he essentially just added insert/select etc methods that called SQL::Abstract's methods
17:41 Oleg sri: so, will you remove fieldhash?
17:42 crab joined #mojo
17:43 sri Oleg: don't know
17:43 purl i heard don't know was it proper place, but who cares? https://rt.perl.org/Public/Bug/Display.html?id=122906
17:43 Kripton Grinnz_: this was my first thought, but SQL::Abstract requires tons of modules, I was thinking in something more light
17:44 Grinnz_ Kripton: for it to go in mojo maybe, but for your own use i dont see why not
17:44 sri Kripton: http://irclog.perlgeek.de/mojo/2015-03-11#i_10261996
17:44 Grinnz_ purl: forget don't know
17:44 purl Grinnz_: I forgot don't know
17:45 crab i think i might have been better off with broken UTF-8.
17:45 Grinnz_ lol
17:47 crab joined #mojo
17:48 sri think i'm going to wait a bit for comments from jberger and batman, and then remove fieldhash and all mentions of delays protecting from memory leaks
17:51 crab joined #mojo
17:51 dod joined #mojo
17:51 sh4 joined #mojo
17:54 crab joined #mojo
17:57 mattastrophe joined #mojo
18:01 memowe joined #mojo
18:22 batman sri: I'm out drinking beer. But from my code earlier, I think inside out is a good idea.
18:22 batman But I might be wrong.
18:22 batman I will try to look at it tomorrow :/
18:25 sri batman: why?
18:26 sri don't make statements like that vanish
18:26 sri *+and
18:26 sri "sri: here's a dozen test cases that show fieldhash doesn't do anything"..."batman: from my code, i think fieldhash is a good idea *vanish*"
18:27 sri !@#$%
18:27 * tianon sets banman on fire (for a change)
18:27 tianon *batman
18:27 tianon dammit
18:27 * tianon sets himself on fire too
18:28 sri you're doing the exact thing you scolded alexbyk for earlier
18:28 sri just because Devel::Cycle shows a cycle doesn't mean it's a leak
18:29 sri do you actually know why Mojo::IOLoop::Delay currently works?
18:30 sri it's manual garbage collection
18:30 sri we clear the fieldhash manually when the delay thinks it is done
18:30 sri without fieldhash Mojo::IOLoop::Delay just breaks the cycles
18:31 sri and please correct me if i am wrong
18:34 sri i'm just going to assume you mean this code https://github.com/kraih/mojo/issues/762#issuecomment-78857195
18:34 sri which is totally wrong
18:35 sri you don't do "$o->remaining([])" and "delete $o->{remaining}"
18:35 sri which is what delays do
18:36 sri *heart attack*
18:37 sri but seriously, i could literally just make shit up because nobody (including me) fully understands what's going on
18:40 marty joined #mojo
18:41 batman sri: Which statement? "I might be wrong"?
18:41 trone joined #mojo
18:41 batman I don't think I'm wrong. I think that whole conversation is a big troll.
18:42 batman I think the statements in the issue is not true, and I stand by the references I refer to.
18:43 sri you do get that a cycle does not have to be a leak right?
18:43 Oleg I can make some research on this topic tommorow and write post with clarification. This may be interesting
18:43 batman Yes. I also tried to get that through in the conversation.
18:45 batman I think memory consumption, leaks and cycles are not necessarily the same thing
18:46 batman Also if my program use 100MB more memory when it's done, doesn't mean there's a leak.
18:46 batman It just means I used 100MB at some given time
18:47 sri let me put it another way, your example has no relevance to how delays work
18:48 batman sri: I know. I tried to explain how circle reference leaks work.
18:48 sri objects like Mojo::UserAgent hold closures with references to the delay, so if the callback never runs, you leak
18:49 batman sri: One thing: from my perspective, the objects are not garbage collected, because the IOLoop holds a reference to the objects.
18:49 batman Please correct me, if I'm wrong.
18:49 sri i don't care about those examples
18:49 sri alexbyk was very very wrong
18:50 batman Then I don't follow.
18:50 * batman scrolls back
18:50 sri well, i said if alexbyk edits his comments one more time i'd block him... guess now i have to
18:51 sri he's trying to curcumvent the issue lock now
18:51 sri *circumvent
18:51 Oleg he didn't know :D
18:51 sri he did know the issue is locked
18:51 Grinnz_ he's being willfully belligerant now
18:51 sri he completely rewrote the original issue
18:52 sri and blocked
18:52 sri if temporary or permanent will depend on what happens now
18:54 batman sri: I stand by that fieldhash is better than no fieldhash.
18:54 marty joined #mojo
18:54 batman I think it prevents stupid mistakes.
18:54 batman At least it has avoided a bunch of leaks in my code.
18:54 batman If there's an alternative to fieldhash that's does the same thing.... Well, I don't know what that is.
18:56 sri batman: prove it
18:56 Grinnz_ batman: i think a good example of where it prevents a leak would be appreciated
18:56 sri batman: all i want is an example for real code that leaks without fieldhash
18:56 sri nothing more
18:56 sri one example, and  then i'll even add it as a test
18:56 batman sri: Isn't that what my example in the issue does?
18:56 sri no
18:57 sri you're ignoring manual garbage collection
18:57 sri i want a real mojolicious example
18:57 sri with Mojo::UserAgent or whatever
18:58 sri timers, io watchers... i don't care
18:58 batman That's the whole point of a cycle: there's no manual GC
18:58 batman Fuck.
18:58 batman Delete that last statement.
18:59 sri but with delays there is manual GC
18:59 sri because of $delay->remaining([])
18:59 sri that *is* manual GC
18:59 batman Hmmmmmmmmmmm
18:59 batman Exactly.
18:59 * batman thinks
18:59 batman But slow.
19:00 sri i think under the circumstances some swearing is acceptable... as long as it's not directed at others ;p
19:00 batman sri: Im going to bet beaten up if I don't get off my phone now.
19:01 batman Yeah. Sorry. About the bad mouth.
19:02 mattastrophe joined #mojo
19:02 batman sri: I'll be back. Stronger. Faster. Better.
19:02 batman (Hopefully)
19:02 sri does anyone still have the original text of the issue?
19:03 memowe joined #mojo
19:04 Oleg don't you received on email?
19:04 sri deleted
19:05 sri sucks that github doesn't keep an edit history
19:05 crab hello. I asked in GG but got no answer, sorry for repeating myself, but i'm very-very curious.
19:05 crab Why Mojo::IOLoop::Delay uses  Hash::Util::FieldHash ? And how it fulfil this: "stored outside the object to protect from circular references".
19:05 sri gist it please
19:06 Grinnz_ 15:05:20               <sri> sucks that github doesn't keep an edit history
19:06 sri i want to reset the original text of the issue
19:06 Grinnz_ yeah, they should use some sort of version control...
19:07 Grinnz_ sri: i have all of his original comments as emails
19:07 crab just the text? whole email?
19:07 sri just the text is fine
19:08 * pink_mist is confused how crab managed to sneak newlines into his irc messages
19:08 crab https://gist.github.com/amenonsen/e5550746e9b392ab9b02
19:08 crab pink_mist: when you're as old and devious as i am...
19:08 Grinnz_ lol
19:08 Grinnz_ its not a newline just a lot of tab characters or something
19:09 pink_mist tabs would be displayed as invert-coloured Is
19:09 pink_mist there aint no tabs there
19:09 crab how about spaces?                                                                                                                                                                                                                                                                                                                                                                                                               would those work?
19:09 sri ok, reset
19:09 sri crab++
19:10 pink_mist crab: I suppose they might :P
19:10 Grinnz_ ah yes, spaces, my terminal just highlights them weirdly :)
19:10 mst I keep wondering why they don't just stick the issues in a repo like they do with gist
19:10 sri seriously
19:10 purl is that for real?
19:11 sri purl: seen alexbyk
19:11 purl alexbyk was last seen on #dbix-class 311 days, 36 minutes and 59 seconds ago, saying: OK. Thanx. At least now I know that I should do that by subclassing (or better don't do that at all)  [May  6 18:34:30 2014]
19:13 crab it would be funny in a schoolyard sort of way if jberger and batman deleted all their messages too and replaced them with "well, if you're going to call me names, i'm not interested any more"
19:13 berov joined #mojo
19:13 Grinnz_ lol
19:15 sri now back on topic, can anyone come up with a case where filehash delays prevent a leak?
19:15 tianon even the wiki is repo-accessible :x
19:18 sri if you want to argue that fiedhash prevents false positives with Devel::Cycle, that's a valid argument too
19:20 jberger sri: still busy at work, but I do have all the emails that github generates
19:21 sri thanks, but already fixed
19:21 sri we are now back to fieldhash or no fieldhash
19:25 mst that would potentially be an argument ... but OTOH it has to compete against "harder to Dumper" IMO
19:25 Grinnz_ coderefs arent very interesting in dumper anyway
19:25 mst anything that makes something harder to Dumper, to me, has to justify itself as being worth my having to remember to dick about while debugging
19:25 mst yeah, but at least I know they're there
19:26 mst this may say more about my debugging strategies than anything else
19:26 mst hence the 'IMO' rather than claiming it as a plain argument
19:29 good_news_everyon joined #mojo
19:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/p7Vy
19:29 good_news_everyon mojo/master c460416 Sebastian Riedel: mention what to watch out for with delays
19:29 good_news_everyon left #mojo
19:29 sri maybe that's the right thing to do?
19:31 mst sri: I don't think Devel::Cycle alone justifies harder-to-Dumper
19:31 mst though of course you could always add an introspection method
19:31 sri mst: you're arguing for not using fieldhash?
19:32 mst I'm arguing for "don't use fieldhash, unless we can prove that the benefits outweigh what I regard as a POLS violation - especially since the POLS violation occurs during debugging, which is usually the worst possible time"
19:33 mst sri: does that make sense? (i.e. is it clear, not asking for agree/disagree yet if you're still thinking)
19:33 sri i read that as "it's all messed up either way"
19:35 sri it does appear to be a Devel::Cycle vs Data::Dumper kind of argument now though
19:35 mst well, I mean, it's software, so that's probably going to be true no matter what we do
19:35 batman sri: I don't get why my example is invalid :(
19:35 sri leaks are a real problem, and we teach Devel::Cycle use
19:35 mst but I'd find "getting reports of cycles that will go away later" less confusing than "Dumper doesn't give me the whole truth"
19:36 sri mst: it's impossible to teach beginners about cycles that will go away later
19:37 sri almost certain it would trip me up from time to time
19:39 sri jberger, marcus, tempire, batman, crab: vote?
19:39 mst sri: yes. but, equally, any time I have an object where its guts aren't visible normally, that trips me up from time to time, even when I -know- that's the case theoretically
19:40 mst so it's a question of which is the lesser of the two evils
19:40 sri that's what it is
19:41 Grinnz_ well, unless we can get a working example of a leak that the fieldhash solves
19:41 * sri nods
19:42 mst hrm
19:42 mst sri: is it the 'remaining' arrayref that you store in the fieldhash?
19:42 sri yes
19:42 punter joined #mojo
19:43 mst it occurs to me that you could 'fix' the Dumper problem just by doing weaken($self->{remaining} = $remaining_fieldhash{$self});
19:44 basic6 joined #mojo
19:44 sri interesting thought
19:45 mst yeah, I'm filing that for "if I ever have a need for fieldhashes, consider doing that so I don't trip myself up debugging"
20:00 bobkare joined #mojo
20:02 batman sri: https://github.com/kraih/mojo/issues/762#issuecomment-78857195 <--- the output from this code is invalid?
20:02 sri batman: yes
20:02 sri not invalid, it's irrelevant
20:03 irq joined #mojo
20:03 batman because of the manual garbage collection?
20:09 bobkare joined #mojo
20:11 good_news_everyon joined #mojo
20:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/p7bF
20:11 good_news_everyon mojo/master 0dbb032 Sebastian Riedel: allow more Mojo::IOLoop::Delay introspection
20:11 good_news_everyon left #mojo
20:12 sri mst++ # great idea
20:12 batman sri: how about? https://github.com/kraih/mojo/issues/762#issuecomment-78883846
20:14 sri batman: for that one is context missing it seems
20:15 sri all i care about now is real test cases
20:15 sri cases where fieldhash delays actually prevent a leak
20:15 sri i want to see an actual leak if the fieldhash is replaced with a normal attribute
20:16 mst sri: personally, given the restoration of Dumper-ability, "avoids find_cycle confusion" would seem to me to be a sufficient argument for keeping it
20:18 ryanc joined #mojo
20:20 batman i think the lack of dumper-ability is a bit confusing, but also something i don't miss
20:20 batman reason: i don't miss having memory leaks.
20:21 batman i use Mojo::IOLoop::Delay heavily @work (without the web framework) and stuff "just work now"
20:21 batman i don't have to restart processes daily because of memory leaks.
20:21 mst batman: nobody has yet proven the fieldhash part saves you from a leak
20:22 mst until you can do that, that argument isn't on the table
20:22 batman so why did we move to fieldhash in the first place?
20:23 batman bad hunch...?
20:35 sri fieldhashes have the theoretical ability to prevent cycles, which is what you've tried to prove
20:36 sri what has yet to be proven is that it applies for delays
20:36 sri due to manual GC breaking the cycles in steps
20:44 batman sri: How much time do I have?
20:54 sri batman: for what?
20:54 purl for fun.
20:55 batman sri: to prove that i think fieldhash should stay
20:56 sri batman: if you don't already have an example, i doubt you'll ever come up with one
20:58 batman sri: http://grog-blog.com/wp-content/uploads/2014/02/barney-stinson-challenge-accepted.jpeg
20:59 mst sri: if fieldhashes + a weak ref make find_cycle -and- Dumper work, I'd keep them just for the niceness while debugging
21:00 mst anyway. I think I basically said that already, so I'll hush now
21:02 * sri agress, Devel::Cycle niceness is not a bad argument for keeping it
21:51 Zoffix joined #mojo
21:53 sri was there a good reason why we don't support an _method parameter to override the native request method?
21:57 disputin joined #mojo
21:58 sri i guess it would trigger param parsing for all requests
21:58 sri hmm
22:01 sri this makes adding remove to the Mojo::Pg crud example kinda suck
22:02 sri would be nicer if form_for could generate a hidden input element with name=_method value=DELETE
22:02 sri and it was then automatically handled by the router
22:02 Zoffix Hey all. I'm new. A weird question: what is your approach on maintaining Mojolicious code backwards compatible? Over the last year, I had a few modules that use Mojo::DOM, because the interface changed. Today, I was looking through the list of mojolicious apps, and a few had GitHub Issues, saying the code needs to be updated to newer version. How often does it happen that a newer version breaks old API?
22:02 memowe joined #mojo
22:03 Zoffix I'm looking for a new framework for $work and Mojolicious looks attractive, but I'm kinda worried about ending up patching all our websites every few months due to breaking changes.
22:03 Grinnz_ if you update every 2 months or so and read through the changelog for deprecations you should be ok
22:03 sri Zoffix: http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-about-backwards-compatibility
22:04 Grinnz_ the 6.0 release was recently so i imagine several modules have to be updated for that
22:04 jberger Zoffix: I also would suggest Carton to pin your dependencies
22:05 Grinnz_ if you want something that favors backwards compatibility above all else, catalyst is still around
22:05 berov Zoffix: use a common codebase for all your sites and you will be patching less :)
22:05 jberger sri: would the router see _method and use that rather than the actual method?
22:05 sri yes
22:05 jberger I've wanted a form to use PUT just the other day too
22:06 Grinnz_ i don't like the implications of that
22:06 sri but, like i said, that would require us to give up on-demand form parsing
22:06 sri once $c->req->param('_method') is called, things get parsed
22:07 Zoffix OK. Thanks all. I'm convinced then :)
22:07 Grinnz_ any user can insert a _method into the form body and then trigger a different controller action?
22:08 sri Zoffix: if you use Carton and update in 2 month steps (slightly below deprecation deadline), it should be pretty painless
22:08 sri Grinnz_: could, yes
22:09 Grinnz_ that is not something i would want
22:09 sri for the record, it's how pretty much all frameworks do it
22:09 sri rails, laravel, express...
22:09 Grinnz_ not a security problem, since technically anyone can make any request
22:09 Grinnz_ but it stil lmakes me uneasy
22:09 Grinnz_ hmm
22:10 Grinnz_ i guess i don't see the need since i never use anything but GET or POST
22:10 sri point is to be more RESTful
22:11 sri $r->delete('/posts/:id') instead of $r->post('/posts/:id/remove')
22:11 Grinnz_ usually my forms are using javascript anyway, though
22:12 sri that's actually an argument in favor
22:12 sri ajax requests can use real http methods, this way you have one route for both
22:12 Grinnz_ how? javascript can use whatever method i wishes
22:12 Grinnz_ it*
22:13 sri right, and if you start with a normal form, you'd have to change the route
22:13 Grinnz_ wasnt changing the route the point of this?
22:13 sri form_for actually has a cool http method detection feature, i think we could detect DELETE and add a hidden input element automatically :o
22:14 nicomen Why not split up Mojolicious into many smaller distributions? <-- this question. I feel one could add the size of Mojolicious, and the fact that you want to install it even if you are not using the web server parts
22:15 nicomen for the usefullness of Mojo::JSON, Mojo::Util, Mojo::URL and Mojo::DOM
22:15 Grinnz_ i do indeed use those standalone for various things
22:15 nicomen if you get the corresponding modules off of CPAN, well, the math should basically be self-explanatory
22:15 Grinnz_ but its a question of maintenance effort
22:16 nicomen For me most people complainig about modules not being avaialble separate is because they have a crazy idea that installing "ALL" of Mojolicious is so much
22:16 Grinnz_ thats kind of silly, considering the no dependencies
22:16 nicomen well, yeah, it's psychologically, "why would I need an extra web framework just for X"
22:17 Grinnz_ i mean, there's more cruft you don't use in the perl core than there would be in mojolicious
22:17 nicomen hey, _I_ don't need to be convinced ;)
22:17 nicomen but it would help to point to such persons to a "do the math" answer ;)
22:18 Grinnz_ meaning what?
22:18 purl meaning is probably in the individual, whether a definition of a word, connotation of a symbol, or impression of a painting.
22:19 mst nicomen: you can't reason somebody out of a position they didn't reason themselves into
22:19 Grinnz_ oh, you mean add to that FAQ answer about the size and ease of installation of mojo
22:19 jberger this is why I call it the "Mojolicious Toolkit" whenever I can
22:20 nicomen jberger: and we agree ;)
22:20 nicomen I noticed now it's 635kb though, so maybe my argument is not valid size-wise at least
22:23 nicomen most of its size is due to awesome docs though
22:23 jberger right, its tiny
22:24 jberger and with parallel install it goes very quickly
22:24 jberger the bigger issue is that the Mojo::IOLoop and/or Mojo::Base are involved in almost all of the system, so how would you split it up? not worth it
22:26 nicomen dependencies lol ;)
22:26 Grinnz_ splitting something out that has to depend back on the main project seems like a pointless exercise
22:27 kaare joined #mojo
22:29 nicomen yeah
22:34 sri i think something like this could work for _methods https://gist.github.com/anonymous/4f68e1ed2514e2e6749c
22:35 sri quick one-liner https://gist.github.com/anonymous/ac2b972f475120669ad7
22:41 sri well, now is your chance, i'm open to the idea
22:41 Anon021 joined #mojo
22:44 sri allright, and it's off the table again :)
22:44 jberger wow, short trigger ;_
22:44 jberger ;)
22:44 Grinnz_ sri is like newegg shell shocker deals
22:45 jberger just thinking about it, I might just do the hook for myself
22:46 sri i was thinking of adding a delete to the blog example, but with the hook it gets too big https://github.com/kraih/mojo-pg/blob/master/examples/blog/lib/Blog.pm
22:49 sri posts#remove would be a DELETE, and posts#update a PUT/PATCH
22:51 sri (like i said before, we are not as good at crud as we could be)
22:52 firnsy if it were back on the table, i would definitely convert all my form based CRUD to that
22:53 sri nope, time's up i'm afraid
22:53 firnsy np, /me moves along
22:53 csson joined #mojo
22:54 sri using a query parameter felt awkward anyway
22:55 sri but adding a hidden input element is even worse
22:55 juikuen joined #mojo
23:01 sri looks like django does not support _method
23:05 firnsy django is a beast
23:06 Zoffix joined #mojo
23:07 mattastrophe joined #mojo
23:08 berov sri: Thanks for the blog example it is inspiring :)
23:08 Zoffix How is morbo getting its perl? I have 5.14 system and 5.20.1 through perlbrew, but I'm getting Perl v5.20.0 required, even though perl -v reports 5.20.1: http://fpaste.scsys.co.uk/469396
23:09 sri Zoffix: https://github.com/kraih/mojo/blob/master/script/morbo#L1
23:10 sri berov: :)
23:13 berov sri: If I understand shifting from pg https://github.com/kraih/mojo-pg/blob/master/examples/blog/lib/Blog.pm#L17 ensures one handler during the life of the  Blog::Model::Posts instance
23:14 Zoffix hm, mine's different :S http://fpaste.scsys.co.uk/469397
23:14 berov which allows for a "linear" coding (i.e no =>sub{...}) during a request
23:14 sri it ensures everyone is using the same Mojo::Pg instance
23:15 berov well with the helper - yes
23:16 sri Zoffix: gets rewritten on install by EU::MM
23:16 berov I understood it ensures every method in the Blog::Model::Posts instance uses the same pg instance
23:16 jnbek joined #mojo
23:17 berov sri: Who is "everyone"?
23:17 purl "everyone" is using it!
23:21 berov sri: ok got it
23:24 berov sri: is this app real time? like one process serves many requests non-blocking?
23:25 Zoffix Oh, it's using #!/usr/bin/perl instead of #!perl or #!/usr/bin/env perl.... Do I just rewrite that manually? Trying to get the example at the bottom of http://mojolicio.us/ to run...
23:26 berov I mean one request is blocking by it self but does not stop other requests to be served
23:26 berov ?
23:26 sri Zoffix: the question is, why do you install mojolicious with a different perl than you want to run it with?
23:28 Grinnz ^ this, it should rewrite it to whatever you ran cpan or cpanm as
23:29 Grinnz berov, if you run it with a prefork server each worker will be able to handle a different request at once
23:30 Grinnz otherwise no, it will only do one request at a time when requests are blocking
23:30 berov I do this with regular $dbh too
23:32 berov Grinnz: I was thinking/hoping that shift->pg->db returns the next available connection
23:32 Grinnz berov, i dont know what that has to do with blocking or not
23:32 berov and behind the scene happens the event loop magick
23:33 Grinnz there's no magic to make something nonblocking
23:33 jberger ETHEREISNOMAGICK
23:34 nicomen Ticket #567: Please add more magicks!
23:35 jberger ticket closed, reason: op has been set on fire
23:35 Zoffix sri, thanks. Sorted it out. My perlbrew/cpanm was misconfigured, so that when I ran cpanm it was using 5.14 instead of whatever perlbrew was using.
23:35 berov if shift->pg->db returns the next available connection then I - the dummy user - can be ignorant about how it works
23:36 sri it does return the next connection if non-blocking operations are happening in the background with another connection
23:36 Grinnz CLOSED SETONFIRE
23:36 jberger Zoffix: you can blame me for that, but you'll thank me when you never hit the bug I did I'm order to require that too
23:36 berov sri: this is whatI was thinking
23:37 jberger s/I'm/in/
23:37 Zoffix :)
23:38 nicomen arg, I always forget to add --state=save when I run tests with prove
23:41 berov sri: last question:  does it mean that three requests will be served simultaneously with the code form the example (https://github.com/kraih/mojo-pg/tree/master/examples/blog) within one process?
23:42 berov no forking etc, no hypnotoad
23:43 marty joined #mojo
23:44 nicomen berov: is all the code non-blocking? ie all parts yield time back to the IOLoop to continue? -- then yes
23:44 nicomen berov: how about trying it?
23:44 purl trying it is quicker than talking on IRC about not trying it ;>
23:44 nicomen siege or apbench allows you to ssend prallel requests from the command line in an easy manner
23:45 berov nicomen: thanks, will try it
23:51 marty sri++ on blog example.

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