Camelia, the Perl 6 bug

IRC log for #november-wiki, 2009-05-12

| Channels | #november-wiki index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
04:17 zarah joined #november-wiki
04:17 ascent_ joined #november-wiki
08:32 masak joined #november-wiki
13:00 ruoso joined #november-wiki
13:29 Matt-W left #november-wiki
16:02 ruoso joined #november-wiki
18:06 masak joined #november-wiki
18:12 viklund joined #november-wiki
18:12 masak viklund: hackathon! \o/
18:13 viklund masak: yahoo    |
18:14 masak viklund: good try :P
18:19 ruoso masak, hi
18:19 masak ruoso: hello.
18:19 masak hackathon here tonight.
18:20 ruoso cool
18:20 masak we might do some porting of November to Web.pm, or some Hitomi implementation work.
18:20 masak haven't decided yet.
18:20 ruoso I was hoping pmichaud finish contextual vars, so I could rewrite your blog attempt using Faz
18:20 masak ruoso: looking forward to it.
18:21 ruoso but I probably need to write a compiler for the
18:21 ruoso controller Foo { action bar { ... } }
18:21 ruoso syntax
18:21 ruoso since rakudo doesn't support custom package_declarator and routine_declarator yet
18:28 masak seems we're going for the Hitomi prototype.
18:35 ruoso masak, in case you missed it.... I was able to work-around the lack of contextual variables
18:35 masak nice.
18:35 masak anything runnable?
18:37 ruoso yes
18:37 ruoso masak, I had pushed the last version just now
18:38 masak ok.
18:38 ruoso the example.pl shows how to access the request
18:38 masak will check.
18:38 ruoso the syntax is still bad...
18:38 ruoso because it is very verbose
18:38 ruoso but custom declarators will solve it in the long run
18:39 masak nice.
18:39 ruoso masak, notice the -> $name  parameter in the viewblog closure
18:39 ruoso which is generated from the regex of the action
18:40 * masak looks
18:40 ruoso you can have an arbitrary capturing in the regex
18:40 ruoso and that will be translated as arguments to the closures
18:41 ruoso also note that the Faz::Request class is just a placeholder... no actual type checking is made on it
18:43 ruoso ah... btw... in theory you can have named captures in the regex, which will then appear as named arguments to the closure
18:44 Tene masak: I noticed in my blog example that it would have been ideal to build an HTTP::Response, and ask Web to use that.
18:45 Tene but that infrastructure isn't there
18:45 masak oh, pity. :/
18:45 masak what do you need?
18:45 ruoso yeah... the response object should be provided indeed
18:46 ruoso because it's the lower level that knows which kind of response should be provided
18:46 Tene something backend-neutral... like returning an H::R
18:47 Tene all this $c.send-foo feels unwise to me
18:48 * ruoso has the slight feeling that he and Tene are talking the opposite
18:48 ruoso Tene, you mean the response object to be provided alongside with the request?
18:48 ruoso or for the application to turn a abstract response into the actual low-level response?
18:49 ruoso s/application/framework/
18:49 masak Tene: I'm not sure I see what you mean. I haven't looked closely at your code, only skimmed it.
18:49 masak Tene: please don't forget to blog about omgblog when you have time!
18:49 masak Tene: and please gloat appropriately about your 20 minutes compared to my 90. :)
18:50 masak the more fun it is to read, the better. :)
18:50 Tene ruoso: all I mean is that the app shouldn't have to know low-level details about the connection.
18:50 ruoso right...
18:50 ruoso but it should receive a response object and deal with it...
18:50 Tene yes
18:50 ruoso ok..
18:50 ruoso so we're saying the same thing...
18:51 Tene and my suggestion is for request() function to return an HTTP::Response object, or some such
18:51 Tene I didn't see what you had been saying... no clue. :)
18:51 ruoso Tene, that's why contextual variables are for
18:52 ruoso you should be able to access the current request and response objects just as
18:52 ruoso $*request and $*response
18:52 Tene masak: OK, thanks for reminder... yesterday was hell.
18:52 Tene should be able to tonight
18:52 Tene ruoso: why context instead of just function arguments?
18:52 masak Tene: no worries. looking forward to the post.
18:52 ruoso Tene, because you would need to be sending them through a lot of methods...
18:53 ruoso and they are part of the current "context"
18:53 Tene OK
18:53 Tene that sounds fine to me.
19:35 ruoso masak, I almost have yarn ported to FAz
19:35 masak ruoso: neat.
19:36 masak over here, we have gotten somewhere with the Hitomi prototype.
19:36 masak pair programming is very effective.
19:40 ruoso masak, http::daemon didn't work here... but I'll push the Faz version of yarn in faz' repo
19:40 masak ruoso: excellent.
19:42 ruoso masak, just pushed
19:42 ruoso see examples/yarn
19:48 masak ruoso: ok.
19:49 masak ruoso: you sure you pushed?
19:50 ruoso in faz repo,
19:50 ruoso not yarn's
19:50 masak ah, 'course.
19:50 * masak runs proto update
19:51 ruoso Could not locate a method 'uri' to invoke on class 'Web::Request'.
19:51 ruoso hmmm
19:52 ruoso is it $request.path directly?
19:53 ruoso ah...
19:53 ruoso it's url
19:55 ruoso Could not locate a method 'url' to invoke on class 'Web::Request'.
19:55 ruoso not quite right yet
19:56 ruoso masak, any idea?
19:56 masak ruoso: sorry, distracted...
19:57 ruoso hmm... it seems the object returned by HTTP::Daemon has the url info, but, surprisingly, Web::Request hasn't
20:00 masak that's probably true.
20:01 ruoso any particular reason/
20:01 ruoso ?
20:01 masak Web::Request only has very minimal implementation so far.
20:01 masak only the bare necessities to work for Nibbler et al.
20:01 ruoso er...
20:01 masak aka "not entirely ported yet"
20:01 ruoso the url of the request is kinda minimal
20:02 masak I agree.
20:02 ruoso (btw... it's usually called uri)
20:02 masak I almost added it the other day.
20:02 masak ruoso: yes.
20:03 ruoso masak, do you think you could add a .uri support in request?
20:03 masak ruoso: sure.
20:03 masak but I'd rather not deviate too far from Rack without good reason.
20:04 ruoso I mean in Web::Request
20:04 ruoso not in the HTTP::Daemon part
20:04 masak yes, I understand.
20:04 masak Web::Request is modeled directly after Rack::Request.
20:04 ruoso I strongly suggest you take a look in Catalyst::Request
20:04 ruoso and HTTP::Body
20:04 masak will do.
20:07 ruoso masak, considering I'm playing with Faz+Yarn right now... do you think it would be possible for you to do the change in Web::Request soon?
20:08 masak ruoso: you'll have it by tomorrow.
20:08 masak ruoso: I'd do it now, but I don't want to interrupt the hackathon.
20:09 ruoso right... (but if you did, I would have Yarn+Faz working right away)
20:13 masak ruoso: you're very welcome to try and patch Web::Request yourself in the meantime.
20:15 ruoso is there a URI class?
20:16 masak in Web.pm? no.
20:33 masak yay, we've got pl:if working in Hitomi!
20:33 Tene sweet
20:33 masak it wasn't that hard, really, but it took some time to sort out all the loose ends.
20:34 viklund http://gist.github.com/110712
20:46 moritz_ that fails epically if you add other XML tags
20:46 moritz_ my $str = '<ol pl:if="links">plink</ol><foo>sadf so</foo>';
20:46 moritz_ => Method 'postcircumfix:{ }' not found for invocant of class 'Failure'
20:46 masak moritz_: aye, viklund noticed exactly that.
20:46 masak the XML grammar is not very good. :/
20:47 moritz_ it should be <xmlcontent>* in rule node
20:47 masak aye.
20:49 masak ruoso: I will look more at your examples/yarn/yarn.pl tomorrow. it looks interesting.
20:50 ruoso masak, you probably want to take a look at lib/Yarn.pm
20:50 ruoso there's the interesting part...
20:50 ruoso ;)
20:50 masak yes, I saw that. :)
20:51 ruoso I'm almost making it run...
20:51 ruoso one of the actions already partly works
20:51 masak cool.
20:51 masak did I mention that my version works? :P
20:52 ruoso heh...
20:52 masak just teasing, it really looks nice.
20:52 ruoso I'm struggling with the regex part for the / case
20:52 ruoso the /create already matches
20:53 masak I'm looking forward to looking at this, and at Faz, in detail.
20:53 masak ruoso: once it works, are you fine with me blogging about it?
20:54 ruoso for sure...
20:54 ruoso class URI { has $.path };
20:54 ruoso method uri            {  Web::Request::URI.new(:path(~%!env<SCRIPT_NAME>)) }
20:54 masak that's often a good way for me to grok things.
20:54 ruoso gah...
20:54 ruoso that was supposed to be in a paste bot...
20:54 ruoso but...
20:54 ruoso I'm doing that as a work-around for the missing uri method
20:55 ruoso but I guess we actually need a URI class to be implemente
20:55 masak ok.
20:55 masak November has one.
20:55 * masak heads home to sleep
20:55 masak see y'all tomorrow!

| Channels | #november-wiki index | Today | | Search | Google Search | Plain-Text | summary