Camelia, the Perl 6 bug

IRC log for #mojo, 2013-05-10

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

All times shown according to UTC.

Time Nick Message
00:31 KindOne joined #mojo
00:45 shmuel joined #mojo
00:48 abqar joined #mojo
01:01 sri btw. to make ->again work with EV i've just made all timers use the recurring version from EV, we just remove them the first time the callback is invoked if necessary :)
01:01 sri it's really nice how much less resources hypnotoad needs now
01:10 good_news_everyone joined #mojo
01:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/e27jEQ
01:10 good_news_everyone mojo/master ab9b5d0 Sebastian Riedel: no need to use a recurring timer for the stream timeout
01:10 good_news_everyone left #mojo
01:15 good_news_everyone joined #mojo
01:15 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dvUxWg
01:15 good_news_everyone mojo/master 5987e78 Sebastian Riedel: mention that timers have to be active for restarting
01:15 good_news_everyone left #mojo
01:18 bpmedley_ joined #mojo
01:20 bpmedley joined #mojo
01:22 xaka joined #mojo
01:28 ka2u joined #mojo
02:00 d4rkie joined #mojo
02:04 btyler joined #mojo
02:43 Kulag joined #mojo
02:51 D4RK-PH0ENiX joined #mojo
02:54 Kulag joined #mojo
02:59 Drossel joined #mojo
03:28 gtodd joined #mojo
03:40 preflex_ joined #mojo
03:48 * sri wonders if showing the User-Agent header in the log is actually a useful feature
03:50 * sri finds those excessively long log messages rather irritating and never got any use out of them since he knows which browsers he's developing with
03:53 fildon_ joined #mojo
03:57 good_news_everyone joined #mojo
03:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/LOse5Q
03:57 good_news_everyone mojo/master 5ef8683 Sebastian Riedel: no more User-Agent header in log messages
03:57 good_news_everyone left #mojo
03:58 sri plain and simple default
04:16 jberger sri++ (for lots of things lately!)
04:16 sri REMOVE ALL THE THINGS!!! \o/
04:19 jberger TOP HAT is going to be classy!
04:19 sri indubitably
04:53 xaka joined #mojo
04:57 ka2u joined #mojo
05:58 yko joined #mojo
06:33 Mike-PerlRecruiter_ joined #mojo
07:01 rihegher joined #mojo
07:05 Vandal joined #mojo
07:09 rihegher left #mojo
07:19 whitebook joined #mojo
07:38 marcus MONOCLE AND TOP HAT http://www.charbase.com/0CA0
07:39 * marcus thought today was monday and expected simpsons this morning.
07:39 marcus Because of day off yesterday
07:46 suy joined #mojo
07:46 yakudza joined #mojo
07:59 ka2u joined #mojo
08:20 maxhq joined #mojo
08:28 jzawodn joined #mojo
08:38 ObseLeTe joined #mojo
08:38 dpetrov_ joined #mojo
08:39 yannickberthoud joined #mojo
09:01 nelio joined #mojo
09:23 basiliscos joined #mojo
09:28 yakudza joined #mojo
09:52 KindTwo joined #mojo
10:02 basiliscos joined #mojo
10:32 bowtie joined #mojo
10:50 sh3 joined #mojo
10:56 hrupp joined #mojo
11:10 batman marcus: should we default to Protocol::Redis::XS if it can be loaded?
11:42 mire joined #mojo
11:52 denisboyun joined #mojo
12:28 SmokeMachine joined #mojo
12:38 gryphon joined #mojo
12:48 gtodd can anyone recommend any ASCII art style charting tools ... or should I just use perlform ?
12:51 gtodd trying to make some simple sparklines / charts etc. in perl that I can dump into text files and thence into Mojo templates --> <pre> ascii ... utf8 char charts </pre>
12:53 rem_lex|pivo joined #mojo
12:59 moltar joined #mojo
13:03 gtodd Graph::Easy::As_ascii :-) might do
13:13 bluescreen joined #mojo
13:27 sri \o\
13:27 sri /o/
13:42 gtodd \o\
13:42 gtodd /o/
13:48 btyler joined #mojo
13:49 marty /o\
13:54 * jberger can't dance, it was shoulders and biceps this morning
14:00 Vandal joined #mojo
14:01 tempire hmm
14:01 tempire The first two pages of my google results are almost entirely me
14:01 * tempire goes for 3 pages
14:02 jberger tempire, what are you searching for?
14:02 tempire my name
14:05 jberger impressive
14:08 jberger it seems there are several prominent Joel Bergers
14:08 jberger including Ph.D.s
14:08 jberger good strong name
14:10 KindOne joined #mojo
14:21 ka2u joined #mojo
14:28 basic6 joined #mojo
14:37 jberger tempire, is it just me or does the raptor on perlr move?
14:38 jberger "That one... when she looks at you, you can see she's working things out. "
14:41 d4rkie joined #mojo
14:44 good_news_everyone joined #mojo
14:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZnGB4w
14:44 good_news_everyone mojo/master 0f3f6d8 Sebastian Riedel: fixed layout bugs in Mojolicious::Renderer
14:44 good_news_everyone left #mojo
14:49 denisboyun_ joined #mojo
15:09 nicomen joined #mojo
15:18 nicomen_ joined #mojo
15:23 good_news_everyone joined #mojo
15:23 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lKF_-g
15:23 good_news_everyone mojo/master 9ef3b05 Sebastian Riedel: small optimizations
15:23 good_news_everyone left #mojo
15:24 perlite joined #mojo
15:29 btyler joined #mojo
15:30 tempire jberger: it does
15:47 nic joined #mojo
15:59 yko mojo++
15:59 xaka joined #mojo
15:59 whitebook joined #mojo
15:59 yko Mojolicious tests suite just helped to find a bug in perl 5.16.x \o/
16:00 sri \o/
16:00 sri it's not even the first time :D
16:02 yko It took me to do and archaeological research and run all tests for all version down to good old times, but it was worth it
16:03 sri yko++
16:07 * gtodd wonders if tempire is sort of a viking ...
16:08 gtodd but mostly wonders about perloku and  Net::Heroku ....
16:10 sri with that beard, maybe a honorary viking
16:13 gtodd hmm the Astérix le Gaulois has hair like that too.... anyway am I grokking both and/or grokking either Perloku or Net::Heroku  by thinking Perloku is just a Heroku buildpack ...
16:14 gtodd not a perl version of the ruby heroku client  ;-)
16:19 gtodd but that the latter may become one ...
16:27 good_news_everyone joined #mojo
16:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/IRotsw
16:27 good_news_everyone mojo/master 03f2b12 Sebastian Riedel: generate template only on demand
16:27 good_news_everyone left #mojo
16:30 sri these little optimizations quickly add up
16:44 ka2u joined #mojo
16:46 al802 joined #mojo
16:47 al802 I have noticed in performance testing of morbo vs hypnotoad, that hypnotoad is 4x (approx) slower
16:48 al802 I'm using Google Chome and using Google PageSpeed extension, I've completed 100 of 100 in the speed requirements
16:49 good_news_everyone joined #mojo
16:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/VCd9-A
16:49 good_news_everyone mojo/master fe66d95 Sebastian Riedel: small optimizations
16:49 good_news_everyone left #mojo
16:49 sri al802: then you're doing it wrong
16:50 al802 Any clues as to what I may be doing  wrong
16:53 al802 My page usually (Morbo) takes about 15ms to generate and serve, under hypnotoad it takes 70+, so is there a configuration setting that needs to be changed
16:58 bluescreen_ joined #mojo
16:59 btyler al802: do you understand the difference between morbo/hypnotoad? they use the same underlying code, morbo just tacks on 'watch this space for changes', some logging, and 'only one daemon' (ie no preforking).
17:00 btyler at least, that's how I understand it
17:02 Britzel_ joined #mojo
17:04 labrown joined #mojo
17:12 al802 I understand that which is why I'm here
17:18 ppp joined #mojo
17:21 ppp joined #mojo
17:33 tempire gtodd: perloku is a buildpack
17:34 tempire net::heroku could easily be wrapped with a command-line tool to be the heroku client
17:35 tempire has anyone used http://cavapackager.com/ ?
17:47 rihegher joined #mojo
17:47 rihegher left #mojo
17:47 jberger_ sri: you didn't add ->again to Mojo::IOLoop?
17:47 jberger_ certainly you can do $loop->reactor->again($id)
17:48 jberger_ but that seems asymmetric vs $loop->timer
17:51 sri jberger_: if you can come up with a good test case i'll add it
17:51 jberger_ test case or use case
17:52 jberger_ the use case is the SO posting from yesterday
17:52 sri until then i consider it low level api, like ->io and ->watch
17:52 sri test case specifically
17:52 sri testing it reliably is actually not that simple
17:52 sri you'll see :)
17:53 jberger_ can testing a pass-through method really be that much harder than the underlying method?
17:54 sri even if you have two timers with different times, order is not guaranteed
17:55 sri so you can't just chain timers, delaying another one
17:55 jberger_ I'm just imagining essentially the same implementation as Mojo::IOLoop::timer
17:55 jberger_ oh
17:55 jberger_ I understand
17:55 sri remember, this has to work for all kinds of event loops, there are very little guarantees
17:55 sri you don't know if io events fire before or after timers either
17:56 jberger_ so while it might be essentially ok for someone doing something like the posting on SO to do $loop->reactor->again, by not putting it in IOLoop you are saying "on your head be it"
17:56 jberger_ and I can understand that
17:57 sri i would be ok with Mojo::IOLoop->again
17:57 sri i just want a clean test for it
17:57 sri and i can't think of one atm
17:57 jberger_ well I certainly can't :-) but I will try
17:58 ask joined #mojo
17:58 sri my brain is toast, odds are i'm missing an obvious one atm ;)
17:58 jberger_ could my demo do it?
17:58 sri which demo?
17:58 jberger_ http://pastie.org/7827789
17:59 jberger_ the one from SO
17:59 jberger_ I was trying it with again
17:59 jberger_ and thats when I noticed that it wasn't in IOLoop
17:59 jberger_ let me rephrase as a test
18:00 sri if you make the timeout too big our tests will take that much longer to finish, if you make them too small the odds of them running together get bigger
18:01 jberger_ yeah, I was just seeing the long nature of the test
18:01 * jberger_ is still learning
18:01 ppp joined #mojo
18:01 * sri tries to test everything with sub second timers
18:02 * jberger_ is looking to see if ioloop.t to see if it could piggy-back somewhere
18:03 jberger_ * is looking at ioloop.t ...
18:16 jberger_ http://pastie.org/7827841
18:17 jberger_ timers that aren't multiples
18:18 sri seems risky
18:18 jberger_ if the $wait timer goes first, the test fails
18:18 * jberger_ probably doesn't understand the risks
18:19 sri lets say you have one core, and while make test you're also compiling perl, how do you know your test doesn't block for 0.2 seconds at the wrong time?
18:20 jberger_ oh, if both events accumulate, even if the timers are different, they still may fire in any order
18:20 jberger_ !
18:20 sri ye
18:20 jberger_ OH
18:20 * jberger_ gets the problem now
18:20 jberger_ :-)
18:21 mrphilov joined #mojo
18:23 sri i've thought about other ways to make it testable, like adding a return value
18:23 sri but am not sure about that yet
18:24 sri like my $time = $reactor->again($id);
18:24 sri perhaps in addition to a my $timer = $reactor->now;
18:25 jberger_ is there any way to know on which tick the event pops
18:25 jberger_ ?
18:25 sri no
18:26 jberger_ if there were, you could setup two events to fire at the same time, each one attempts to 'again' the other then detect that they don't fire on the same tick
18:26 sri oh, you might be on to something
18:28 * jberger_ hands sri the baton
18:28 sri if you have three timers with the same time, two ->again each other, the third should be guaranteed to run before one of the two
18:29 jberger_ there it is!
18:29 * sri thinks some more about what can go wrong
18:31 sri hmm, yea, things can still go wrong
18:31 sri if the loop gets blocked between timers
18:33 sri https://github.com/kraih/mojo/blob/​master/lib/Mojo/Reactor/Poll.pm#L54
18:35 kvorg_ joined #mojo
18:35 kvorg joined #mojo
18:35 sri event loops like EV have a priority setting for watchers to guarantee order
18:36 sri but that's not very common
18:36 sri (you could give one timer a higher priority, to make it runs first)
18:36 Mike-PerlRecruiter_ joined #mojo
18:38 sri hmm
18:41 sri perhaps we should stop the time before timers run
18:44 jberger_ this might not always fail, but it should only fail if again doesn't work: http://pastie.org/7827955
18:44 jberger_ meaning it might have false negatives but SHOULDN'T have false positives
18:45 * sri really dislikes false negatives
18:47 * jberger_ understands
18:52 good_news_everyone joined #mojo
18:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/YFKicw
18:52 good_news_everyone mojo/master 28dd8ad Sebastian Riedel: improved Mojo::Reactor::Poll performance
18:52 good_news_everyone left #mojo
18:52 sri with that change we do have a guarantee that the time does not change in between timers
18:53 sri which is actually faster
18:53 sri (for rather obvious reasons)
18:55 good_news_everyone joined #mojo
18:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/1R2DUw
18:55 good_news_everyone mojo/master 2a32ad5 Sebastian Riedel: comment tweaks
18:55 good_news_everyone left #mojo
18:58 sri i believe EV also only updates it's time once per iteration
19:04 jberger_ could https://github.com/kraih/mojo/blob/​28dd8ade3ba9cc09f727cf8770b05941023​0f502/lib/Mojo/Reactor/Poll.pm#L66
19:04 jberger_ be instead:
19:04 jberger_ ++$i and $self->_sandbox("Timer $id", $t->{cb}, $now) if $t->{cb};
19:04 jberger_ ?
19:05 jberger_ so that the timer callback would be sub { my ($loop, $now) = @_; ...}
19:05 jberger_ then its easy to test
19:06 jberger_ the mutually again-ed timers can't possibly have the same $now
19:06 sri hmm
19:06 moritz joined #mojo
19:07 moritz hi
19:07 jberger_ moritz, o/
19:07 moritz I have a Mojolicous::Lite up, and a handler get '/:channel/' => sub {
19:07 moritz ... }
19:07 sri \o
19:07 moritz now I do a request /style.css, and my handler is called
19:08 moritz even though there is no match for the trailing / in the route
19:08 moritz is that a mojo bug, or a moritz bug?
19:08 sri slash has no meaning
19:08 moritz so, how do I write a route where the slash has a meaning?
19:08 sri you can't
19:08 moritz wtf
19:09 jberger_ moritz, I don't think we are understanding what you are asking for
19:09 sri it would suck pretty bad for nested routes if we allowed that
19:09 jberger_ oh
19:09 moritz jberger_: I'm looking for a route for an URL that ends in a /
19:10 sri while the router can't do it, you can check for $self->req->url->path->trailing_slash
19:11 sri the router doesn't consider leading slash significant either
19:11 jberger_ wildcard placeholders can match the /
19:11 jberger_ http://mojolicio.us/perldoc/Mojol​icious/Lite#Wildcard_placeholders
19:12 jberger_ maybe my mind is too far off in non-blocking-land to be helpful here
19:12 jberger_ :-)
19:15 sri jberger_: think i'd rather add $reactor->now than pass it as an argument to timers
19:16 jberger_ and it would be the same for two timers in the same tick
19:16 sri of course, there's the portability problem again
19:16 sri not all event loops tell you their current time
19:17 jberger_ which is why, if you already that that $now, then thats all you need to tell that they were called in the same tick
19:17 jberger_ then again, I'm not going to say that that makes for a good interface for timers
19:17 jberger_ its just useful here is my only point
19:18 jberger_ * if you already HAVE that $now, ...
19:19 sri so many problems :S
19:29 * jberger_ guesses that sri is going to hate this more, but what about making $now a package variable rather than a lexical
19:31 jberger_ hmmmmm, I only like that if it could be read-only
19:34 jberger_ double hmmmm, all of that can only work for ::Poll
19:35 * jberger_ is stuck I think
19:36 * sri sets jberger on fire
19:40 * jberger_ realizes he's on fire
19:40 * jberger_ jumps into lake michigan
19:53 btyler joined #mojo
19:56 jberger_ sri: http://pastie.org/7828237
19:56 jberger_ this might be it
19:56 * jberger_ wonders if that has any chance of being true
19:57 dpetrov_ joined #mojo
19:58 moritz left #mojo
20:04 jberger_ sri: with test messages which help understand the flow: http://pastie.org/7828277
20:08 sri jberger_: yes, that should work with Mojo::Reactor::Poll after the last change
20:09 Adura joined #mojo
20:09 * jberger_ wipes brow
20:10 gryphon joined #mojo
20:10 sri btw. ok/is in callbacks is something i generally don't do
20:10 sri since you won't notice when they just don't fire
20:10 jberger_ by all means, rewrite as needed
20:10 sri the disadvantage of done_testing()
20:10 jberger_ then again, by testing the end value of pair, it should be ok
20:11 jberger_ oh and test the end value of $single
20:11 jberger_ meaning, add a test for $single == 1
20:15 mattastrophe joined #mojo
20:15 abra joined #mojo
20:17 jberger_ actually it strikes me that this might be the rare case for a test plan
20:17 jberger_ this could be a test file on its own with a plan
20:17 jberger_ because of course only one of the ok tests in the pair callbacks should ever fire
20:18 sri no need
20:18 jberger_ was just a thought
20:18 sri store the result and check afterwards
20:18 sri there's like a hundred tests like that already :)
20:18 jberger_ except that the order matters here
20:19 jberger_ afterwards $pair should be 2
20:19 jberger_ and $pair must be less than two when single fires
20:20 * jberger_ leaves it in sri's hands
20:21 sri false negative is still a possible outcome though
20:21 jberger_ http://pastie.org/7828333
20:21 jberger_ where?
20:22 sri oh, i already adapted your test case :)
20:22 sri just testing a few things now
20:22 jberger_ all I did was add a test for $single
20:22 jberger_ and made the last two tests 'is' vs 'ok'
20:22 sri the test case makes assumptions about the event loop
20:23 jberger_ which are ... ?
20:23 sri all 3 timers have the same timeout, we assume that they can't randomly run in the right order
20:23 jberger_ wasn't that the idea?
20:24 jberger_ thats why the single timer exists to make sure that one of the pair happens after the other in the pair
20:24 sri if the single timer runs before the other two by chance, it's an automatic success
20:24 * jberger_ looks
20:26 jberger_ blast you are probably right
20:27 sri http://pastie.org/7828356 # my adaption btw
20:28 jberger_ looks good
20:29 jberger_ is still thinking about the false negative
20:29 sri it seems to work reliably for EV too btw.
20:29 sri better than no tests at least
20:30 sri perl 5.18 will reduce the probability of reliable false negatives a lot
20:31 sri since keys will be in a different order each time
20:31 sri perl-5.18++
20:32 jberger_ ah good point
20:33 * sri waits for jberger to rewrite the test case to use 1k timers to lower the odds further
20:33 jberger_ hahaha
20:33 KindOne joined #mojo
20:34 sri actually not the worst test case, we have nothing with massive timers yet :D
20:34 jberger_ ok, so the whole point was to add ->again to IOLoop
20:34 jberger_ is that still on the docket
20:34 jberger_ ?
20:34 sri little unsure about that now
20:35 jberger_ I'm not sure its really needed
20:35 sri we can always add it later
20:35 jberger_ as long as using $loop->reactor->again is tacitly approved
20:35 sri if it becomes a thing
20:39 good_news_everyone joined #mojo
20:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/cAiu3w
20:39 good_news_everyone mojo/master 59e38fa Sebastian Riedel: more reactor tests
20:39 good_news_everyone left #mojo
20:39 sri jberger++
20:41 good_news_everyone joined #mojo
20:41 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/kwuW9Q
20:41 good_news_everyone mojo/master 97d5567 Sebastian Riedel: slightly better timer tests
20:41 good_news_everyone left #mojo
20:42 jberger_ again, this is the use-case: http://pastie.org/7828423
20:42 jberger_ it just looks a little funny with the ->reactor in the middle there
20:42 jberger_ but I'm not too worried
20:42 sri i would be surprised if it was a common use case
20:43 sri we do the same for arbitrary io watchers too though... $loop->reactor->io($handle => sub {...});
20:43 jberger_ like you said, if it becomes a thing, we add it
20:44 jberger_ my idea was to make it symmetric with ->timer
20:44 jberger_ specifically $loop->timer
20:47 sri oh, the new mongodb book is out
20:49 suy joined #mojo
20:56 sri wow, bootstrap has its own book now :o
21:01 jberger_ thats a little surprising
21:01 jberger_ the online doc is really good and part of that is that you can look at the source of the site to get real-world use examples
21:17 sri oh, interesting p5p discussion about order of hash keys http://www.xray.mpe.mpg.de/mailing-lis​ts/perl5-porters/2013-05/msg00357.html
21:44 denisboyun_ joined #mojo
22:03 jzawodn joined #mojo
22:19 periapt joined #mojo
22:23 * sri has found more code to remove from mojolicious o/
22:26 sri bunch of proxy methods in Mojo::Message that don't really serve a purpose anymore
22:27 whitebook joined #mojo
22:54 good_news_everyone joined #mojo
22:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/B4d9Cw
22:54 good_news_everyone mojo/master 27c8d96 Sebastian Riedel: removed a few rarely used methods from Mojo::Message
22:54 good_news_everyone left #mojo
22:54 * sri would be surprised if anyone cares about them :)
22:55 ka2u joined #mojo
22:56 sri (all functionality is still present in Mojo::Content of course)
22:59 sri i'm on the edge about Mojo::Message::Request::query_params
23:00 sri on the one hand it's redundant with $req->url->query, on the other it's consistent with $req->body_params and $req->params
23:36 mrphilov joined #mojo
23:47 mrphilov joined #mojo
23:57 mrphilov joined #mojo

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