6.2.11 released! | pugs.blogs.com | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 Set by wolverian on 12 February 2006. |
|||
00:09
dduncan joined
00:36
kakos joined
00:54
drbean left
01:08
lao_ joined
01:29
oylenshpeegul joined
01:45
oylenshpeegul left
01:47
Amnesiac joined
01:51
arcady joined
02:12
arcady joined
02:30
Ovid joined
02:41
ayrnieu joined
02:42
alexe joined
02:43
Cryptic_K joined
02:59
Ovid joined
03:40
szbalint joined
03:49
drbean joined
04:01
drbean left
04:11
alexe left
04:13
putter joined
|
|||
putter | bsb: (faint, long delayed) "pong..." | 04:14 | |
svnbot6 | r9082 | putter++ | misc/pX/Common/Tasks - removed regexp_engine_demo.pl entry, as that spike is now finished. | 04:33 | |
r9083 | putter++ | modify Tasks again. | 04:36 | ||
r9082 | putter++ | misc/pX/Common/Tasks - removed regexp_engine_demo.pl entry, as that spike is now finished. | |||
putter | re p5 regexp engine performance... finally getting some sane numbers now (ie, slow enough to seem plausible;), after taking into account Regexp::Parser optimizations. still looks adequate. | 04:37 | |
04:38
vel joined
|
|||
putter | svnbot6: thanks for rubbing it in ;) # re commit, change mind, commit again | 04:38 | |
i hope to be around tomorrow. good night & | 04:44 | ||
05:40
scook0 joined
06:09
kisu joined
|
|||
svnbot6 | r9084 | gaal++ | * Rationalize single-pass build. | 06:31 | |
r9084 | gaal++ | The Prelude is now always inlined in source form in Pugs.Prelude, which | |||
r9084 | gaal++ | is promoted to a real Haskell file (not an #include as before). This means | |||
r9084 | gaal++ | we don't need PreludePC.hs-null, and the build should be much less flaky. | |||
gaal | & | 06:32 | |
svnbot6 | r9085 | audreyt++ | * If PreludePC.yml is not present during precomp, don't emit | 07:04 | |
r9085 | audreyt++ | useless "Right Nothing" warnings. | |||
r9086 | audreyt++ | * Parser: split ruleStatementList's semicolon handling | 07:10 | ||
r9086 | audreyt++ | into two functions to cut ~2000 parsecBind calls. | |||
07:17
beppu joined
07:21
f joined
07:26
f is now known as fandango
|
|||
audreyt | bbl | 07:32 | |
(-> hackathon) | |||
svnbot6 | r9087 | autrijus++ | * revert the nonSep commit for now -- will continue after more profiling is done en route to hackathon | ||
obra | the hackathon. wow. so jealous. | 07:33 | |
gaal | whee & | ||
GeJ | morning happy .il hackathoners | ||
07:33
gaal left
|
|||
GeJ | morning obra | 07:33 | |
audreyt++ # journaling :) | |||
07:38
Aankhen`` joined
07:40
iblechbot joined
07:43
drbean joined
07:53
marmic joined
07:55
Ovid joined
|
|||
dduncan | I have been building r9084, and it has been sitting at the "Reloading Prelude from source..." for awhile now ... | 08:02 | |
top shows the 'pugs' process having 30 min+ of cpu time | |||
I killed it, re-pulled, and try make again | 08:03 | ||
08:03
rantanplan_ joined
08:11
Bit-Man joined
08:12
KingDiamond joined
08:24
kane_ joined
08:40
elmex joined
08:46
drrho joined
08:51
clkao joined
|
|||
buu | ?eval 1 | 09:02 | |
SUCK | |||
09:02
evalbot_9054 is now known as evalbot_9084
|
|||
evalbot_9084 | (no output) | 09:04 | |
09:09
KingDiamond joined
|
|||
clkao | it seems the current smoke still thinks it's smoking a release | 09:21 | |
09:27
nnunley joined
09:45
knewt_ joined
|
|||
dduncan | similar problem with latest | 09:51 | |
'make' has been sitting at "Generating precompiled Prelude, Test... " for 100 CPU minutes and counting | 09:52 | ||
or rather, that's how long the current 'pugs' process has been running | |||
killing ... | |||
maybe better luck tomorrow | 09:53 | ||
09:54
xinming joined
09:55
xinming joined
09:58
knewt_ is now known as knewt
10:36
penk joined
10:48
elmex joined
10:52
drbean joined
11:06
chris2 joined
11:27
kisu joined
11:46
iblechbot joined
12:00
drbean joined
12:04
iblechbot_ joined
12:06
kane-xs joined
|
|||
kane-xs | seen audreyt | 12:07 | |
jabbot | kane-xs: audreyt was seen 4 hours 34 minutes 30 seconds ago | ||
12:42
robkinyon joined
12:47
alexe joined
13:05
kolibrie joined
13:31
Limbic_Region joined
14:08
Qiang joined
|
|||
svnbot6 | r9088 | fglock++ | iterator_engine_p6regex.pl - compile and run simple rules | 14:17 | |
r9088 | fglock++ | like '<word> <ws> xyz' | |||
14:19
azurot1 joined
14:23
cdpruden joined
14:49
chris2 joined
14:54
vel joined
|
|||
svnbot6 | r9089 | audreyt++ | * Draft of my OSDC.il hackathon plans. | 14:56 | |
r9090 | audreyt++ | * Unbreaking the build by generating the inline prelude using | 14:59 | ||
r9090 | audreyt++ | proper line escaping. | |||
r9091 | audreyt++ | * Refactor operators part out of Pugs.Parser into Pugs.Parser.Operator | |||
r9091 | audreyt++ | to save compilation time. | |||
r9092 | audreyt++ | * Test.pm: Bump copyright year. | 15:02 | ||
15:02
iblechbot joined
|
|||
audreyt | gaal broke the build; sorry about that. it's been repaired | 15:05 | |
(just arrived to the hackathon site with wireless set up) | |||
evalbot will resume service shortly. | 15:06 | ||
svn.openfoundry.org/pugs/misc/pX/au...athon-plan # some draft plan done on the car | 15:07 | ||
s/on/in/ | |||
15:23
nothingmuch joined
|
|||
audreyt | cool, the wifi extends to the cabin | 15:23 | |
nothingmuch | greetings from the hackathon | ||
audreyt | though not the common room | ||
nothingmuch | where is the common room? | ||
the one to the south? | |||
audreyt | the one with the ping pong tables | ||
nothingmuch | ooh | 15:24 | |
where's that? | |||
audreyt | I'll show you | ||
GeJ | are you having a hackathon in a 80 rooms castle? | ||
15:25
Ovid joined
|
|||
audreyt | we're not :) | 15:26 | |
though the field is large-ish | |||
nothingmuch | GeJ: this cabiny place | ||
hola Ovid | |||
audreyt | (I think, havn't completed the survey) | ||
Ovid | Good morning all. | ||
15:27
gaal joined
|
|||
audreyt | hey ovid | 15:27 | |
gaal | hola | ||
Ovid | Morning Audrey. | ||
nothingmuch | hola gaal | 15:28 | |
this feels very sad | |||
theorbtwo | Allo, crowd! | ||
nothingmuch | i turn my head to the left and see that gaal is ignoring me | ||
but then i look slightly ot the right and see that he is in the wrong window | |||
gaal | nothingmuch! hello! | ||
nothingmuch | hi! | ||
gaal | I'm so happy you're here | ||
I'd not be here either | 15:29 | ||
theorbtwo thinks p6-on-p5 should be called SF. | 15:30 | ||
65->sixty-five->SF. | |||
Qiang | howdy, audreyt . how is jerusalem ; ) | ||
15:31
bsb joined
|
|||
Arathorn | SF has too many sourceforge connotations... | 15:31 | |
theorbtwo | D'oh. | ||
We could call it sci-fi. | |||
15:41
gaal_ joined
|
|||
Arathorn | how does p6-on-p5 via pugs tie in with Larry's p5-to-p6 translator (if at all)? | 15:41 | |
kolibrie | theorbtwo: p6-on-p5 -> 6/5 -> six-fifths (what a tongue twister) | 15:43 | |
spinclad | sxi-fvi | 15:44 | |
15:44
xerox_ joined
|
|||
spinclad | 6/5 -> a fifth again | 15:45 | |
bartender! i'll have ... | |||
theorbtwo likes "another fifth" as a name. | 15:46 | ||
audreyt | Qiang: jerusalem has excellent dinner, otherwise I havn't spent time on it | 15:52 | |
Arathorn: not tied at all at this moment | 15:53 | ||
clkao | so when will we be able to use string eval in js backend? | ||
xinming | p5++ :-P | 15:54 | |
clkao | i shall say how. | ||
xinming | how about the name p5++ ? | ||
stevan_ | horray the hackathon has begun :) | 15:55 | |
theorbtwo | Hard to google for. | 15:56 | |
stevan_ | audreyt: IIRC autobox.pm no longer needs a patch to perl :) | ||
audreyt | yup, I discovered that too :) | ||
audreyt has TAOMP with her as the only book brought to the hackathon | |||
stevan_ | :) | 15:57 | |
looks like a good plan though | 15:59 | ||
hackathons++ | |||
16:00
gaal_ is now known as gaal,
stevan_ is now known as stevan
|
|||
nothingmuch | hola stevan | 16:00 | |
stevan | heya nothingmuch | ||
audreyt: re: p6 over Class::MOP, I think that will be not too hard actually | 16:02 | ||
I wrote up an example of changing method dispatch order the other day (search.cpan.org/src/STEVAN/Class-MO...Order.pod) | 16:03 | ||
it is fairly straightforward | |||
16:03
dduncan left
|
|||
audreyt | cool | 16:06 | |
stevan | audreyt: how far are you along in AMOP? | ||
16:08
hexmode joined
16:10
fglock joined
|
|||
fglock | hi all! | 16:12 | |
stevan | hey fglock | ||
fglock | hi stevan! are you in the hackaton too? | ||
I wish I was there | 16:13 | ||
stevan | fglock: yes, but not physically :P | ||
fglock | :) | ||
stevan | fglock: hackathons can have virtual participants too | ||
16:14
TMTOWTDIt joined
|
|||
gaal | audreyt: hey, do you think a prim that dumps a Parse-YAML string programmatically is in order? | 16:15 | |
16:24
r0nny joined
|
|||
audreyt | gaal: sure, why not | 16:34 | |
stevan: not far... ch3 I think | |||
obra | 'morning | 16:35 | |
nothingmuch | everyone interested join hackathon, this is for administrative | 16:36 | |
a | |||
16:37
justatheory joined
|
|||
audreyt | nothingmuch means #hackathon | 16:38 | |
(for administrative things) | |||
svnbot6 | r9093 | fglock++ | iterator_engine_p6regex.pl - rules now operate on 'str' instead of array of char | 16:39 | |
r9094 | fglock++ | iterator_engine_p6regex.pl - simplified internal API - rules are now almost plain-p5 | 16:48 | ||
fglock | changing emit_rule() to try to emit a p5 regex, and then fallback to code = very fast rules under p5 | 16:52 | |
16:52
vel joined
|
|||
fglock | what is the syntax to call p5 code from within a rule? something like 'rule { xyz perl5:{ some_code } }' | 17:00 | |
17:24
xerox_ joined
17:50
rantanplan_ joined
|
|||
nothingmuch | yes | 17:56 | |
sorry | |||
17:59
as joined
18:05
anatolyv joined
|
|||
audreyt | fglock: "rule { xyz { v5; ... } }" perhaps | 18:05 | |
nothingmuch | glue( $gaal, $kolibrie ); | 18:06 | |
gaal sticks | |||
18:07
vel joined
|
|||
gaal | so, parsing Perl 6 | 18:07 | |
kolibrie sticks | |||
gaal: very gently, please, my haskell is almost nil, and parsing not much better | |||
18:07
xinming joined
|
|||
kolibrie | but I very much want to learn | 18:08 | |
gaal | okay :) we use a library called Parsec | ||
kolibrie | got that | ||
gaal | the scary description for it is "monadic combinator parsing library" | ||
ignore the monadic for a minute :) | |||
combinator just means that it works by combining functions | |||
let's look at a simple example | 18:09 | ||
kolibrie | nothingmuch mentioned the monadic part automatically keeps track of where we were in the input | ||
but that's it | |||
gaal | yeah, ignore it for now | ||
kolibrie ignores it for now | |||
gaal looks for a rightly sized example | 18:10 | ||
sec | |||
18:12
putter joined
|
|||
gaal | okay, a really simple example in ruleHashSubscriptBraces | 18:12 | |
line 1515 | |||
kolibrie looks for it | |||
gaal | between (symbol "{") (char '}') $ option id $ ... | ||
fglock | audreyt: thanks | ||
kolibrie | gaal: which file? | 18:13 | |
gaal | Parser.hs | ||
so we're right in the middle of parsing perl | 18:14 | ||
we're looking at the bit that parses out the {"moose"} in %myhash{"moose"} | |||
I'll connect this to the big picture in a minute | 18:15 | ||
kolibrie arrives at line 1515 | |||
putter | fglock: rule { ... [:perl5:: this is p5 ] ... } | 18:16 | |
or [:perl5(1) this is perl5 ] | 18:17 | ||
gaal | the parser is trying for example to look at something like my $elk = %myhash{"moose"} | ||
kolibrie | ok | 18:18 | |
fglock | putter: what does (1) mean in :perl5(1) ? | ||
gaal | and at among other things it wants to distinguish between "my $elk = %myhash" (which assings a reference to the hash into $elk) and what the programmer really meant, which is to look up a value *in* the hash and assign that to $elk. | ||
so suppose our current position is just after the identifier %myhash | 18:19 | ||
if we succeed in parsing this ruleHashSubscriptBraces, this will indeed be a hash lookup | |||
kolibrie | so the next character is '{' | 18:20 | |
gaal | if not, and ruleHashSubscriptBraces fails, then whoever called it will try something else; for example, if it hits the sentence end then the assignment is for the hashref like we said | ||
so yes | |||
the next character is '{' | |||
but the code says between (symbol "{") (char '}') ... | 18:21 | ||
which is a fancy way of setting up "expect '{' now, then -- hold on I'll tell you in a second, -- and THEN a closing brace | |||
putter | :foo is a "normal" modifier. its argument defaults to 1. so :foo is equiv :foo(1). in a regexp, you have to figure out where the modifier ends. eg, in /:perl5aa/, is that a :perl5aa modifier and no content, a :perl5a modifer on "a", a... etc. so you can either have the explicit argument list, or use :: which at the beginning of a group is a no-op, and can't be misinterpreted as part of the modifier. | ||
gaal | and then indeed say what was supposed to go inside the braces | 18:22 | |
kolibrie: in the Haskell syntax level, it works like this | |||
fglock | putter: thanks! | ||
gaal | between A B C | ||
in this case A == (symbol "{") | 18:23 | ||
B == (sumbol "}") | |||
and C is the rest of the function | |||
kolibrie | so we are defining the beginning and ending of the input we are examining, and then looking at the stuff in between | ||
gaal | inded. this demonstrates something nice about parsec, which is how you can compose rules out of simpler ones | ||
putter | two random sidebar thoughts: with custom re, it should be possible to do <subrules> in normal p5 regexps. calling out to qr returning subs. so full grammars. they wouldn't capture, and their implementations are constrained, but hey. | 18:24 | |
random other thought: do each p5 thread get its own regexp engine? if so, one could hack around non-reentrancy. ;) | |||
gaal | kolibrie: if for some reason the opening part of the syntactic rule we wer parsing were much more complex than "{", we could have called a named function that parses for it | ||
putter | but those are both fish for another fry. | ||
gaal | in fact, we already do that -- 'symbol "{"' is a function call too! | 18:25 | |
kolibrie | ok | ||
gaal | symbol is a function inside parsec | ||
now lets zoom up for a second and see who called us | 18:26 | ||
bsb | putter,I have someting for you www.perlmonks.org/index.pl?node_id=531465 | ||
gaal | (since we are a reusable function, maybe more than one guy does) | ||
bsb | although it's probably too late | ||
gaal | but no! just ruleHashSubscript does :) | ||
however ruleHashSubscript can be called from several places :-) | 18:27 | ||
fglock | putter: would you take a look in iterator_engine_p6regex.pl later? | ||
gaal | kolibrie: one of them is for example qInterpolatorPostTerm | ||
kolibrie | gaal: and the 'choice' in ruleHashSubscript is like 'any' | 18:28 | |
gaal | which is what's responsible for "this is a stirng containing %myhash{'moose'} interpolated in it!" | ||
kolibrie: yes | |||
it tries to parse with the first rule, and if that fails, it backtracks and tries the next one in the list of choices | 18:29 | ||
kolibrie | and we have several of those in qInterpolatorPostTerm | ||
gaal | "option" is similar to choice -- it means "try mathching with this rule. but if you don't succeed, that's okay too" | ||
oh indeed | 18:30 | ||
they are tried in order - which can be significant of coures | |||
kolibrie | so in 'choice', a match must occur, and 'option' means it could be there | 18:31 | |
gaal | yes. option x is like choice [x, nothingAtAll] | 18:32 | |
kolibrie | ok | ||
gaal | of course, if a rule did match, it consumes its input | ||
kolibrie | and if it fails, it returns to where it left off and tries the next item | 18:33 | |
gaal | so on the consumption direction, what we have is lots of rules that eat up the input, occasionally backtracking a bit and trying a different route... | ||
putter | bsb: ooo, neat :) | 18:34 | |
gaal | if the failure goes all the way up and there's no way to parse, the user gets an error | ||
putter | bsb++ | ||
kolibrie | right | ||
gaal | usually it goes three steps in, two steps out, and so on, until everything is consumed | ||
(for some values of two and three) | |||
so actually ordering the rules cleverly can have impact on preformance... but nevre mind that :) | 18:35 | ||
but i was saying | |||
putter | have to think about that. but first, the new regex engine. the case for using a flexible parser for OnPerl5 is a lot stronger if one actually exists. ;) | ||
gaal | this is the consumption direction. what do we want out of the parser? | 18:36 | |
putter | very neat | ||
gaal | we want a tree structure: AST, or parse tree | ||
kolibrie | verily | ||
putter | fglock: looking... | ||
gaal | let's digress for a sec and see an example of that | ||
kolibrie follows gaal's digression | 18:37 | ||
gaal | run this please: | 18:38 | |
./pugs -CParse-YAML -e 'if 42 { say "hi" } else { say "oops" }' | |||
pipe it through less :) | |||
and ignore completely the hs/MkPad bit | 18:39 | ||
kolibrie sees nifty YAML | |||
gaal | jump straight to hs/Stmts | ||
line 22 | |||
svnbot6 | r9095 | fglock++ | iterator_engine_p6regex.pl - rule::capturing_group hack | ||
kolibrie | gaal: I see that at the very top, I think | 18:41 | |
gaal | intuitively we know we ought to have an if with the true case code under it, and the else case code under it also | ||
18:41
elmex joined
|
|||
gaal | kolibrie: you don't see !hs/MkPad and then !hs/Map? that's... a bug :) | 18:41 | |
kolibrie | oh well, I'm a few revisions behind | 18:42 | |
should I play on feather? | |||
gaal | okay, cool | ||
no no | |||
yours is the info we need now | |||
so | |||
from hs/Stmts | |||
audreyt | macro use_ok ($module) is export { | 18:43 | |
gaal | (hs/ is a serialization detail, ignore it now) Stmts | ||
audreyt | require $module :COMPILING; | ||
KEEP { return CODE { &OUR::proclaim(1) } } | |||
UNDO { return CODE { &OUR::proclaim(0) } } | |||
gaal | ooooh multiplexing | ||
audreyt | } | ||
# weird implementation of use_ok | |||
putter | fglock: same suggestion as before I think: get set up to do testing. two reasons - the domain is complex enough to forget about screw cases which constitute constraints on large-scale architecture; and two, performance really matters on this, and so also constitutes an architectural constraint. the easiest way to deal with both is to run tests... | ||
gaal | kolibrie: so, we have a satement list | ||
the first statement is a Syn | 18:44 | ||
of type if | |||
kolibrie follows along | |||
gaal | the if has a condition, a true-case, and an else-case | ||
fglock | putter: right | ||
gaal | the condition in this case is a very simple expression - just a value | 18:45 | |
putter | random other thoughts if you'd like them. rule::foo might be better rule__foo or foo__rule (easier to attach) so the normal package inheritance works with them. | ||
gaal | but it could have been more complex, that is more deedp | ||
putter | grammars for free :) | ||
kolibrie | gaal: so that gets us to the 42 | 18:46 | |
gaal | if you look at the true-case, you see (among the noise) some stuff which is certianly the AST for 'say "hi"' | ||
but it's easier to put this data aside for a minute and look at what _can_ come in the tree | |||
kolibrie | oh, way down there | ||
gaal | please go to Pugs.AST.Internals | 18:47 | |
line 946 | |||
data Exp | |||
kolibrie moves to other file | |||
putter | fglock: alternation is first match (not longest). though we need a separate longest match for tokens. | 18:48 | |
kolibrie arrives at line 946 | 18:49 | ||
putter follows kolibrie | |||
gaal | kolibrie: okay, this is the succinct definition of a Pugs AST node | ||
it's a recursive definition, so anything from a lowliest value to a complete program can be expressed with it | 18:50 | ||
side by side with the YAML dump - | |||
fglock | putter: ok | ||
gaal | we had "if 42" | ||
the 42 is a | |||
well, not lowly | |||
but it's just a value | 18:51 | ||
so line 957 | |||
kolibrie sees it | |||
gaal | one of the variants in Exp is Val | ||
and this is indeed what we have in the yaml: | |||
putter runs off to code.. | 18:52 | ||
gaal | - !hs/Val : - !hs/VInt : - 42 | ||
if you excuse my ad-hoc yaml onelinerization | |||
which is bogus | |||
but anyway | 18:53 | ||
kolibrie | I understood it | ||
gaal | the condition happens to be a Val (which is a *kind* of Exp) | ||
do you know enough haskell to understand the type of the Val variant? | 18:54 | ||
it's a little confusing: | |||
kolibrie thinks not | |||
gaal | there's a type called Val, which doesn't immediately have anything to do with the variant Val - it's a pun | 18:55 | |
we could have renamed this to something like this: | |||
data Value = .... | |||
data Exp = .. .. | ValNode Value | 18:56 | ||
ValNode is a constructor | |||
it takes a Value, and returns and Exp | |||
kolibrie | type has to do with what kind of data is held? and variant? | ||
gaal | data types in haskell are a like unions in c | 18:57 | |
a thing of type Exp is actually | |||
kolibrie never did c :( | |||
gaal | either a ValNode | ||
or a FunctionApplication | |||
or a SyntaxThingie | 18:58 | ||
but a function can be polymorphic and accept any kind of Expat all | |||
audreyt | hm, I really want :$foo now | ||
gaal | kolibrie: am I making any sense? :) | 18:59 | |
kolibrie | so a Value is something simple, and an Exp may be made of multiple things | ||
gaal | yes, Value is a final kind of ting, say a number or a string | 19:00 | |
but a FunctionApplication is a more complex thing | 19:01 | ||
it needs to contain who's the function that's being called and what its arguments are | |||
but they're both expressions | |||
putter | puns in code -- | 19:02 | |
gaal | so in the Exp data structure we indeed see this | ||
instead of FunctionApplication it's spelled App | |||
and it goes like this: | |||
App Exp (Maybe Exp) [Exp] | |||
WeAreApplyingAFunction Name (it might have an invocant) [arglist] | 19:03 | ||
say "moose" | |||
App "&say" Nothing [ (Val (VStr "Moose")) ] | 19:04 | ||
see the correspondence? | |||
kolibrie catches up after an interruption | 19:05 | ||
gaal | nothing just means this is a function call, not a method invocation | ||
putter | (for extra credit, ;) someone should capture gaal's exposition to help other people spin up...) | 19:06 | |
19:06
justatheory joined
|
|||
gaal | putter: it will be slidified and incorporated in my coming osdc talk. I really have to thank kolibrie for nudging me about this so soon :-) | 19:06 | |
kattana_ spins | |||
19:07
kattana_ is now known as Kattana
|
|||
putter | or at least drop a link to the irc log in someplace. wish we had done that with some of audreyt's old expositions, now buried in the log... | 19:07 | |
kolibrie thanks kolibrie for helping him, too | |||
I mean, gaal | |||
putter | :) | ||
gaal | kolibrie: so, I mentioned a method invocation | 19:08 | |
let's spell it in that style: | |||
"moose".say | |||
audreyt | oh well, instead of moosing around I'll just go implement $:foo | ||
gaal | that parses as | ||
App "&say" (Just (Val (VStr "moose"))) [] | 19:09 | ||
it happens to mean the same ultimately, but the parse tree is different as you can see | |||
kolibrie | the one is called with a Val | ||
gaal | there are no args, but the invocant is a the moose | 19:10 | |
kolibrie | the other is invoked from a Val | ||
gaal | yes | ||
note the [] at the end of the second AST | |||
kolibrie | indicating no args | ||
gaal | indeed. | ||
Just and Nothing, btw, are haskellish things | 19:11 | ||
kolibrie | Nothing kind of makes sense, Just is a little harder | ||
gaal | nevre mind the details, but Nothing is like a... null pointer | 19:12 | |
just means "it's not a null pointer, it's a..." | |||
it looks tiresome, but it's actually useful, because you can' have Just Nothing | |||
nothing and something can be distinguished in places that care about them | 19:13 | ||
putter tries to remember what $:foo is... finds ':' hasnt reached the twigle table in S02... | |||
kolibrie | couldn't that just be Nothing, without the Just? | ||
gaal | yes, the type is called Maybe (look in the code again) | 19:14 | |
kolibrie | oh, 'Just' means 'something' | ||
audreyt | putter: :$foo, sorry | ||
not $:foo | |||
typo | 19:15 | ||
putter | ahhhhh | ||
;) | |||
audreyt | (and I've got it implemented) | ||
gaal | (Maybe Exp) can be an Exp | ||
and code that handles that type know it can be Nothing | |||
putter | re Just/Nothing, think data field with a one bit flag indicating whether the data field is valid. invalid gets presented as "Nothing". valid as "Just(whatever)". | ||
gaal | if they ignore the possibility and just look at the Exp, they get a compiler error :-) | ||
well, in some cases, a warning | 19:16 | ||
kolibrie | so Maybe indicates the value may be defined or undefined | ||
gaal | but you can in fact write your code knowing that you are liable to forget to check for null pointers occasionally, and and then it won't compile until you remember. or something | 19:17 | |
putter | Maybe Foo is just the way of declaring this a data field of type Foo, plus this bit. re def/undef, yes | ||
gaal | kolibrie: for our purposes, "an optional invocant" is good enough | ||
kolibrie | ok | ||
gaal | but the Maybe type has good implications on code quality, so don't purge it from your consciousness | 19:18 | |
svnbot6 | r9096 | fglock++ | iterator_engine_p6regex.pl - tests with Test::More - putter++ | ||
gaal | sooo where were we | 19:19 | |
kolibrie | Pugs/AST/Internals.hs shows a grammar of sorts? | ||
gaal | ah yes | ||
which was because, like we saw, the various functions in Parser all return... an Exp ! | 19:20 | ||
kolibrie | ahh | ||
and we define what Exp is | 19:21 | ||
gaal | so now we can tie up the "combinator" part of the description we gave to Parsec | ||
each funciton *is* a parser | |||
typically a small one | |||
kolibrie | and that is in Pugs/Parser.hs | 19:22 | |
gaal | if you ever write a language of your own, and you need in part of it to parse { ...smthing... } | 19:23 | |
you can reuse our code! :-) | |||
ruleHashSubscriptBraces *is* a parser that tries to match a hash subscripted with braces | 19:24 | ||
and returns the AST for it | |||
whoever called us uses us and expects an AST back, or failure | |||
if the failure happened inside a "choice", parsec silently tries the next option | 19:25 | ||
19:25
marmic joined
|
|||
gaal | if not, eventually that may fail the entire parse, like we said earlier | 19:25 | |
kolibrie | so the AST is defined in Pugs/AST/Internals.hs, and the mini parsers in Pugs/Parser.hs | 19:26 | |
svnbot6 | r9097 | audreyt++ | * Implement :$foo in its various capacities as shorthand for (foo=>$foo): | ||
r9097 | audreyt++ | :$var.kv; # pair object | |||
r9097 | audreyt++ | function(:$foo); # named arg | |||
r9097 | audreyt++ | m:$nth/.../; # adverb | |||
r9097 | audreyt++ | * :$.property and :$Fully::Qualified::name both work; the latter is | |||
r9097 | audreyt++ | desugared with "name" as the key. | |||
gaal | ok, now actually i lied | 19:27 | |
this particular parser doesn't return an AST | |||
it returns an AST transformer | |||
which is less scary than it sounds :-) | |||
btw the others here are losing connectivity | |||
so sorry if i drop | |||
heh, they seem to have it back :-) | |||
kolibrie | (connectivity)++ | ||
kolibrie wonders if connectivity at the hackathon has truly been interrupted | 19:31 | ||
gaal | if you scan the signatures in Parser you see more simple ones too | ||
do grep '^.*::' on that file to see all its sigs | 19:32 | ||
(sec) | |||
back | |||
for example ruleRuleDeclaration is one of those simplier-typed parsers | |||
it does return some kind of AST node | 19:33 | ||
you can tell because it has the type | |||
ruleRuleDeclaration :: RuleParser Exp | |||
the RuleParser part is the monad stuff (which we're still in denial of) | |||
bottom line, you have an Exp | |||
kolibrie | ok | 19:34 | |
gaal | in our ruleHashSubscriptBraces, you have (Exp -> Exp) | ||
putter | audreyt++ # dynamic pairs! | ||
19:34
sili joined
|
|||
gaal | which means it returns that takes one Exp and yields another | 19:34 | |
which is precisely what I mean by "Exp transformer" | 19:35 | ||
kolibrie | ah | ||
gaal | like if you had a function that doubles its integer input, you'd call it "double", but more genreally you'd say it's an integer transformer | ||
okay, why would we need that? | 19:36 | ||
here, that is? | |||
rep | support.microsoft.com/kb/314458/EN-US/ | ||
19:37
bernhard joined
|
|||
kolibrie | we want to know whether we are interested in the hash, or the value in the key | 19:37 | |
svnbot6 | r9098 | fglock++ | iterator_engine_p6regex.pl - added many tests | ||
putter wonders if there is a timing/pacing to exposition which would allow it to be mechanically recognized in the irc log... | |||
gaal | well, if this rule succeeded, we *do* have a subscirpt | ||
kolibrie | so we may have to change the AST to point to the correct value | 19:38 | |
gaal | we want to let our caller do some AST munging | ||
so we give them a closure that does it in the proper way! | |||
ruleHashSubscriptBraces A B C | 19:39 | ||
ruleHashSubscriptBraces open close middleBit | |||
oops | |||
between A B C | |||
Kattana | putter: the bantar back and forth seems to have a certain tone to it, gaal obviouly leading the convo, lots of vertical spam from him | ||
gaal | lumi++ | ||
putter | ok... so what grammars for p5 or p6 regexp do folks know of...? putter is boiling up a stew... | ||
gaal | (online copyediting) | ||
between A B C | 19:40 | ||
C's the interesting but | |||
in this case it's | |||
option id $ do | |||
exp <- ruleExpression; return $ \x -> Syn "{}" [x, exp] | |||
which means: | |||
option FALLBACK RULE | |||
if RULE fails, return FALLBACK | |||
"id" is the identity function | 19:41 | ||
in Perl 6: sub ($x) { $x } | |||
audreyt | in Perl 6: {$^x} | 19:42 | |
gaal | so that's like a transformer that... doesn't transform much :) | ||
audreyt: :) | |||
kolibrie | which part is the FALLBACK, and which the RULE? | 19:43 | |
gaal | when would that happen? | ||
as in the order I gave | |||
option (fallback: id) (rule: the rest) | |||
the rest in this case is: | 19:44 | ||
svnbot6 | r9099 | audreyt++ | * Test.pm: Change :depends($depends) and :todo($todo) etc to | ||
r9099 | audreyt++ | :$depends and :$todo etc. | |||
kolibrie | if RULE succeeds, return the 'return' part | ||
gaal | exp <- ruleExpression | ||
return $ \x -> Syn "{}" [x, exp] | |||
ignoring monads again - the first line means we're going to do a ruleExpression | 19:45 | ||
kolibrie | the 'return' part is the rule? | 19:46 | |
gaal | that's a pretty general parser that looks for SOME kind of expression | ||
elmex | elmex-- | ||
gaal | no, they're both part of the rule | ||
they both _are_ the rule | |||
kolibrie sighs | |||
lumi | ruleExpression is the name of a parser that parses, curiously enough, an expression; we're tryign to match it, and if it matches, "exp" will have its return | 19:47 | |
gaal | ... and if it doesn't, the current twoline parser will.. fail | ||
meaning the "option" will return "id" | |||
kolibrie | so part of this particular rule is to call a parser called ruleExpression | 19:48 | |
lumi | Yep, and save its return | ||
kolibrie | whose return value will go into exp | ||
gaal | but if exp does get bound successfully to some expression, we (and our whole function) result in | ||
\x -> Syn "{}" [x, exp] | |||
which is haskell for | |||
p5: sub { Syn "{}" [ $_[0], exp } | 19:49 | ||
well, for some value of p5 | |||
svnbot6 | r9100 | fglock++ | iterator_engine_p6regex.pl - implemented non-capturing group | 19:50 | |
putter | misc/Grammars/rx_grammar.pl, the prolog engine, parrot's compilers/pge/P6Rule.grammar and pge/PGE/*.pir, src/Text/Parser/Rule.hs, ... am I forgetting anything? | ||
gaal | the idea is we return a closure that takes SOME x, and wraps it in a Syn node | ||
kolibrie | so 'x' is what got passed to us, the original Exp | 19:51 | |
gaal | what's the type of x? | ||
exactly: and there are two ways to deduce that | |||
one is our type: | |||
(Exp -> Exp) | |||
we know we return a function that gets an Exp and returns one | 19:52 | ||
Kattana has not had trouble following whats going on but not knowing haskell makes the details of what is happening unclear | |||
gaal | btw: if we were successful, we even know that the resulting Exp is in fact a Syn | ||
19:52
nothingmuch joined
|
|||
gaal | but we can't say we're Exp -> Syn, beucase in the case that we fail, we return id | 19:53 | |
kolibrie | oh, so given Exp 'x', we create a Syn "{}" | ||
gaal | and our poor caller may hand the closure we gave him any Exp at all | 19:54 | |
exactly | |||
kolibrie | and the [x, exp]? | ||
gaal | the other way we can reason that x must be an x is how we are using it inside the closure: | ||
putter | Kattana: if you hang microphones on people, you can tell all sorts of stuff about group dynamics, just by looking at the strip chart of who is talking when... :) | 19:55 | |
gaal | the haskell expression Syn "{}" [x, exp] | ||
(look at AST.Internals again) | |||
is a "constructor" for Exp | |||
fglock | putter: looking (I'm writing the grammar using A05) | ||
gaal | it is Syn String [Exp] | 19:56 | |
that is: | |||
it takes a string | |||
and a list of Exp | |||
.... and returns an Exp of the Syntax variant | |||
which, if you are familiar with haskell type signature, looks like | 19:57 | ||
Syn :: String -> [Exp] -> Exp | |||
kolibrie | the string is "{}" and the list of Exp is [x, exp] | ||
gaal | exactly! | 19:58 | |
in our closure, we can't know much more about x | |||
there is one more detail | |||
how can this possibly fail? | |||
well, one way is that there's a totally bogus expression in between the braces | 19:59 | ||
%myhash{this can't parse, can it?} | |||
kolibrie | so then the ruleExpression fails? | 20:00 | |
gaal | sure, but eventually that means the whole program will fail parse | 20:01 | |
kolibrie | so ruleExpression is very generic | ||
gaal | because in THAT case, we will not have consumed our input till after the braces, and eventually the parse error will propagate up. | 20:02 | |
when can this option do the fail case legitiamately? | 20:03 | ||
in the empty case: | |||
%myhash{} | |||
putter | fglock: might be better or using P6Rule.grammar | 20:04 | |
kolibrie | oops! I have a meeting at work. Be back in 30 min? | ||
gaal | sure | ||
audreyt | eg. print "The associations are:\n%bar<>" | ||
putter | s/or/off | ||
audreyt | (that's subtlte for the realspace soundtrack from lwall) | 20:05 | |
Juerd | audreyt: Great that you got your .de visa; I'm looking forward to meeting you again. | 20:06 | |
audreyt | Juerd: woot | 20:10 | |
Juerd | The only thing I have to bribe dieties for still is my car. A repair attempt is done tomorrow; if it fails, I'll have to fix a plan B. | 20:11 | |
deities. | |||
More correct and more symmetrical :) | 20:12 | ||
20:13
sili joined
|
|||
svnbot6 | r9101 | fglock++ | iterator_engine_p6regex.pl - alternation (not working yet) | 20:13 | |
gaal | a2 | 20:20 | |
kolibrie returns | 20:22 | ||
gaal | hello | ||
soo | |||
just to sum up the parse options: | 20:23 | ||
putter | audreyt: re hackathon plan... imports! :) | ||
gaal | either we have %myhash{42} | ||
or actually, %myhash{ $a + $b ~ "abcde" } | |||
(these are all %myhash{ some Expression } | 20:24 | ||
) | |||
OR | |||
kolibrie | right | ||
gaal | we can have %myhash{} | ||
kolibrie | then Exp is Nothing | ||
gaal | which as larry explains, is useful in interpolations where you want the whole hash: | 20:25 | |
"myhash is %myhash{}" | |||
(because you can no longer say "%myhash" in a string and have it interpolate) | |||
no, not Nothing | |||
if the line | 20:26 | ||
exp <- ruleExpression | |||
then the whole twoliner action " exp <- ruleExpression ; return .... " fails | |||
a bit like an exception | |||
and that's when "option" will fall back on "id" | 20:27 | ||
(um, if that line _fails_ then the action fails) | |||
kolibrie | so, if there is no value between the braces, the ruleExpression fails, so the RULE fails, and FALLBACK is returnd | 20:28 | |
gaal | yes: but the function ruleHashSubscriptBraces as a whole succeeds | 20:30 | |
svnbot6 | r9102 | fglock++ | iterator_engine_p6regex.pl - reimplementing using P6Rule.grammar | ||
kolibrie | yes | ||
and if no braces follow %myhash, then ruleHashSubscriptBraces fails | |||
gaal | the only way ruleHashSubscriptBraces can fail is if some | ||
exactly :)_ | |||
kolibrie almost feels like he understands | 20:31 | ||
gaal | cool | ||
20:31
justatheory joined
|
|||
audreyt | ?eval | 20:32 | |
evalbot_9084 | No code to eval given. | ||
audreyt | ?eval 1 | ||
evalbot_9084 | 1 | ||
gaal | so | 20:33 | |
whoever called us will get one of three cases | |||
either a Syn {} wrapper closure | 20:34 | ||
or a noopish transformer | |||
or failure | |||
if failure, then our caller can either deal with it (via a "choice" or something similar, which expects it), | 20:35 | ||
or *they* will fail as well. | |||
svnbot6 | r9103 | audreyt++ | * Makefile.PL: | ||
r9103 | audreyt++ | * don't build readline on GHC 6.4.0 as Linux doesn't like it, | |||
r9103 | audreyt++ | as reported (again) by anatolyv. | |||
r9103 | audreyt++ | * Parrot has changed the build_dir key to top_builddir for | |||
r9103 | audreyt++ | autoconf compatibility; chase it in our parrot probe code. | |||
r9103 | audreyt++ | Reported by lwall. | |||
kolibrie | a noopish transformer is when the id is returned? | ||
gaal | yes. in simpler rules, typically the return value is an AST node | 20:36 | |
we saw an example of that, but didn't analyze it very thoroughly | |||
Juerd | audreyt: Is PID 23877 on feather doing something useful, or in some kind of infinite loop? | ||
20:36
calanya joined
|
|||
gaal | you can indentify what it returns by looking at the function sig | 20:37 | |
in Pugs, all our top-level functions have signatures | |||
(that's not required by haskell, but it's considered good form) | |||
audreyt | ?eval sub f (:$x is copy) { $x ?? $x-- * f(:$x) !! 1 } f(:x(10)) | 20:38 | |
evalbot_9084 | Error: unexpected "f" expecting term not a class name or Only one invocant allowed | ||
kolibrie | and helps newbies | ||
audreyt | Juerd: the latter; it's now dead. | ||
gaal | it helps everyone, because you can quickly scan the whole project for things that behave in certain ways | 20:39 | |
Juerd | audreyt: Okay, thanks | ||
gaal | there's an in credibly useful tool for haskell hackers called hoogle | ||
haskell.org/hoogle/ | |||
try it out: say "a -> [a]" there | |||
kolibrie tries | 20:40 | ||
gaal | it gives you standard haskell funcs that take something of type a and yield a list of elements of that type | ||
the topmost hit is "repeat" | 20:41 | ||
reapeat 5 = [5, 5, 5, 5, 5, 5, .....] | |||
Juerd | repeat sounds like exactly the right name for such a function | ||
gaal | the others hits are less exact matches, for good reasons that will become clear after some haskell hacking :) | 20:42 | |
audreyt | unlike, say, onAndOnAndOn | ||
gaal | banana | ||
kolibrie | how does the AST know when to be flat, and when have more depth? | 20:43 | |
anatolyv | or InfiniteListOfEntitiesAllCopiesOfTheSameArgument | ||
gaal | if you look for "a -> Int -> [a]", you'll see it first gave you something of type "Int -> a -> [a]" | ||
replicate, which is defined as \n x -> drop n (infiniteListOfEntitiesAllCopiesOfTheSameArgument x) | 20:44 | ||
Juerd | audreyt: onAndOnAndOn is too finite :) Hm, does Haskell have infinite identifiers? :) | ||
gaal | Juerd: it does if you use DrIFT | 20:45 | |
Juerd | That's just scary | ||
gaal | also not true | ||
I was just pulling your moose | |||
nothingmuch | a -> Int -> [a] is just take . repeat | ||
audreyt | ?eval 1 | ||
20:45
evalbot_9084 is now known as evalbot_9086
|
|||
evalbot_9086 | 1 | 20:45 | |
gaal | errr, yes, take, not drop | ||
thank you nothingmuch | |||
but I was avoiding pointfree style for exposition value | 20:46 | ||
nothingmuch | we need a flip somewhere | ||
audreyt | ?eval sub f (:$x is copy) { $x ?? $x-- * f(:$x) !! 1 } f(:x(10)) | ||
20:46
evalbot_9086 is now known as evalbot_9103
|
|||
evalbot_9103 | 3628800 | 20:46 | |
gaal | kolibrie: as you can see sometimes it's almost obvious what a function does just by looking at its sig | 20:47 | |
nothingmuch | flip $ (flip take) . repeat | ||
kolibrie | gaal: almost obvious | ||
gaal | nothingmuch: "somewhere"? forM = flip mapM | 20:48 | |
clkao | did someone fix the smoke-think-its-release problem? | ||
nothingmuch | gaal: ? | ||
audreyt | clkao: I wasn't aware of that | ||
clkao | see the smoke report, first entry. | ||
i smoked that last night with trunk, but it thinkgs itself as a relesae | |||
gaal | I was kidding :) | ||
anymoose: | |||
putter | fglock: just don't believe everything you read in P6Rule.grammar... | ||
gaal | so now you know how much of parsec works! | 20:49 | |
kolibrie | truly | ||
gaal | there's also operators, and this whole monad side to it which we haven't talked about | ||
fglock | putter: oh, ok :) | ||
gaal | but this is enough to see how pugs parses something | ||
audreyt | clkao: hmm -- I'm out of tuits now maybe se if nothingmuch or gaal or other hackathoners can help | ||
kolibrie | if I want to try it out, a 'hello world' sized one, what do I need? | ||
gaal | there's also the tool -CParse-YAML that you can see the result of the parse with | 20:50 | |
clkao | audreyt: what are you hacking on atm? | ||
gaal | kolibrie: you mean you want a standalone parser for your own minilang? | ||
audreyt | clkao: sundry and various | ||
gaal | parseTest can help with that | 20:51 | |
kolibrie | gaal: something like that, so I can make sure I understand | ||
audreyt | clkao: svn.openfoundry.org/pugs/misc/pX/au...athon-plan | ||
I'll probably journal about what's being done here on tomorrow morning; if I do it now it'll be overlapping, incoherent and undecidable | 20:52 | ||
clkao | Should "Perl 5 as a runtime" have a name - surely pXnie! | ||
obra | clkao: stallion | ||
audreyt | why is everybody fixated over the p.nie bitmask? | ||
clkao | because it looks like PIE? | 20:53 | |
obra | because it's punny | ||
gaal | kolibrie: www.cs.uu.nl/~daan/download/parsec/parsec.html and look for parseTest on that page | ||
kolibrie: I have to go now, we can continue tomorrow :-) | 20:54 | ||
kolibrie | gaal: thank you very much | 20:55 | |
clkao | audreyt: what do you have in mind for the JS.pm entry in javascript? | ||
btw there's js::pp and js::code | |||
kolibrie | gaal: I'll play with this a little bit and probably have more questions tomorrow | ||
clkao | hmm json-based seperate compilation.. doesn't the compiler has be compiled into js? | 20:57 | |
gaal | kolibrie: np :) | ||
clkao | i need a braindump from someone i guess. | 20:58 | |
Juerd | obra: Oh, Stallion's harsh :) | 20:59 | |
obra: Funny, though | |||
21:10
hexmode joined
21:11
calanya left
|
|||
putter ponders the consequences of the the character-class-sublanguage engine assuming some rule correctly/non-buggily matches a single character... and being wrong. | 21:15 | ||
svnbot6 | r9104 | fglock++ | iterator_engine_p6regex.pl - implemented '<term>*' - documented bugs | 21:16 | |
fglock | putter: current plan is to finish a minimal compiler that can read P6Rule.grammar; then maybe improve the emitter so it can be tested | 21:20 | |
putter | fglock: neat | 21:24 | |
testability++ | 21:25 | ||
21:25
larsen joined
|
|||
svnbot6 | r9105 | fglock++ | iterator_engine_p6regex.pl - warnings cleanup | 21:31 | |
21:32
KingDiamond joined,
fglock left
21:37
r0nny joined
21:54
SamB joined
22:34
rafl joined
22:42
penk left
22:53
Lord-Dark joined
|
|||
Lord-Dark | 8,2Lalalallalaa | 22:54 | |
8,2Je Parle | |||
22:59
Lord-Dark left
23:11
avar joined
23:21
rantanplan_ joined
|