Camelia, the Perl 6 bug

IRC log for #mojo, 2013-08-28

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

All times shown according to UTC.

Time Nick Message
00:10 asarch joined #mojo
00:10 shmuel joined #mojo
00:10 preflex joined #mojo
00:11 yko joined #mojo
00:20 Moataz-E joined #mojo
00:41 jberger joined #mojo
00:59 good_news_everyone joined #mojo
00:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/UbIooQ
00:59 good_news_everyone mojo/master 9202173 Sebastian Riedel: more consistent flow control examples
00:59 good_news_everyone left #mojo
01:03 laouji joined #mojo
01:12 basic6 joined #mojo
01:15 jberger joined #mojo
01:32 laouji joined #mojo
01:42 chansen joined #mojo
01:47 phillipadsmith joined #mojo
02:04 d4rkie joined #mojo
02:10 egopro joined #mojo
02:13 zeep joined #mojo
02:15 zeep hi how's it goin?
02:16 zeep experiencing some mojo weirdness, what works: ./app.pl get -v /      and ./app.pl daemon
02:16 zeep what doesn't: morbo -v ./app.pl
02:16 zeep [debug] Template "index.html.ep" not found.
02:17 zeep [debug] Template "Main/index.html.ep" not found.
02:17 zeep any tips how i can iron this out?
02:54 dvinciguerra_ joined #mojo
02:56 KindOne joined #mojo
03:05 bzero joined #mojo
03:08 yko joined #mojo
03:15 preflex_ joined #mojo
03:18 russum joined #mojo
03:26 jberger_ joined #mojo
03:27 l3l1p joined #mojo
03:28 bzero joined #mojo
03:31 russum left #mojo
04:02 russum joined #mojo
04:35 dqw joined #mojo
04:48 hummeleBop joined #mojo
04:58 d4rkie joined #mojo
05:56 marcus heh
06:18 marcus sri: awesome!
06:59 batman sri: holy crap! you actually added it :S
06:59 * batman would tell *someone* to make a plugin first to see if it's actually useful
07:00 batman but that's just me :)
07:05 dpetrov_ joined #mojo
07:22 mire joined #mojo
07:27 Vandal joined #mojo
07:30 marcus batman: of course it is useful!
07:30 dod joined #mojo
07:30 batman i see that its useful, but i'm curious for *how many*
07:37 ladnaV joined #mojo
07:46 basiliscos joined #mojo
07:48 dotan joined #mojo
07:56 denis_boyun joined #mojo
07:57 bobkare joined #mojo
07:57 Vandal joined #mojo
08:10 sh4 joined #mojo
08:12 denis_boyun__ joined #mojo
08:18 arpadszasz joined #mojo
08:20 bd ah man, vim does some rename, delete magic on save, now wonder the inotify() fails ...
08:39 Vandal joined #mojo
08:40 Vandal joined #mojo
08:46 ladnaV joined #mojo
08:55 alnewkirk joined #mojo
09:02 yakudza joined #mojo
09:09 basiliscos joined #mojo
09:28 mib_d5ysul joined #mojo
09:29 mib_d5ysul left #mojo
09:38 arthas joined #mojo
09:40 rem_lex| joined #mojo
09:56 jast bd: in case you haven't seen already, vim's save behaviour is configurable
10:08 denis_boyun joined #mojo
10:30 dqw joined #mojo
10:31 mcsvenster joined #mojo
10:32 mcsvenster Good Day everybody
10:34 mcsvenster Can anybody help me with a mojolicious installation on a mac? I get an error message when I try to execute mojo:
10:34 mcsvenster Can't locate object method "start" via package "Mojolicious::Commands" at /usr/local/bin/mojo line 10.
11:07 bowtie_ joined #mojo
11:16 sri batman: it required a routing core rewrite, couldn't have been a plugin
11:17 Vandal joined #mojo
11:31 rem_lex|pivo joined #mojo
11:37 ladnaV joined #mojo
11:56 Vandal joined #mojo
12:14 dqw2 joined #mojo
12:27 dvinciguerra joined #mojo
12:35 jberger joined #mojo
12:44 good_news_everyone joined #mojo
12:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/V_rwzw
12:44 good_news_everyone mojo/master b790099 Sebastian Riedel: no need to copy the stack
12:44 good_news_everyone left #mojo
12:45 sri that little change allows changes to $c->match->stack... not sure yet if i'm going to make that a feature at some point :)
12:46 sri like $c->match->stack->[-1]->{action} = 'bar' if $c->match->stack->[-1]->{action} eq 'foo';
12:48 sri can be dangerous though, since it also changes the cached version of the stack
13:01 sri oh wait, that was possible before too ;p
13:06 perl2012 joined #mojo
13:07 arthas joined #mojo
13:26 bluescreen joined #mojo
13:32 russum joined #mojo
13:32 russum left #mojo
13:34 gryphon joined #mojo
13:35 basiliscos joined #mojo
13:39 good_news_everyone joined #mojo
13:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/463Hpg
13:39 good_news_everyone mojo/master 1027e3b Sebastian Riedel: copy the stack again
13:39 good_news_everyone left #mojo
13:39 sri too dangerous
13:41 btyler joined #mojo
14:10 shmuel joined #mojo
14:13 nicomen how would I do an internal redirect from /foo/public/static/file.css to /public/static/file.css ?
14:14 batman nicomen: you would rewrite the request in a before_dispatch hook
14:14 batman but i don't think that's what you're asking about
14:15 nicomen hm, that might work
14:15 batman i think you want https://metacpan.org/module/Mo​jolicious::Plugin::RequestBase
14:16 nicomen hm not sure
14:16 batman do you have a reverse proxy?
14:17 nicomen I actually want to serve my public directory under a directory instead of straight from the root
14:17 batman why on earth do you want that? :(
14:18 nicomen because I have an existing mojo app that I'm building on, but I want some parts to be self-contained running alongside, at least for now
14:18 batman the easiest way would be mkdir /public/foo mv /public/* /public/foo;
14:18 nicomen would still need the GET /public/foo/*
14:18 nicomen I want /existing_app/public/foo/*
14:18 batman you never get /public/
14:18 batman at least not in mojo....
14:19 nicomen hm, the request seems to be doing that
14:19 nicomen I mean everything links to /public/static...
14:19 batman that's super weird. myapp-root/public/foo.css is accessible by doing GET /foo.css
14:20 nicomen hm
14:20 batman no idea where you got "static" from :/
14:20 nicomen sorry you are right
14:20 batman someone or something need to mess with the defaults
14:20 batman s/need to/.../
14:20 nicomen but I basically want an incoming request: /existing_app/static/foo.css to be served $static_dir/foo.css
14:20 batman use my Toadfarm server
14:22 batman https://metacpan.org/module/Toadfarm
14:23 batman or sorry... don't do it. i think you need to rethink your problem
14:23 batman i don't think you're solving it right
14:26 denis_boyun joined #mojo
14:45 sh4 joined #mojo
14:57 Moataz-E joined #mojo
15:00 sri i guess support for non-blocking operations in bridges has the necessary votes
15:01 sri reviews would be appreciated, especially regarding limitations of the actual api
15:01 sri https://github.com/kraih/mojo/compare/841​88c0a83c1c524e0722156083326ec09c47428...6​58c6cb3f956cecac76484d8b20ac4e2e516f4ed
15:06 dvinciguerra joined #mojo
15:15 btyler joined #mojo
15:23 sri i suppose a slightly different api would work too
15:25 sri http://pastie.org/8277387 # something like that
15:26 mire joined #mojo
15:26 sri would have to go back to the stack index based solution i played with earlier, and add $c->match->current(2), $c->match->next and ->routes->next($c)
15:28 sri http://pastie.org/8277399 # this would also work
15:43 ladnaV joined #mojo
15:51 batman sri: you can also just do return $next; right?
15:52 batman no need for the ref. if so - i really like http://pastie.org/8277387
15:52 batman a lot better than the my $next; ... return \$next;
15:55 Dandre left #mojo
15:55 Dandre joined #mojo
15:56 batman reason why i like 8277387: impossible to accidentally return bullshit which makes the chain stop. and it's obvious where $next come from
15:58 batman not very obvious why you need to return $next, but that's just something to get used to...
15:59 batman sri: in general: i think http://pastie.org/8277387 is a lot cleaner (without the extra ref;))
15:59 * batman is out of here. back in an hour...
16:00 Vandal joined #mojo
16:01 dqw joined #mojo
16:17 lammel2 joined #mojo
16:17 arpadszasz joined #mojo
16:24 tempire $self->match->next is interesting.
16:24 tempire \0 ?
16:24 tempire Hope that wouldn't be required.
16:27 dqw joined #mojo
16:38 D4RK-PH0ENiX joined #mojo
16:39 batman sri: what about already understanding that you have called >next when you do it?
16:40 batman like sub next { $self->{async} = unshift @{ $self->{next} } }
16:40 batman ^ not that, but something alike
16:41 batman ^ that code sucks. please ignore it ;D
16:51 KindOne joined #mojo
16:54 bowtie joined #mojo
17:01 punter joined #mojo
17:02 bowtie_ joined #mojo
17:22 punter joined #mojo
17:24 basiliscos joined #mojo
18:07 zackiv31 joined #mojo
18:14 dpetrov_ joined #mojo
18:26 btyler_ joined #mojo
18:31 btyler joined #mojo
18:34 d4rkie joined #mojo
18:34 sri batman: yea, that's terrible
18:35 batman atleast a good thing that i know myself, imho
18:35 sri problem with ->match->next is that it requires some new apis that could get used very very wrong
18:35 batman isn't that up to us (the users) ?
18:35 sri just returning $next would be very hard, it's a dynamically generated coderef, you don't get the same again
18:36 batman as in marking the doc with something like EXPERIMENTAL...
18:36 batman "parental advisory" ? ;)
18:36 sri ->next would return a different coderef every time
18:37 batman why?
18:37 sri otherwise we would need some kind of state
18:37 sri how do we identify that one specific coderef?
18:38 batman oh. right... i'm always forgetting it's not ->next($c); :(
18:38 batman not that it would matter in this case...
18:38 sri actually, you've got a point
18:38 sri ->match->next doesn't work
18:39 sri we need $c
18:39 batman i would do it the easy way and add a method to M::Controller :)
18:39 sri and back to the drawingboard!
18:39 sri i don't think we can do that
18:39 batman why not?
18:39 batman i was thinking about something like render_later()
18:40 sri hmm, seems a bit ugly
18:40 sri and i can't think of a name
18:40 sri $c->suspend?
18:40 batman neither can i :( was trying yesterday, but naming makes my head hurt :)
18:41 batman i don't like suspend()
18:41 batman but i'm thinking whatever it would be, it could replace render_later()...
18:42 batman though i don't think you want to :)
18:48 denis_boyun joined #mojo
18:58 sri i don't see how it would replace render_later, you may still just want to disable auto rendering without suspending a bridge
19:00 sri in fact, not being able to disable render_later from a bridge without suspending it would be real backcompat breakage
19:02 sri new controller method or helper seems like the only option
19:03 sri tempire: some arbitrary way to tell the dispatcher that we are suspending
19:04 sri we need a) a bridge return value that signals a suspend and b) a controller method that returns a closure or resumes directly
19:06 sri a) can be \0 or \1 or whatever
19:06 sri b) would need a good name
19:07 sri http://pastie.org/8277932 # this is very possible
19:09 sri helper suspend => sub { my $c = shift; $c->app->routes->suspend($c) };
19:09 sri keeping state is a little annoying though
19:10 sri would have to store the closure in $c without leaking
19:10 sri tempire: if you have somehting to say about the current design, *now* is the time to speak up
19:17 Gedge joined #mojo
19:22 lammel2 joined #mojo
19:25 punter joined #mojo
19:32 some_dood joined #mojo
19:39 some_dood joined #mojo
19:41 some_dood left #mojo
19:53 some_dood joined #mojo
19:53 some_dood part #catalyst
20:08 asarch joined #mojo
20:11 batman joined #mojo
20:11 marcus joined #mojo
20:12 wsri joined #mojo
20:19 some_dood_ joined #mojo
20:23 batman joined #mojo
20:23 marcus joined #mojo
20:24 wsri joined #mojo
20:39 denis_boyun joined #mojo
20:45 denisboyun joined #mojo
20:50 lammel2 left #mojo
21:00 batman joined #mojo
21:00 marcus joined #mojo
21:01 wsri joined #mojo
21:10 sri http://pastie.org/8278259 # unless there's some feedback soonish i'm just going to release a super primitive version of suspendable bridges ;p
21:11 sri $next->() becomes $self->app->routes->continue($self);
21:11 sri and return \$next becomes return \0
21:16 sri interesting side effect of having $app->routes->continue($c) is that you could make up your own stack and skip the router
21:26 tempire what happened to return $next?
21:27 sri what is $next?
21:28 sri anyway... here's what u have now http://pastie.org/8278303
21:28 tempire the original paste had a "return $next" instead of "return \$next" for the example.
21:28 sri i never did that
21:28 tempire which I thought might be magic.
21:28 tempire MAGIC
21:28 sri which original paste?
21:28 tempire http://pastie.org/8277932
21:29 sri http://pastie.org/8278305 # my current patch
21:29 tempire although, just a $self->continue is nice.
21:29 batman sri: i like it, except of the return value
21:29 sri batman: then give me a better return value
21:29 batman $self->app->routes->delay; ?
21:29 batman oops
21:30 sri the whole ->continue mechanic is pretty nice
21:30 sri batman: wtf is ->routes->delay?
21:30 batman $self->app->routes->delay($self); ?
21:30 tempire can we wrap that in a sub? "return $self->wait"
21:30 batman sri: it's nothing yet. i'm just throwing out ideas.
21:30 sri i don't follow, please be more specific
21:30 sri we are past syntax, i want stuff that can actually work :)
21:31 tempire instead of "return \1", "return $self->wait", where wait is a sub that returns \1
21:31 batman it would be so much easier if i could fork your paste on github...
21:31 sri what the bridge returns is completely arbitrary, it has no magic and doesn't need to do anything
21:31 sri it's just a signal
21:31 sri some shitty constant would do
21:32 sri tempire: and how is that better?
21:32 sri \1 is much much much less typing than \1
21:32 sri umm
21:32 sri $self->wait
21:32 tempire prettier. more obvious to a reader.
21:32 sri not to mention a special controller method that does absolutely nothing
21:33 sri "This method returns C<\1>."
21:33 sri seriously!?
21:33 tempire I'm surprised you're considering a "return \1" for mass consumption.
21:33 sri tempire: it's a perfectly fine perl value
21:34 sri tempire: in fact i use it for boolean true all the time
21:34 batman http://pastie.org/8278311
21:34 sri i'm sure you remember that it's a Mojo::JSON and Mango::BSON feature
21:34 batman anyway... i'm so tired :(
21:34 batman need to get some sleep
21:35 sri batman: what does ->delay to?
21:35 sri *do
21:35 batman it signals to the current match object that it should be delayed
21:35 batman and then the continue() sub need to check that before considering what to do
21:35 sri magically?
21:36 sri we need to signal to the *dispatcher* that we are suspending
21:36 batman yes, in my paste it's magic since i don't have the capacity to finish it tonight :(
21:36 sri meh
21:40 sri i guess it's time for me to dictate again :S
21:59 sri http://pastie.org/8278366 # i really don't see the appeal of this much more verbose version
21:59 tempire me neither.
21:59 tempire I like ->continue
21:59 tempire even with the return \1
22:00 sri if you really really want to.... helper wait => sub {\1};
22:00 tempire indeed
22:07 sri i really don't get what you have against \1 though
22:08 sri even if you put common return values for bridges in line they look ok... undef, 1, \1
22:14 tempire it's scary to a beginner
22:14 sri haha, it should be!
22:17 good_news_everyone joined #mojo
22:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/tSbBoA
22:17 good_news_everyone mojo/master 74cffe4 Sebastian Riedel: redesigned support for non-blocking operations in bridges
22:17 good_news_everyone left #mojo
22:18 sri now you can at least test it
22:19 sri a friendly description for Mojolicious::Controller::continue might also be nice
22:22 sri http://pastie.org/8278424 # here's another possibility... ->suspend would set ->stash->{mojo.suspend} = 1, for the dispatcher to pick up
22:22 sri then we would have different ways to signal what a bridge wants though
22:24 sri i suppose we could say the return value doesn't matter because the bridge has been suspended
22:26 tempire hmm
22:28 sri of course there are scoping issues... if you call ->suspend in a hook... things will go very wrong
22:29 sri at a distance
22:30 * sri actually dislikes adding any methods to Mojolicious::Controller
22:33 good_news_everyone joined #mojo
22:33 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/-zXBPA
22:33 good_news_everyone mojo/master a93e36d Sebastian Riedel: slightly better description for continue method
22:33 good_news_everyone left #mojo
22:43 sri tempire: oh, i know! hoe about inf?!!! return 9**9**9;
22:43 tempire 9**9**9+1
22:52 russum joined #mojo
22:53 russum left #mojo
23:12 * tempire really likes monkey_patch
23:12 sri ohoh
23:14 jberger_ joined #mojo
23:43 zeep joined #mojo
23:44 sri maybe jberger has an idea
23:45 sri jberger_: how do we signal to the dispatcher that we suspend the bridge?
23:46 jberger_ Has it really come to asking me? I liked one of the old pastes, let me find it
23:51 jberger_ Hmmmm reading it I see why you are having the problem
23:52 jberger_ Is there any way you can expose the dispatcher object?
23:53 jberger_ That way you can add methods which would be expressive without adding to the controller's interface
23:54 lammel2 joined #mojo
23:54 * jberger_ looks
23:55 lammel2 left #mojo
23:55 sri $c->app->routes
23:55 zeep joined #mojo
23:56 sri $c->continue is equivalent to $c->app->routes->continue($c)
23:57 sri i was just thinking that maybe we could make it so a bridge that returns false can be resumed with $c->continue
23:58 jberger_ I liked this: http://pastie.org/8277932
23:58 * sri might actually have found a little bug
23:59 sri jberger_: oh my
23:59 jberger_ But I didn't like adding the controller method

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