Perl 6 - the future is here, just unevenly distributed

IRC log for #testml, 2010-06-29

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

All times shown according to UTC.

Time Nick Message
00:14 ingy k
00:14 ingy back
00:16 ingy ssh pair@ec2-174-129-172-126.compute-1.amazonaws.com
00:16 ingy ...55
00:16 ingy I have a screen
00:17 ingy 7471
00:17 ingy I have until 11pm or so your time
00:18 ingy then need to fetch someone from airport
00:18 patch just finishing a salad
00:18 ingy :D
00:18 ingy I'm eating a bowl of cereal
00:20 patch IM IN UR SCREEN
00:23 ingy :D
00:24 ingy just fighting with David Wheeler
00:24 ingy anyways
00:28 ingy I hacked document
00:31 ingy see, we get no plan
00:31 ingy let's fix that
00:31 patch ok
00:31 ingy you drive
00:32 ingy two things I did to the Document module:
00:32 ingy 1) changed has $foo to has $.foo
00:33 ingy 2) predeclared stubs for the inner classes
00:34 ingy single quote kinda works
00:34 ingy but it keeps the quotes
00:34 ingy we can pull them off manually
00:34 patch i read today that you can only have one "class foo;" but multiple "class foo {}" per file
00:35 ingy yes
00:35 ingy I found that out today too :)
00:35 ingy weird
00:35 patch it would be nicer to correctly parse the single quotes too
00:35 ingy yeah
00:35 ingy well give it a try please
00:36 patch k
00:39 patch where are you extracting the plan?
00:41 ingy single_quoted_string
00:41 ingy that's the messed up one
00:45 ingy I'm couldn't get that syntax to work
00:50 ingy should we see how other grammars do quoted strings?
00:51 patch let's check out json
00:51 patch http://github.com/moritz/json/
00:51 ingy k
00:53 ingy do you grok that?
00:54 patch \" ~ \"
00:55 patch they tilde does something funny in p6 regexen
00:55 ingy :)
00:55 patch i think it take the next argument and puts it there
00:55 patch so that you can see the beginning and end next to eachother
00:56 patch just from memmory, i might be wrong
00:58 ingy what's a "final"?
00:59 ingy you wanna try?
00:59 patch "final ' "
01:00 ingy to run the test you can use my \] shortcut
01:00 ingy it does :w<up><cr>
01:01 patch cool
01:02 ingy I have an idea
01:03 patch yeah?
01:03 ingy we can reset, and just strip off the singles in the action for now
01:03 ingy and work on the right way later
01:03 patch k
01:03 ingy I'll drive
01:03 patch brb
01:06 patch back
01:10 patch blockoid :)
01:15 ingy I almost got it
01:15 ingy I just don't know how to make something
01:16 patch i have an idea
01:17 ingy go
01:18 patch playing hunt the cursor
01:22 patch i forgot to quote the quotes
01:27 ingy maybe we should skip this part for a while...
01:29 patch yeah, not making much progress
01:29 ingy I'll drive a sec
01:29 patch k
01:45 ingy data looks fine
01:46 ingy what does parse return?
01:47 patch fyi, unary ~ isn't needed with binary ~
01:47 patch match object
01:47 ingy I though ~ was concat
01:47 patch it is
01:47 patch but it stringifies the operands
01:48 ingy I just want to see if the data is parsing
01:50 patch guess it's not returning anything
01:51 patch nevermind
01:52 ingy I guess the 2nd parse fails
01:56 ingy it's matching 0 data blocks
02:05 ingy from 0 to -3???
02:05 ingy wtf?
02:05 ingy anyway it is failing the parse
02:05 ingy hmm
02:05 patch -3 is strange
02:06 ingy what does $ mean
02:06 ingy total end of string?
02:06 patch yes
02:06 patch string: ^ $
02:06 patch line: ^^ $$
02:10 ingy ok
02:11 ingy what is _ ?
02:12 patch underscore char
02:12 patch since it's a "word" char
02:14 ingy === Test mixed case string
02:14 ingy we are trying to match on that
02:14 ingy the label is "Test mixed case string"
02:15 patch just checked the testml spec, those _ are errors
02:16 patch block-label := (ANY - (SPACE | BREAK)) (NON-BREAK* (ANY - (SPACE | BREAK)))?
02:16 ingy ???
02:18 ingy is - valid?
02:18 ingy I mean it to be ANY except SPACE or Break
02:19 patch not valid.  i'm not sure of the syntax when using subrules...
02:19 patch <[abcd]-[bc]>
02:19 patch thats's <[ad]>
02:20 patch the same as ^
02:20 patch we haven't defined NON_BREAK and some of these in this grammar
02:22 patch what non-space-break?  it's not in the spec.
02:29 ingy user_point is not in the spec
02:29 ingy :\
02:30 ingy let me check p5
02:30 patch k bbi5
02:33 ingy we win
02:35 patch back
02:49 ingy I think...
02:49 ingy we need to grab the values here
02:49 ingy let me start...
02:52 ingy seems slightly wrong...
02:52 ingy each block should have 2 points
02:55 ingy o you see what's happening?
02:55 ingy d
02:56 patch not sure.
02:56 patch btw, we still have a _ in there.
02:56 patch for lines_point
02:57 ingy where?
02:57 ingy let me try something
02:59 ingy my mistake
02:59 ingy it is working
02:59 ingy :\
03:02 ingy I need to get the user_point_name s and the values
03:02 ingy and put them in the block
03:03 ingy ideas?
03:03 patch taking a look
03:04 ingy I gotta run.
03:04 ingy feel free to play
03:04 ingy :)
03:04 ingy thanks for working on this!
03:04 ingy it will totally be worth it when it works
03:05 patch agreed!
03:26 patch fixed lines_point
03:31 patch i need to take off.  just commited and pushed.  will revisit tomorrow.
15:54 masak joined #testml
15:54 masak o/
15:54 ingy \o
15:54 ingy one sec
15:54 ingy setting passwd
15:55 ashleydev joined #testml
15:56 ingy masak: ssh pair@ec2-174-129-172-126.compute-1.amazonaws.com
15:57 masak I'm in.
15:57 ingy ok one sec
15:58 ingy screen -Ux ingy/
16:09 ingy masak: http://testml.org/specification/language/
16:09 ingy that's the grammar
16:09 masak oki.
16:09 ingy and there's a perl5 and python impl
16:10 masak could you tell me the thing you're stuck on?
16:10 ingy and the grammar translates pretty cleanly to p6g
16:10 ingy yes
16:11 ingy see the plan => "'42'"
16:11 ingy ?
16:11 masak yes.
16:12 ingy I want to strip off the quotes...
16:12 ingy let me show you
16:12 masak it's not captured into anything.
16:14 ingy how do I make 42 into the ast?
16:14 masak make ~$/.substr(1, -1)
16:15 masak the ~ doesn't do anything there. it's evaluated last.
16:15 masak also, be aware that TimToady has said that it should really be .substr(1, *-1), but that has hit neither the spec nor Rakudo, IIRC.
16:15 masak otherwise, that should be it.
16:15 masak what did you get from $/.substr(1, -1) again?
16:16 masak I saw the output flash by, but didn't catch it.
16:16 ingy it works
16:16 masak it's without quotes.
16:16 ingy but the make doesn't DWIW
16:16 masak so it's just that you're not getting the value our right.
16:16 masak s/our/out/
16:16 ingy yeah
16:16 masak where do you do that?
16:17 ingy do what?
16:17 masak get the value out.
16:17 masak oh wait. you just inspect $/, right?
16:17 masak no, I meant of the match object.
16:18 masak the highlight is where you put it in :)
16:18 masak put differently, how do you build the output that you test in the test?
16:18 masak it's made from $/ somehow, but how?
16:20 ingy I create an empty document and then populate it with actions
16:20 masak ok.
16:20 ingy one sec
16:21 ingy http://github.com/ingydotnet/testml-pm6/tree/master
16:21 ingy it's all in there
16:21 masak ok.
16:21 ingy I use TestML::Parser to create a TestML::Document
16:22 ingy I am getting the grammar to parse the test doc
16:22 ingy but I am struggling to get the data out of the ast
16:23 masak in t/basic.t
16:23 ingy plus this is my first p6
16:23 masak say $match.meta.data.perl;
16:23 ingy patch did most of this
16:23 masak what does that line do?
16:24 ingy parse returns a TestML::Document
16:24 ingy object
16:24 ingy that dumps a part of it
16:24 ingy the meta.data section
16:24 masak what sets that object?
16:25 ingy if you just dump $match, you don't get much of a dump
16:25 masak right.
16:25 masak what I'm interested in is the thing that takes the match and puts it in meta.data
16:25 masak I want to see if it actually uses the .ast information, or just the stringification of that match object.
16:26 ingy see class Parser?
16:27 masak yes.
16:28 masak hm. I'm having difficulty putting together the pieces through an SSH tunnel and a browser.
16:28 masak I think I need to run this myself.
16:28 ingy sure
16:28 ingy I'm super laggy here
16:29 ingy sorry
16:29 masak np
16:29 ingy let's try again later
16:29 masak will be going soon, but yes.
16:29 ingy going where?
16:30 masak going from work to evening-time :)
16:30 ingy :)
16:30 ingy enjoy
16:35 masak not gone yet :)
16:35 masak running your test locally now.
16:38 masak so far, my question has boiled down to "which line sets meta.data.Plan?"
16:49 masak ...and I thought I would find that line quickly, but it seems I'm not finding it at all...
16:52 masak ingy: what sets meta.data<Plan> to "'42'"?
17:23 ingy hi
17:25 ingy method meta_statement($/) {
17:25 ingy $doc.meta.data{~$<meta_keyword>} = ~$<meta_value>;
17:25 ingy }
17:25 masak ah.
17:25 ingy Plan is a meta_keyword
17:25 masak that's why grep didn't dig up anything :)
17:25 ingy 42 is the value
17:26 masak try $<meta_value>.ast
17:26 ingy ok
17:27 masak shouldn't matter, but...
17:28 ingy I'm not sure what you mean
17:28 masak ~$<subrule> should be the same as $<subrule>.ast
17:28 masak gotta go now.
17:28 masak will try more tomorrow.
17:29 masak o/
17:45 ashleydev joined #testml
19:51 ingy hi ashleydev
19:51 ingy welcome to #testml
20:13 ashleydev hey
20:13 ashleydev (back from lunch ;)
20:15 ashleydev ingy: is testml being used anywhere yet?
20:17 ingy ashleydev: yes
20:17 ingy :)
20:17 ingy it is being used for JSYNC.pm
20:18 ingy but it is a Acmeization of Test::Base which is used by a lot of projects
20:18 ashleydev ... This is a very early release of JSYNC, and should not be used at all
20:18 ingy :D
20:18 ingy *you* can use it
20:18 ashleydev ;)
20:18 ingy Schwern is using it
20:18 ingy he gave me a patch a couple days ago
20:19 ingy JSYNC actually works pretty well
20:19 ingy you should look at the test. :D
20:19 ashleydev interesting... JSYNC is yaml paired down to the JSON subset
20:19 ingy tests
20:19 ingy something like that
20:19 ashleydev ok, now looking at the tests...
20:20 ingy http://www.jsync.org/
20:20 ingy and http://testml.org/
20:20 ashleydev I saw testml.org -- which is why I jumped over here
20:21 ingy once testml works on p6, i'll port jsync to p6
20:21 ashleydev (well that and I saw you mention it in #perl6 )
20:21 ingy :)
20:21 ingy are you a p6 hacker?
20:21 ashleydev lurker.
20:21 ingy have you tried p6 grammars?
20:21 ashleydev i've used fglock's pugs::compiler::rules in productions
20:22 ashleydev *production
20:22 ashleydev kind of slow but VERY useful
20:22 ingy do you feel like pair programming for a few minutes?
20:22 ashleydev sure
20:22 ingy do you know about ssh screen and vim?
20:23 ashleydev yup use them all the time
20:23 ingy great
20:23 ingy do you know anything about ec2?
20:23 ingy I just started using it yesterday
20:23 ashleydev played with it.. nothing long term or production
20:23 ashleydev and I follow the blog
20:23 ashleydev using engine yard now
20:23 ashleydev ;)
20:24 ashleydev what are your impressions of ec2
20:24 ashleydev anything that jumps out at you (gives you joy)
20:25 ingy um
20:25 ingy well I just want to create an image with p6 on it and my dev env that I can boot up to pair anytime
20:25 ashleydev (as in: http://mattgemmell.com/2010/06/26/shareable-experiences)
20:26 ashleydev nice...
20:26 ashleydev ok so let me in ;)
20:26 ingy yeah, one sec
20:27 ingy ssh pair@ec2-174-129-172-126.compute-1.amazonaws.com
20:27 ingy ashley56
20:27 ingy what's your term size?
20:28 ingy set to 178x45 please
20:28 ingy :)
20:28 ashleydev done
20:29 ashleydev looks like you're on a macbook
20:29 ingy screen -Ux ingy/
20:29 ingy from my term size?
20:29 ashleydev yes
20:29 ingy I am :D
20:29 ashleydev \o/ woot
20:30 ingy term maxxed with tabs
20:30 ingy so let me take you through it
20:31 ingy so you see the data struct I have there
20:31 ingy ?
20:32 ashleydev sorry
20:32 ashleydev ok just jumped in
20:32 ashleydev where?
20:32 ingy I'll rerun the test
20:33 ingy I am trying to parse a testml document string into a TestML::Document object
20:33 ingy you can see I'm part way there
20:33 ingy the little dump thing
20:34 ashleydev :)
20:34 ingy you are in window 0, yes?
20:34 ashleydev yes
20:35 ashleydev k
20:36 ashleydev may I?
20:36 ingy oui
20:37 ashleydev ok
20:37 ashleydev carrry on
20:37 ingy ok
20:37 ingy that's the v6 test
20:38 ingy which 'make test' runs
20:38 ingy all the work is done in Parser.pm
20:38 ingy on the right
20:38 ingy so look at the Parser class
20:39 ingy at the bottom
20:39 ingy I actually parse in two steps
20:39 ashleydev why?
20:39 ashleydev what's $data?
20:39 ingy the first parse pulls the data section out as a string
20:39 ingy and the second parse parses it
20:39 ingy because
20:40 ingy very often the data section is in a separate file
20:40 ingy used by many tests
20:40 ashleydev ok
20:40 ingy see JSYNC t/dump.t and t/load.t
20:40 ingy anyway, the grammar is working overall
20:40 ingy grammars
20:41 ashleydev nice
20:41 ingy but I can't seem to do the right things in the Actions class to get the data out
20:41 ashleydev heh
20:41 ingy so let's start small
20:41 ashleydev cool
20:42 ingy I want to get the Plan: '42' to be unquoted
20:43 ingy the 'make' line is wrong
20:44 ashleydev did that do anything?
20:45 ingy didn't see what you did
20:45 ingy was looking at http://github.com/moritz/json/blob/master/lib/JSON/Tiny/Actions.pm
20:45 ashleydev "foo"
20:45 ashleydev and we'll make it again...
20:46 ashleydev ready?
20:46 ingy yes
20:46 ashleydev no foo
20:47 ashleydev or you could say: $/.ast = ...;  #?
20:48 ashleydev ready?
20:48 ashleydev :P
20:50 ashleydev the next line has bad syntax
20:50 ashleydev O HAI
20:50 ashleydev ;)
20:50 ashleydev ok
20:51 ashleydev wow
20:51 ashleydev i see your delima
20:51 ingy I got an idea
20:51 ashleydev go
20:53 ashleydev may I?
20:56 ingy I have to confess, I haven't given s05 a complete read
20:56 ashleydev neither have i ;)
20:56 ashleydev look at that!
20:57 ingy what happened?
20:57 ashleydev hahaha
20:57 ashleydev gotta say it
20:58 ashleydev oh
20:58 ashleydev hmm
20:58 ingy I have an idea
21:01 ingy quoted_string =>    Match.new(
21:01 ingy ast  => "42",
21:01 ingy see that part
21:01 ashleydev yeah...
21:01 ashleydev totally
21:04 ashleydev why did the say() make it work?
21:05 ingy it never worked
21:05 ingy I mean I think make is affecting the parse tree
21:05 ingy but not in the way we want
21:05 ashleydev ok
21:05 ashleydev right...
21:05 ingy I need to go read up
21:05 ashleydev but the .ast is changed...
21:05 ingy I'll check this in
21:06 ingy and you can hack on it locally if you care to
21:06 ashleydev semi colon
21:07 ashleydev so that's odd
21:07 ashleydev where is that hash value coming from then?
21:09 ashleydev it looks like the make is working
21:09 ingy I assume you can git the code and run it locally?
21:09 ashleydev I'd wonder where the hash value is getting it's value if not from .ast...
21:09 ashleydev yes
21:09 ingy k
21:10 ingy i'll be here
21:10 ingy thanks!
22:13 ashleydev ingy:  see pull request
22:17 ingy !
22:21 ingy I see
22:22 ingy I was just coming to that conclusion
22:22 ingy you need to pull things up the tree
22:22 ingy it doesn't happen automagically
22:22 ingy so 'ast' is not a special kw
22:23 ingy just a convention?
22:30 ashleydev seems lame to me
22:30 ashleydev but my guess is that you're supposed to build your own external data structure of what you think the finished parse info should be
22:31 ashleydev even if you kind of store it temporarily in $/ attributes..
22:31 ashleydev but there was something awkward this...
22:46 ingy I just got a pile of good info in #perl6
22:46 ingy check it out
22:46 ingy do you want a commit bit for this?
22:47 ingy I applied your change by hand
22:47 ingy I meant to say...
22:48 ingy you have a commit bit for this :P
22:55 ashleydev joined #testml
23:53 ingy hey ashleydev
23:53 ingy did you see I gave you a commit bit?

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