Camelia, the Perl 6 bug

IRC log for #november-wiki, 2009-04-28

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

All times shown according to UTC.

Time Nick Message
00:05 Tene zarah: msg masak Check out this grammar/actions for parsing hitomi stuff: http://gist.github.com/102833
00:05 zarah Tene: You have no new messages.
00:05 Tene zarah: tell masak Check out this grammar/actions for parsing hitomi stuff: http://gist.github.com/102833
00:05 zarah Consider it noted.
00:34 sri_kraih joined #november-wiki
04:06 sri_kraih_ joined #november-wiki
07:10 masak joined #november-wiki
07:12 masak Tene: re xml grammar/actions: cool! will try it.
07:13 Tene not sure what you wanted to do with it, but that looks more productive than the approach you had in the hitomi draft
07:13 moritz_ masak: I've just done some action method hacking for JSON - now that pmichaud++ fixed the segfault, they are a nice alternative aagain
07:14 moritz_ http://github.com/moritz/json/
07:14 zarah moritz_'s link is also http://tinyurl.com/daxza8
07:14 masak Tene: I'm sure it is. :) though at this point, before trying the code, I'm not sure how you managed to make actions do what we need. I've yet to figure out how in my mind.
07:15 masak moritz_: nice.
07:15 Tene moritz_: I also got some work done on my POE-alike
07:15 moritz_ afk
07:15 Tene erm, masak
07:15 masak aye, I realized.
07:15 Tene tab-complete--
07:16 masak Tene: this week for Web.pm, I'll primarily look at November, and try to make it use Web.pm for Requests and Responses.
07:16 masak will also try to think of what else we need in terms of basic structure.
07:17 Tene http://pleasedieinafire.net:2080/43608
07:17 zarah Tene's link is also http://tinyurl.com/dhnvdq
07:18 masak looks good.
07:18 Tene long way to go, but still fun.
07:18 Tene oh, want me to commit that hitomi draft?
07:18 masak due to the nature of how pick() currently works/is specced, that one will fail if you restrict the $name param to Str. :)
07:19 masak Tene: yes, please.
07:19 masak Tene: and a general go-ahead on all similar requests in the future.
07:19 Tene Okay.
07:19 masak it's source-controlled, and we want as much of our ideas as possible in there.
07:20 Tene Okay, then I'll feel free to stomp all over your stuff. :)
07:21 masak absolutely.
07:21 * masak tries Tene's Hitomi prototype
07:25 masak Tene: okay, so it does do what my parser did, but not what I tried to make it do. what that was might not have been entirely clear.
07:26 masak what I tried to make it do was to react on those pe:if and pe:for attributes.
07:26 Tene masak: I wasn't really clear on what you wanted it to do, so I just built a tree of XML nodes.
07:26 masak aye.
07:27 masak this is a good start, at least. I like that we're using actions; that seems like a generally good idea.
07:27 Tene nodnod
07:27 masak we're mangling whitespace right now. that's not good.
07:28 masak and the big thing will be when we can parse and react on the pe: attributes.
07:28 * masak looks at hitomi-example.xml
07:29 masak so, my idea was something like this: the value of a pe:if attribute is a runnable Perl 6 expression.
07:29 masak in this case, it tries to call the sub 'links'.
07:30 Tene will there only ever be one pe:xxx attr in a node?
07:30 masak I'm not 100% sure how the connection between the templating and the rest of the program will work here, so I'm being deliberately minimal.
07:30 masak Tene: I think so.
07:30 masak don't see when several are needed.
07:30 Tene OK
07:30 masak having several should probably be an error, at least for now.
07:31 Tene Should be pretty easy, then.  Find any pe:xxx in the attrs, and then have a dispatch table, maybe with 'when'
07:31 masak and let's start with pe:if and pe:for, because those are the only two I know about.
07:31 Tene someone should also combine <node> amd <empty>
07:31 moritz_ if you're mangling whitespaces, it means that somebody doesn't use .chunks as they should :-)
07:31 masak moritz_: not sure we can use it all the way here.
07:32 masak moritz_: we're interested in the XML hierarchy as well.
07:32 Tene I wasn't really intending to reserialize it exactly like that... that was just a demo to show that we had the full tree.
07:32 masak specifically, we want to intervene at those pe:xxx stops.
07:32 moritz_ masak: .chunks returns match objects for captures
07:32 masak moritz_: aha. cool.
07:33 masak so the value of a pe:if attr is a Perl 6 expression, whereas the value of a pe:for is the part that can appear between 'for ' and ' {' in Perl 6.
07:34 masak not sure how we'll enforce that, yet.
07:34 masak would probably be best to hook into Rakudo's Perl 6 parser somehow.
07:35 masak ok, so one of the goals for today is to make the Hitomi prototype work with the example XML and an example 'list' sub.
07:35 masak I'll go make the latter now.
07:36 masak s/list/links/
07:36 moritz_ eval?
07:36 masak moritz_: Perl 6 injection.
07:37 masak in a user-written template, but still.
07:37 masak not ideal.
07:37 moritz_ then you shouldn't make Perl 6 syntax a feature
07:38 masak moritz_: I just want it to accept what it's meant to accept, and nothing more.
07:38 masak something like <EXPR> -> <SIGNATURE>
07:39 moritz_ you know, Template::Toolkit ended up parsing its own crappy Perl 5 dialect
07:39 masak aye. let's not do that.
07:39 moritz_ I really want to avoid that :-)
07:39 masak we have a built-in parser in Perl 6.
07:39 masak let's use it.
07:40 moritz_ many catalyst examples actually trigger database queries from the templates
07:40 moritz_ that's... scary
07:41 masak hm.
07:41 masak sounds a bit too powerful.
07:42 moritz_ actually I worry about error handling, for example
07:42 moritz_ well, it allows method calls
07:42 moritz_ and DBIx::Class defers DB queries until the point where they are needed
07:42 masak error handling in templates?
07:43 moritz_ well, if your template triggers a database error, where will you handle it?
07:43 masak right.
07:43 moritz_ at that point you already left the Controller method
07:43 masak until I see the need, I don't plan to do database queries from templates.
07:44 masak will ask mst about it, though.
07:58 masak http://gist.github.com/103016 # example sub 'links'
08:01 Tene I know I can make it work… but I need to go to sleep.
08:01 Tene If you don't have it done by the next time I have time available, I'll work on it.
08:02 masak goodie.
08:02 masak I'll give it a try.
08:02 masak need to learn about .chunks and actions anyway. :)
08:02 masak Tene: sleep well.
08:02 Tene yeah, I'm a lot less knowledgeable about that .chunks stuff...
08:03 Tene if you could get it to preserve whitespace and such, that would be awesome
08:03 moritz_ I've used .chunks earlier today for processing the <string> rule in json
11:02 zarah joined #november-wiki
11:21 zarah joined #november-wiki
11:21 ascent_ joined #november-wiki
11:25 wayland76 joined #november-wiki
11:49 ruoso joined #november-wiki
15:53 omega joined #november-wiki
16:10 masak @tell Tene I had high hopes for being able to traverse the XML tree, but I had to give up. heading home now -- you are welcome to give it a go.
16:10 zarah Consider it noted.
16:11 Tene what are you wanting to do with it, exactly?
16:11 zarah Tene: You have new messages. Write '/msg zarah @messages' to read them.
16:11 Tene @massage
16:11 masak Tene: hm, I explained it in detail on #perl6. will link to that explanation, hold on.
16:11 zarah Tene: 51 s ago, masak said I had high hopes for being able to traverse the XML tree, but I had to give up. heading home now -- you are welcome to give it a go.
16:12 masak http://irclog.perlgeek.de/​perl6/2009-04-28#i_1100539
16:12 zarah masak's link is also http://tinyurl.com/d3kpl9
16:13 masak for now, it'd be enough if it did the first thing flawlessly, and then just shouted "SPECIAL" or something as soon as it found a 'pe:' attribute.
16:14 masak for extra bonus points, it would actually DTRT with the 'links' sub I posted earlier.
16:15 * masak packs up and heads home
23:56 moritz_ joined #november-wiki

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