Camelia, the Perl 6 bug

IRC log for #mojo, 2011-11-19

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

All times shown according to UTC.

Time Nick Message
00:00 Akron Good night!
00:26 sri hmm, i've been experimenting with around_dispatch and i think i don't like it
00:27 sri it costs a 1100 rps app around 20rps
00:27 sri and there are little advantages to the traditional callback solution
00:30 sri http://pastie.org/2886106 # here are both compared
00:30 gshank joined #mojo
00:31 * sri pokes tempire
00:32 * sri pokes crab
00:35 sri ops, without deprecation code the performance loss is smaller, like 5-10 rps
00:37 sri i guess the decision is which version is more mojolicious
00:43 sri also typo…. $next->($c)
00:53 sri hmm, i'm really unsure
00:53 sri kinda like the look of the new version in actual tests
00:54 sri http://pastie.org/2886173 # full unit test
00:55 sri it's LIFO and chained
00:56 sri in the end the cost is about 10 lines of code and 5-10 rps (in a 1100 rps app)
00:58 tempire looks good
01:01 SmokeMachine joined #mojo
01:02 sri tempire: is that a +1? :)
01:02 tempire +.9
01:02 purl 0.9
01:02 tempire nothings perfect :)
01:02 sri :S
01:03 sri yko: maybe i can tempt you with a new bleeding edge feature? :)
01:03 sri marcus: just say +1
01:11 ashleydev joined #mojo
01:12 goatee-marcus +1
01:12 purl 1
01:13 sri Oo
01:13 * sri shrugs
01:13 sri \o/
01:33 SmokeMachine joined #mojo
02:02 jnap joined #mojo
02:33 sri i so hate ref counting
02:33 sri what's the prettiest way to make this not leak? http://pastie.org/2885713
02:35 SmokeMachine_ joined #mojo
02:45 Akron joined #mojo
02:48 Akron sri: Looks good to me, but why do you need $next->($c); i.e. the correct transfer of all parameters?
02:49 sri Akron: don't need it, actually i have both versions implemented, not sure which one to use yet
02:49 sri more important is fixing the leak though
02:51 Akron Oh, okay. What leak? I think without repeated transmission of parameters it's easier to implement chin hooks that don't break anything.
02:51 sri $cb leaks
02:51 Akron Oh ...
02:52 sri this is the part of perl i really hate
02:53 Akron I don't like closures for things like that. ;) It's a lot harder to think in Closures than in "real" objects.
02:53 Akron Although leaking can happen everywhere.
02:54 MojoGuest996 joined #mojo
02:54 MojoGuest996 From: http://news.ycombinator.com/item?id=1277067 (124 hits)
02:55 MojoGuest304 joined #mojo
02:55 MojoGuest304 From: http://www.google.com.hk/url?sa=t&rct=j&​amp;q=html5+irc+client&source=web&cd​=4&ved=0CDIQFjAD&url=http%3A%2F%2Fde​v.xantus.org%2F&ei=NxrHTuGNHKadiAfNv5TjD​w&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
02:55 SmokeMachine_ joined #mojo
03:01 sri undef $cb might work
03:02 sri or makes the leak at least so small it's not noticeable
03:02 jnap joined #mojo
03:06 MojoGuest651 joined #mojo
03:06 MojoGuest651 From: http://www.google.com/url?sa=t&rct=j&a​mp;q=&esrc=s&source=web&cd=4&a​mp;sqi=2&ved=0CEUQFjAD&url=http%3A​%2F%2Fdev.xantus.org%2F&ei=Bh3HTsyoCqj​n0QGWyJUG&usg=AFQjCNGw6nZv0wO42uzUnHhW​cD0vcKNULg&sig2=StmcBMu_nLql5J31cs9urA (1 hits)
03:06 MojoGuest651 hi
03:06 purl salut, MojoGuest651.
03:06 MojoGuest651 ok
03:06 MojoGuest651 how can i get this applet?
03:15 GitHub13 joined #mojo
03:15 GitHub13 [mojo] kraih pushed 1 new commit to master: http://git.io/Dxs_Aw
03:15 GitHub13 [mojo/master] deprecated Mojolicious->on_process and added experimental around_dispatch hook - Sebastian Riedel
03:15 GitHub13 left #mojo
03:15 sri Akron: what do you think?
03:15 purl I think sri should try flossing more often!
03:15 * sri goes flossing
03:21 elb0w_ joined #mojo
03:21 Akron sri++
03:22 Akron Looks really better than the old solution and the new hook variant is extremely powerful!
03:23 Akron Is this always run in reverse?
03:26 sri yes
03:26 sri seemed the most natural way
03:27 sri at least i couldn't think of a case where i wouldn't want the first registered hook the last to run
03:27 arpadszasz joined #mojo
03:27 sri *+to be
03:28 sri kinda, you add a new hook, you wrap around the current chain
03:28 Akron I've got an example: I have a lrdd plugin for discovery and a webfinger plugin hooking into the lrdd discovery. This has to be the first cb in the chain.
03:29 sri doesn't make much sense for core i'm afraid
03:29 Akron I see your point, but I don't know if this is really always the right way.
03:30 sri this will already be a rarely used feature
03:31 Akron sri: I doesn't feel natural to have emit_hook, emit_hook_reverse and emit_hook_chain, that is always reverse ...
03:31 sri what do you suggest?
03:37 Akron sri: Just saw you don't allow a final callback in the emit action. Now I see, why you want the first to be the last one ...
03:38 Akron I would thought it's better to run this in normal order but having a final callback possibility on emission.
03:39 sri you know how to make me want to rip something out again :)
03:40 sri maybe this should all be done in a plugin first
03:41 Akron Hm.
03:41 Akron I should just shut up and be fine with the solution. ;)
03:42 sri well, now you spoiled it ;p
03:42 Akron I think I have to elaborate the plugin solution of my Gist and make it work. I think it's still an improvement regarding the style of on_process.
03:59 sri yea, it's pretty bad, now i don't like that it runs in reverse order anymore
04:00 sri but that's the only clean solution i can think of
04:02 MojoGuest9 joined #mojo
04:02 MojoGuest9 From: http://www.google.com/url?sa=t&rct=j&q=&a​mp;esrc=s&source=web&cd=6&ved=0CEkQFj​AF&url=http%3A%2F%2Fdev.xantus.org%2F&ei=​YSfHTvzVCsygtwfk8YitDA&usg=AFQjCNGw6nZv0wO42u​zUnHhWcD0vcKNULg&sig2=hfJ4Dhmv7a8eiSJ1eyCcqw (1 hits)
04:02 Akron I have to think bout it. While sleeping, I guess. ;) Good night!
04:05 MojoGuest7 joined #mojo
04:05 MojoGuest7 From: http://xantus.tumblr.com/page/2 (10 hits)
04:05 MojoGuest139 joined #mojo
04:05 MojoGuest139 From: http://xantus.tumblr.com/page/2 (11 hits)
04:18 GabrielVieira joined #mojo
05:57 GitHub7 joined #mojo
05:57 GitHub7 [mojo] kraih pushed 1 new commit to master: http://git.io/qCSrhA
05:57 GitHub7 [mojo/master] renamed emit_hook_chain to emit_chain and changed event order from LIFO to FIFO - Sebastian Riedel
05:57 GitHub7 left #mojo
06:00 sri i don't like the way i have to register the default dispatcher hook, but otherwise it seems ok
06:38 marcus doh
06:52 elb0w_ joined #mojo
07:18 Vandal joined #mojo
07:45 elb0w__ joined #mojo
07:52 tholen_ joined #mojo
08:31 Foxcool joined #mojo
08:54 kaare joined #mojo
09:22 batman joined #mojo
09:45 Foxcool joined #mojo
10:52 abra joined #mojo
11:26 Eugene joined #mojo
11:28 sromanov joined #mojo
12:11 jnap joined #mojo
12:12 Psyche^ joined #mojo
12:18 Foxcool joined #mojo
12:57 sr joined #mojo
13:04 noganex_ joined #mojo
13:12 Eugene joined #mojo
13:17 tholen_ joined #mojo
13:26 andrefs joined #mojo
13:44 GabrielVieira joined #mojo
14:15 mattastrophe joined #mojo
14:17 MojoGuest248 joined #mojo
14:17 MojoGuest248 From: http://news.ycombinator.com/item?id=1277067 (125 hits)
14:18 MojoGuest499 joined #mojo
14:18 MojoGuest499 From: http://news.ycombinator.com/item?id=1277067 (126 hits)
14:21 MojoGuest499 test
14:22 MojoGuest195 joined #mojo
14:22 MojoGuest195 From: http://www.google.co.kr/url?sa=t&rct=j&a​mp;q=websocket%20irc&source=web&cd=3​&ved=0CEoQFjAC&url=http%3A%2F%2Fdev.​xantus.org%2F&ei=errHTtCRLOGgmQX12-0x&am​p;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&amp​;sig2=5nTBQL4_NOWUz3rrgdixwA&cad=rjt (1 hits)
14:32 * sri yawns
14:35 * sjn is at the Oslo Drupal Camp, getting an urge to run back to something less.... heavy. o_O
14:41 SmokeMachine joined #mojo
14:51 preflex_ joined #mojo
14:51 * marty waves
14:51 * sri waves
14:55 jnap joined #mojo
14:57 sri any thoughts about the latest incarnation of the around_dispatch hook?
15:02 sri https://github.com/kraih/mojo/commit/0a​f28df4e5596e3352b39518792dcf354319c2a5
15:11 sri i don't like that the default dispatcher hook just magically appears in the last second
15:11 sri you can't modify it
15:12 sri if around_dispatch ran in reverse order you could change everything
15:12 sri but adding new hooks would be less intuitive :S
15:16 elb0w_ joined #mojo
15:31 andrefs joined #mojo
15:39 marty At first glance it makes sense to me.   I'll look at it more when I get back and see if I can give a more informed opinion.  Gotta run, breakfast time.  :)
15:40 kjeldahl joined #mojo
15:46 MojoGuest917 joined #mojo
15:46 MojoGuest917 From: http://news.ycombinator.com/item?id=1277067 (127 hits)
15:57 elb0w_ joined #mojo
16:53 pl0p joined #mojo
16:59 crab eek, drupal
17:02 gbacon joined #mojo
17:24 pl0p joined #mojo
17:26 GitHub181 joined #mojo
17:26 GitHub181 [mojo] kraih pushed 1 new commit to master: http://git.io/DXogIA
17:26 GitHub181 [mojo/master] better after_build_tx hook description - Sebastian Riedel
17:26 GitHub181 left #mojo
17:32 sri i guess now that we encourage people to try events and hook it's important to also mention the drawbacks
18:01 sri hmm
18:05 sri i can actually make it work
18:07 sri the big question now is if i should
18:12 abra_ joined #mojo
18:14 Eugene joined #mojo
18:26 GitHub167 joined #mojo
18:26 GitHub167 [mojo] kraih pushed 1 new commit to master: http://git.io/daWyZw
18:26 GitHub167 [mojo/master] improved Mojolicious::Plugin::Mount to support after_build_tx hooks - Sebastian Riedel
18:26 GitHub167 left #mojo
18:32 GitHub1 joined #mojo
18:32 GitHub1 [mojo] kraih pushed 1 new commit to master: http://git.io/_mSf8A
18:32 GitHub1 [mojo/master] slightly better after_build_tx hook description - Sebastian Riedel
18:32 GitHub1 left #mojo
18:35 mire joined #mojo
18:37 SmokeMachine joined #mojo
18:38 sri hmm, maybe it's not such a good idea
18:43 elb0w_ joined #mojo
18:44 sri yea, too much magic for my taste
18:50 mire joined #mojo
18:51 GitHub196 joined #mojo
18:51 GitHub196 [mojo] kraih pushed 1 new commit to master: http://git.io/n-BvbQ
18:51 GitHub196 [mojo/master] removed support for after_build_tx hooks from Mojolicious::Plugin::Mount again - Sebastian Riedel
18:51 GitHub196 left #mojo
18:52 sri it can still be done manually
18:55 * tempire sprinkles magic glitter
19:01 preflex_ joined #mojo
19:13 * sri glitters
19:14 sri tempire: what do you think about the latest around_dispatch implementation?
19:15 tempire I haven't taken the time to understand it completely, so I can't comment on the matter.
19:15 sri :,(
19:15 * tempire hands sri a handkerchief
19:16 tempire I have mastered trigonometry, though, so you can take comfort in that.
19:16 sri *sniff*
19:16 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojolicious.pm#L179
19:16 sri https://github.com/kraih/mojo/blob/m​aster/lib/Mojolicious/Plugins.pm#L25
19:16 sri REVIEW IT!
19:17 mire joined #mojo
19:18 sri https://github.com/kraih/mojo/blob/master​/t/mojolicious/dispatcher_lite_app.t#L18
19:19 tempire is it the existence of around_dispatch you're wondering about?
19:20 tempire or just how it works
19:20 sri nope, it's just the implementation
19:20 gabriel joined #mojo
19:20 sri mostly if it should be FIFO or LIFO
19:20 sri right now it's FIFO
19:21 sri that's why the default dispatcher gets registered so late
19:21 tempire I would expect FIFO intuitively
19:21 sri LIFO would have the advantage that the dispatcher could be registered right from the start
19:21 sri hmm
19:22 sri another open question is $next->() vs $next->($c)
19:22 sri right now it's the first
19:22 tempire If I'm making a hook, I want my stuff to run before the dispatcher, if I understand correctly.
19:23 sri second would have the advantage of more control
19:23 sri you do
19:23 sri you would get that with both versions
19:23 sri LIFO is just easier to implement
19:24 sri less natural when you define hooks though
19:25 tempire then FIFO makes more sense; the priority should be dev ease of use over simple implementation.
19:26 sri what about the closure?
19:26 sri $next->() fine?
19:27 tempire hmm.  $next->($c) would allow for changing the request, I presume?
19:28 sri the controller instance
19:28 purl i guess the controller instance is created at the beginning of the dispatch, and then it is destroyed at the end of the dispatch?  .. i guess i could look at code to determine the lifecycle of the controller instance ..
19:28 tempire right
19:28 tempire I don't like that.
19:28 tempire I mean, it sounds flexible and cool
19:28 tempire but that sort of state change in some arbitrary hook sounds like the devil
19:29 * sri nods
19:29 tempire "where did that change happen!?"
19:29 tempire DAMNIT
19:30 tempire people that don't know will always go for the state change, so I support $next->()
19:31 sri good, any alternative idea for $next->()?
19:32 sri one suggestion was an object that only had a next method
19:32 sri (i didn't like it)
19:32 sri $foo->next;
19:32 tempire that's kind of pointless unless $foo does something else
19:32 sri :)
19:33 tempire um.
19:33 tempire I suppose you could inject ->next into $c-
19:33 elb0w_ joined #mojo
19:33 tempire that's what I would expect, actually.
19:33 sri the hook system is independent of $c
19:34 sri $c is just a random argument on that layer
19:34 sri after_build_tx gets $tx, $app as arguments for example
19:36 elb0w__ joined #mojo
19:36 sri i mean… it is possible… but the implementation is extremely ugly
19:36 tempire no, you're right, it's dumb
19:36 tempire what about making it like under…if it returns undefined, the hooks are stopped.
19:37 tempire undefined/false
19:37 sri hmm
19:37 sri wait
19:37 sri then you can't wrap the next call
19:38 sri one of my most common use cases is wrapping the dispatcher in a Coro
19:38 sri async { $next->() }
19:38 tempire well
19:39 tempire $next->() isn't all that common, but around_dispatch isn't going to be the most commonly used thing, right?
19:39 tempire given its sledgehammer status
19:39 tempire I don't see any better options at the moment.
19:39 sri very very uncommon
19:40 sri currently known uses only include coroutines and plack middleware hacks
19:40 tempire regarding the passing another object that has a method ->next...
19:41 tempire is there anything else that could *possibly* be in it, for convenience?
19:41 Foxcool joined #mojo
19:41 sri not that i could think of
19:41 tempire whatever.  it doesn't matter.  it's rare.  it's experimental.  if something comes up, it can be changed.
19:41 * tempire yay on $next->()
19:42 sri true
19:42 sri \o/
19:42 elb0w__ wrote tests today
19:42 elb0w__ first time
19:42 purl hmmm... first time is a misunderstanding, the second time is saying he doesn't want the job enough
19:42 elb0w__ pretty useful
19:42 tempire elb0w__++
19:42 elb0w__ found 3 bugs
19:42 elb0w__ :o
19:43 tempire even better when you go to change things, and you'll know for sure that it still works
19:43 tempire and the tests can operate as docs for when you forget implementation down the road
19:43 elb0w_ joined #mojo
19:43 tempire tests are like a superpower
19:43 * tempire soars through the air
19:44 elb0w_ :o
19:46 tempire elb0w_: have you used devel::cover?
19:46 elb0w_ never
19:46 tempire dude!
19:46 elb0w_ using test::simple atm
19:46 tempire now is the time
19:46 elb0w_ figured id start small
19:46 tempire here, just try this real quick
19:46 tempire are you using the prove command?
19:46 elb0w_ nope
19:46 elb0w_ just ok
19:47 tempire no, I mean how are you running your tests?
19:47 purl okay, tempire.
19:47 * tempire pats purl
19:47 * purl pats tempire back, harder
19:47 elb0w_ perl test.t
19:47 tempire use prove instead
19:47 tempire prove test.t
19:47 tempire prove -v test.t for full output
19:47 tempire if your terminal supports it, you might even see pretty colors
19:48 elb0w_ oo fance
19:48 tempire ok, that's step one.
19:48 tempire now install Devel::Cover
19:48 tempire go go go!
19:48 elb0w_ wait
19:48 elb0w_ I can't use prove
19:48 elb0w_ what package is that in
19:48 tempire default with perl
19:48 elb0w_ oh
19:48 * sri hides the coffee from tempire
19:48 elb0w_ its prove5.12
19:49 tempire http://www.youtube.com/watch?v=7mZZd4gQrrg
19:49 elb0w_ o wow vasquez made cartoons
19:50 elb0w_ wish here do a jthm one
19:51 elb0w_ ok have devel cover now what
19:51 tempire alias provec="HARNESS_PERL_SWITCHES=-MDevel::Cover prove5.12 -lrvc --timer --normalize --state=save"
19:51 elb0w_ what does alias do
19:52 tempire creates a command so you don't have to type that long string in
19:52 elb0w_ to what proved?
19:52 elb0w_ I should remember that
19:52 elb0w_ thats cool
19:52 tempire in this case, provec.
19:53 elb0w_ so what did that change?
19:53 tempire then run "provec test.t"
19:53 elb0w_ I did
19:53 elb0w_ didn't look too different
19:53 tempire then "cover -report html"
19:53 elb0w_ o
19:53 tempire then open cover_db/coverage.html
19:54 tempire pretty web page of all sorts of information.
19:54 tempire sort of pretty
19:54 tempire prettier than terminal, at least
19:55 elb0w_ this is cool
19:55 elb0w_ like a nytprof almost
19:56 tempire that's different
19:56 tempire this will tell you what your tests have covered
19:56 elb0w_ yeah I mean the html
19:57 tempire often, looking at the report will tell you huge areas you didn't even think to test
19:57 elb0w_ this is awesome
19:57 elb0w_ yeah
19:57 elb0w_ I see a whole sub
19:57 elb0w_ I didn't test
19:57 elb0w_ :o
19:57 tempire go forth, and be awesome
19:59 elb0w_ haha
19:59 elb0w_ ty
19:59 elb0w_ this is cool
20:07 ZadYree joined #mojo
20:07 ZadYree Hello here
20:45 elb0w_ tempire: if I have a module what is the easiest way to upload it to cpan, I manually replicated what mojo cpanify does
20:45 elb0w_ should i use something?
21:07 SmokeMachine joined #mojo
21:20 elb0w_ sri: you know you are in this slide show? http://www.slideshare.net/brian_​d_foy/create-and-upload-to-cpan
21:21 sri oh noes, they are watching me!
21:43 mire joined #mojo
22:12 osprey joined #mojo
22:16 MojoGuest496 joined #mojo
22:16 MojoGuest496 From: http://news.ycombinator.com/item?id=1277067 (129 hits)
22:17 MojoGuest40 joined #mojo
22:17 MojoGuest40 From: http://news.ycombinator.com/item?id=1277067 (130 hits)
22:17 mire joined #mojo
22:17 osprey hell, just update from 1.9 to current, and I found that Mojo::IOLoop->trigger are replaced to  "delay"
22:18 sri don't use experimental features if you're not prepared for change
22:18 osprey and when api will be stable&
22:19 osprey ok, how use parallel downloads?
22:20 sri synchronize manually, it's not fun but stable
22:20 osprey I'd like to not use, but I was copypasted from COOKBOOK code -_-
22:21 sri yea, don't do that, those are just examples for what's possible, you're still supposed to actually learn what's going on
22:22 osprey ok ok
22:28 MojoGuest757 joined #mojo
22:28 MojoGuest757 From: http://www.google.co.uk/url?sa=t&rct=j&q=h​tml5%20irc&source=web&cd=4&ved=0CDsQFj​AD&url=http%3A%2F%2Fdev.xantus.org%2F&ei=X​y3ITu31HpSAhQfl9cXaDw&usg=AFQjCNGw6nZv0wO42uzU​nHhWcD0vcKNULg&sig2=CrRUXrqsVLp972P1iw39-A (1 hits)
22:29 MojoGuest262 joined #mojo
22:29 MojoGuest262 From: http://www.google.co.uk/url?sa=t&rct=j&q=h​tml5%20irc&source=web&cd=4&ved=0CDsQFj​AD&url=http%3A%2F%2Fdev.xantus.org%2F&ei=X​y3ITu31HpSAhQfl9cXaDw&usg=AFQjCNGw6nZv0wO42uzU​nHhWcD0vcKNULg&sig2=CrRUXrqsVLp972P1iw39-A (2 hits)
22:29 kjeldahl` joined #mojo
22:35 ZadYree aha sri, I'm doing a hacking challenge based on a mojo+npSQL
22:36 ZadYree noSQL
22:36 ZadYree Pretty hard
22:46 marty ZadYree:  What DB are you using?
22:49 ZadYree MongoDB
22:49 ZadYree gotta find a way to inject JSON
22:50 marty MongoDB works pretty good with Mojolicous.   What do you mean by "inject JSON"
22:51 ZadYree It's a challenge
22:52 ZadYree Login fields are not filtered
23:10 tempire elb0w_: I use Dist::Zilla
23:23 jnap joined #mojo
23:46 sri just two callback attributes left in mojolicious now :)
23:46 sri and those can stay
23:47 sri (on_lock/on_unlock for the Mojo::IOLoop accept mutex)
23:48 sri or would they look better as ->lock/->unlock? :)
23:55 marty ->lock/->unlock looks better, imo
23:56 sri /o\
23:57 sri well, it's actually more like $loop->on_lock(sub {…}) and $loop->on_lock->(…)
23:57 sri vs $loop->lock(sub {…}) and $loop->lock->(...)

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