|
2009 -- the year of November. <november-wiki.org> <github.com/viklund/november> <irclog.perlgeek.de/november-wiki> <nopaste.snit.ch> Set by moderator on 10 February 2009. |
|||
|
00:45
ihrd1 joined
03:27
Tene_ joined
07:29
ihrd1 left
08:27
masak joined
12:17
ihrd joined
|
|||
| ihrd | hi there | 12:34 | |
| masak, I see you messages in the log | 12:51 | ||
| masak | hello. | ||
| ihrd | dispatcher fully in master, so we can remove this branch | 12:52 | |
| asteriks was blocken, but now I fell I can make it works, I will do that | 12:53 | ||
| masak | cool. | ||
| I'll remove the dispatcher branch. | 12:54 | ||
| ihrd++ | |||
| ihrd | ah, plz, use ++ when I done something :) | ||
| masak | you answered my question :) | ||
| ihrd | I still ill and that makes my sad :( | ||
| masak | also, you implemented dispatch in November. | ||
| ihrd: I wish you good health. get lots of rest and liquid. | 12:55 | ||
| ihrd | but I skid with new shine Web::Dispatcher | ||
| I cant first, but I do second :) | 12:56 | ||
| what you thinking about my tiny example, Forest? | 12:57 | ||
| masak can't parse 'skid with new shine' | |||
| sounds great, though :) | 12:58 | ||
| ihrd: I haven't had time to look closely at Forest, but I'll be glad to. | |||
| I really like the name. | |||
| I'll look at it this evening, when I'm not at $WORK. | |||
| ihrd | I mean skid like car do | 12:59 | |
| masak | ok, I get it now. | ||
| ihrd | or slip | ||
| masak | 'slip' in projects means 'postpone'. | ||
| ihrd | I just found thet words in dic | ||
| masak | :) | 13:00 | |
| ihrd | in russian we use phrase like this | ||
| to sign situation when someone go forward slow and with trouble | 13:01 | ||
| masak | so, just to make clear, 'skid with new shiny Web::Dispatcher' means 'make slow progress with the new shiny Web::Dispatcher'? | 13:02 | |
| if so, I'm still looking forward to it when it arrives. :) | 13:04 | ||
| working code doesn't even have to involve a full stack... but you know that, so no need to say it. :) | 13:05 | ||
| ihrd | Tene_, how are you? | 13:07 | |
| masak: I hope fix my body, and make progress on this weekend | 13:08 | ||
| masak | ihrd: I'm hoping for progress here too, tonight and in the weekend. | 13:09 | |
| currently porting Rack's Util, Request, Response | |||
| ihrd | masak++ | ||
| masak | discovering things missing in Rakudo that we need. | 13:10 | |
| specifically, turning a string into its UTF-8 bytes. | |||
| Parrot should be able, but the Parrot devs seem slightly befuddled as to why I would want to do this. | 13:11 | ||
| ihrd | my Template. blocked by rakudobug again | ||
| masak | aye, saw that. | 13:12 | |
| no workaround available? | |||
| ihrd | Jonathan :) | ||
| masak | sure, but short-term. | ||
| ihrd | he said this one simple to fix, and he do thest | ||
| masak | oki. | 13:13 | |
| ihrd | thet in next few days | ||
| can you put our propousal pod to the root of web repo? | |||
| masak | sure, good idea. | 13:14 | |
| masak does that | |||
| ihrd | and I think we should make list of related repos in README | ||
| Maya, November, URI | |||
| masak | definitely. | ||
| and also describe the contents of doc/ in the README | 13:15 | ||
| ihrd | and links to blogs where we mark progress | ||
| masak | yes, links to all blog entries about this. | ||
| ihrd | I will do my first post on this weekend | ||
| masak | goodie. | 13:17 | |
| I don't think it's bad that we're slightly out of phase. | |||
| I might take a week's vacation later instead and let you catch up :) | |||
| ihrd | yes I will wright to TPF about my ailment | 13:20 | |
| masak | sure. | 13:21 | |
| ihrd | I do not recived any emails from Adrian from the 5 March | 13:44 | |
| masak | same here. | 13:46 | |
| 2009-03-05 was the last time he wrote to me. | |||
| ruoso | ihrd, please consider putting the Request::Method in the end of the arguments | 13:55 | |
| since the verb is most relevant to the last part of the uri | |||
| not to the first | |||
| and I also suggest adding a marking for the start of the uri | 13:56 | ||
| additionally, I'd consider having all the multi installed in a single variable | 13:58 | ||
| my &a = Multi.new | |||
| &a.push($candidate); | 13:59 | ||
| &a.(args...) | |||
| ihrd, that already works in rakudo.... | 14:00 | ||
| ihrd | hi Daniel :) | ||
| ruoso | hi ihrd | ||
| moritz_ | wow, ten non-bots in here. It's getting crowded :-) | 14:01 | |
| ihrd | what benefits of this? | ||
| masak enjoys #november-wiki being crowded | |||
| bots are welcome too. | |||
| ruoso | ihrd, one thing that was making me unconfortable was how the candidates would be installed in the namespace | 14:02 | |
| putting it into a variable makes it cleaner | |||
| so the actions can be registered in the &dispatcher multi | 14:03 | ||
| so I asked jhntn about it, and he implemented Multi.new in rakudo | |||
| to the second point... | |||
| having the request method in the end of the arguments, make the verb close to the last part of the uri | 14:04 | ||
| which means that the uri identifies which resource and the last argument identifies which verb | 14:05 | ||
| this is mostly important to later support calling reduce with that multi | |||
| ihrd | if I have class with methods how I can put it in this variable? | 14:06 | |
| ruoso | ihrd, you can always declare the method as my or our | ||
| and use it as &foo | |||
| ihrd | I mean I like to have normal class with methods | 14:07 | |
| ruoso | I see... but why do you want that? | ||
| action dispatch is completely non-oo | |||
| ihrd | because this make app maintable | ||
| if you have standrad API for resources you can use roles | 14:08 | ||
| ruoso | by resources you mean what catalyst calls "action", right? | ||
| ihrd | with tou resouces | ||
| no, I mean controller | 14:09 | ||
| ruoso | the thing is that a "controller" is not a "resource" | ||
| it is simply a "package" of "actions | |||
| ihrd | yes, this is not fully the same | 14:10 | |
| ruoso | I mean, it's completely different | ||
| ihrd | this is about app organization | ||
| ruoso | right... | ||
| ruoso brb & | |||
| ihrd | I think we can put all resource methods in one calss | 14:11 | |
| ruoso | ihrd, but that is not really sane in OO terms, is it? | ||
| ihrd | in this case you can resource as object | ||
| ruoso | right... | ||
| that's my point | 14:12 | ||
| each "resource" is an object | |||
| ihrd | and resource has methods -- GET, POST, PUT, DELETE | ||
| other methods is... like private actions | |||
| ruoso | maybe... although I would leave that as an argument... and just call "execute' | ||
| because you can then have also "begin" and "end | 14:13 | ||
| which are part of the processing | |||
| masak | as long as you adhere to Rack's interface here, I'm happy. | ||
| and that will probably be easy. | |||
| ruoso | rack seems to be way before that | 14:14 | |
| masak | right. | ||
| it's quite low-level. | |||
| but also very reasonable. | |||
| ihrd | before and us agreematn to interact | ||
| s/us/as/ | 14:15 | ||
| masak | aye. | ||
| ruoso | you just need to build the "arguments" from the request... then call the dispatcher | ||
| ok, let me put my perspective | |||
| I'd expect the multi dispatcher to work as a "reducer" | |||
| which means that it would return the "resource"/"action" object that is going to handle this request | 14:16 | ||
| so you can call .begin, .execute, .end | |||
| so, the dispatcher would look like | 14:17 | ||
| my @parts = $*app.request_split($*request); | |||
| my $action = @parts.reduce: &dispatcher; | |||
| masak | ruoso: is there somewhere I can read about this .reduce thingy? | 14:18 | |
| I feel I don't know anything about it. | |||
| ruoso | my $error is context<rw>; try { $action.begin; $action.execute; CATCH { $error = $_; $_.handled = 1 }}; $action.end; | ||
| masak, that's the standard list reduce | |||
| ihrd | this is one of the basics of functionsl programming | ||
| moritz_ | the standard .reduce doesn't work with multi methods, does it? | 14:19 | |
| ruoso | moritz_, it is supposed to work... | ||
| masak | ruoso: oh! that's ingenious, really. | ||
| ruoso | moritz_, we still didn't really figure out how it will do it, tho | 14:20 | |
| masak | I just hadn't made the connection. I know the op form well. | ||
| ruoso | moritz_, I proposed a way of doing it, which was to define a named argument to be sent to .postcircumfix:<( )> | ||
| moritz_ | ruoso: yes, I know | 14:21 | |
| ruoso | masak, so you see what I mean now? | ||
| masak | ruoso: oh yes. | ||
| moritz_ | ruoso: and it bothers me a lot do base the dispatch on something that's neither specced nor implemented yet | ||
| ruoso | that's why it's important to have a marker for the start and for the end of the args | ||
| moritz_, it can work without the reduce, for start... | 14:22 | ||
| it's not as cool... | |||
| but it still works | |||
| masak | let's start by building something that works. | ||
| then we can refine it. | |||
| we're not getting a grant for building air castles. :) | |||
| ruoso: I definitely like the idea, though. | 14:23 | ||
| ruoso | masak, I'm just trying to point it to that direction | ||
| masak | aye, of course. | ||
| moritz_ | first build a very simple MMD based dispatcher, like I proposed | ||
| then it's a piece of cake to plug in other dispatchers | |||
| ruoso | which is why i say to put two special args | ||
| one on the start | 14:24 | ||
| moritz_ | and the default dispatcher can be changed later on | ||
| ruoso | and other in the end | ||
| it wont hurt now | |||
| and enables reduce-based dispatch later | |||
| putting the req method in the end, for that same reason | 14:26 | ||
| masak, do you see what I mean? | 14:27 | ||
| masak | sure. | ||
| but it's not me you have to convince, it's ihrd. | 14:28 | ||
| he's the one writing the dispatcher. | |||
| ruoso | ihrd, do you see what I mean? ;) | ||
| ihrd | not fully :( | ||
| Ok, use reduce looks like elegant way. | 14:29 | ||
| and you just want agreement | |||
| about chunks | |||
| but I still do not see how you see full app | 14:30 | ||
| I like idea to make resources useful as objects | |||
| I feel we can use OOP here | |||
| ruoso | specially compose roles into a specific resource | 14:31 | |
| ihrd | we can make resource inheritance, too | ||
| If I understand right you see action like free pices of code | 14:34 | ||
| but I thinking about structure for app | 14:35 | ||
| mb this is not so perlish | 14:36 | ||
| but when I work with real life project I like to have strict structure for web apps | 14:37 | ||
| do you understand what I mean? | 14:39 | ||
| (I need dic to understand you, but you have no dic from russianenglish mess to understand my) | 14:40 | ||
| ruoso | role Resource { multi method begin {...}; multi method execute {...}; multi method end {...} } | 14:41 | |
| ihrd, for start, I see some code overhead in order to register the resources... | 14:42 | ||
| but that can later be fixed by a sub-language.... | |||
| controller Fooo { resource bar { } } | |||
| ihrd, the dispatcher is then responsible for finding the appropriate resource to that request | 14:44 | ||
| in order to do that, it first generates the arglist from the request | |||
| my @parts = my_splitter($*request); | 14:45 | ||
| after having the parts, it can invoke the multi | |||
| my $action = &resource_finder(|@parts) | |||
| when we have reduce-with-multi working, we can replace that by | 14:46 | ||
| my $action = @parts.reduce: &resource_finder; | |||
| ihrd | uhu | ||
| ruoso | then you can perform the action... | 14:47 | |
| my $error is context<rw>; try { $action.begin; $action.execute; CATCH { $error = $_; $_.handled = 1 }}; $action.end; | |||
| actually $action.*begin, $action.*execute, $action.*end | 14:48 | ||
| so composed roles can have its own execute called | |||
| ihrd | yes | 14:51 | |
| ruoso | ihrd, basically it's the same as the sketch I wrote | 14:52 | |
| but replacing the regex-based stuff | |||
| ihrd | yes, I see | ||
| ruoso | for a multi-based stuff | ||
| ihrd | I read you what you wrote carefull, and execute it in my head | 14:53 | |
| masak | moritz_: what's underspecced re multis and .reduce? | ||
| ruoso | masak, it isn't yet... | 14:54 | |
| masak | it isn't underspecced yet? | ||
| ruoso | but the general expectation is that it should be able to reduce calling a multi with varying-arity | ||
| moritz_ | masak: there's no mention of what it does with multis | ||
| ruoso | the most logical way of doing it is begin trying with the higher arity... | 14:56 | |
| and if that fail try with lower.... | |||
| masak | ruoso: ok. that sounds vaguely like LTM to me. | ||
| ruoso | yes... | 14:57 | |
| moritz_ | ruoso: why it is the most logical way? | ||
| masak | moritz_: because it gives the long-paramlist ones a change before the short-paramlist ones match. | ||
| ruoso | I don't really know... maybe I'm just contamined by LTM in regexes | ||
| masak | this sounds like a question for p6l. | 14:58 | |
| moritz_ | the most intuitive way for me would be to do a multi dispatch that allows left over items, and pick the narrowest match | ||
| masak | moritz_: 'left over items'? | 14:59 | |
| masak is so glad purl isn't here | |||
| moritz_ | masak: do a dispatch with an argument list, but not all arguments have to be used for the dispatch | ||
| so some trailing items can be neglected | |||
| masak | ah, as in ;; ? | ||
| moritz_ | jnthn will kill me | ||
| masak | :P | 15:00 | |
| moritz_ | masak: kinda like. But ;; is in the parameter list, not in the argument list | ||
| masak | oh, ah. | ||
| moritz_ | and I don't know before where to place the ;; | ||
| masak | right. | ||
| ruoso | ihrd, do you see why we need two marker arguments in the start and in the end of the @parts? while the request method is in the end... | ||
| masak | but please let's try to design something that doesn't require changes in the Perl 6 Spec. :) | 15:01 | |
| ruoso | moritz_, but even with LTM, it needs to support "left overs" | ||
| moritz_ | ruoso: aye | ||
| anyway, I think this is too much effort for a rather small problem set | |||
| ihrd | ruoso: to see start and end of the chain? | ||
| ruoso | ihrd, yes | 15:03 | |
| ihrd | but I still in confusing. You have array ofactions | 15:04 | |
| actions is multies | |||
| ruoso | I don't have an array of actions | ||
| I have an array of uri parts | |||
| that is reduced, by a multi, to an action object | 15:05 | ||
| ihrd | ah, yes. this multies just return an action object | 15:07 | |
| ruoso | at first, you will be required to have all the uri parts as args of your multi... | 15:09 | |
| but when .reduce works with reduce | |||
| with multi | |||
| you can have the action you're chaining as the first argument, and only the arguments of your own action | |||
| like | |||
| &multi.push sub (RootMarker, 'foo', $bar) { return Action::Chained('/foo/*') }; | 15:10 | ||
| &multi.push sub (Action::Chained('/foo/*'), 'baz', $bla) { return Action::Chained('/foo/*/baz/*') }; | 15:11 | ||
| &multi.push sub (Action::Chained('/foo/*/baz/*'), Request::Method::GET) { return Action::Public('GET /foo/*/baz/*') }; | 15:12 | ||
| my $action = (RootMarker, 'foo', 123, 'baz', 456, Request::Method::GET).reduce: &multi; | 15:13 | ||
| ihrd | in my Ctalyst apps I use Chained to do security checks and get some data | 15:19 | |
| for example /company/1/offers | |||
| ruoso | ihrd, I *only* use Chained actions | ||
| ihrd | chained get comapny, and check can I see offers | 15:20 | |
| in me 'Forest' sketch I am trying to make | |||
| multies work with this | |||
| I do not need stash to put geted stuff in it | 15:21 | ||
| I can just use it in the call to the multies | |||
| ruoso | the stash | ||
| ? | |||
| ihrd | $c->stash->{company} | 15:22 | |
| ruoso | $c is no longer needed | ||
| we have context variables | |||
| $*request in place of $c->req | |||
| ihrd | I am speaking about how that done in Catalyst. I just do not see how you actions share data. | 15:23 | |
| ruoso | by using context variables | ||
| ihrd | context variables just variables you can get by CALLER::$foo or you mean something different? | 15:25 | |
| ruoso | not CALLER::$foo, simply $*foo | 15:26 | |
| it's not just the CALLER scope | |||
| it's the whole dynamic scope | |||
| ihrd | ok | 15:29 | |
| I do not see what changed | 15:31 | ||
| I mean you still put you stuff in var | |||
| ruoso | right... that's what variables are for | 15:32 | |
| ihrd | and I am speaking about how I drafted chained | 15:33 | |
| in my draft you can just return from Link args for the next call | 15:36 | ||
| ruoso | ihrd, what you designed looks like forward, not chained | ||
| ihrd | hm | 15:37 | |
| you can use $rest to change way in that sketch, yes | 15:38 | ||
| but idea is to use multies again. you can have multi Link (...) {...} and same resource can work different as specific part of the chain | 15:40 | ||
|
15:40
sri_kraih_ joined
|
|||
| ruoso | ihrd, it still looks like forward... which is the opposite of chain | 15:42 | |
| ihrd | I do not see. why? | 15:43 | |
| ruoso | because in chained actions, this action assumes the other was already executed | 15:44 | |
| you don't have to think about it | 15:45 | ||
| ihrd | can you show real-life example? | 15:46 | |
| ruoso | the docs in Catalyst::DispatchType::Chained explains it | 15:47 | |
| ruoso later & | 15:48 | ||
| ihrd | re-read this pod and still do not understand what I missed. Yes, actions in the chain assumes prev Chained actions executed before. This is right for my model too. | 15:55 | |
| deep night, I am going to sleep. See you! | 16:08 | ||
|
16:10
ihrd left
17:02
ruoso left,
ruoso joined
|
|||
| sri_kraih_ | hmm, sounds like you are porting catalyst | 18:50 | |
|
19:00
Tene joined
|
|||
| ruoso | sri_kraih_, at least I'm pushing a lot in that direction | 19:03 | |
| sri_kraih_ | will be interesting to see how far you can get with the rack port | 19:36 | |
| i'd like to get Mojo running on rakudo as soon as possible | 19:38 | ||
| not such a big rack fan personally, too much constraints, but it's a good first candidate for porting | 19:44 | ||
| Tene | okay, working on tags tonight. | 21:54 | |
| going home in an hour or two, gonna start then. | |||