»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
adu I have a question, what is the purpose of "outerctx"? 00:27
github.com/perl6/nqp/blob/master/s...r.nqp#L219
jnthn Part of the mechanism for attaching the outer lexical context (the setting for scripts/modules, and the appropriate lexical scope for EVAL) 00:28
Actions.pm has the more interesting bits 00:29
adu jnthn: I'm trying to write a parser for NQP in something other than NQP 00:38
I'm finding it rather difficult 00:39
ugexe m: class X { multi MAIN("test") is export {"test"}; multi MAIN("test",@more) is export {"test2"}; }; import X; say "hello"; MAIN("test"); say "world"; 00:45
camelia rakudo-moar 795a32: OUTPUT«hello␤world␤Usage:␤ /tmp/akr1TtchJu test ␤ /tmp/akr1TtchJu test <more> ␤»
ugexe why does the Usage message get printed at the end instead of calling &MAIN or printing the Usage before "hello" "world"?
i understand &MAIN_HELPER is called at the precomp stage, but im not exactly sure what i should extrapolate from that 00:47
jnthn ugexe: A MAIN it called automatically, at the end of the mainline. So the mainline runs, then it calls MAIN, and since there are no command line args passed for the evalbot then you get the usage printed. 00:48
jnthn ugexe: Your own call to it likely worked out fine, but the idea is that MAIN is called automatically with @*ARGS, not that you call it yourself. 00:48
adu: I'm not entirely surprised. :) Though NQP is a good bit more tractable than full-blown Perl 6. 00:50
adu: There's a reason the two times I ported NQP, I ported the code-gen and then got it to cross-compile itself, so I didn't have to port the grammar and so on. :)
adu lol 00:51
jnthn: also, perl6-j is quite speedy, good job! 00:59
psch it is..? 01:00
i guess i'm not running enough long-running programs with it
adu psch: yes, it executes my C11 parser in less than 10 seconds, perl6-p executes the same program in under 5 minutes...
psch adu: did you try it on moar yet? 01:01
adu psch: yeah, perl6-m runs it in about 5 seconds
maybe I should do some more testing and put some benchmarks on my blog or something 01:02
adu jnthn: have you heard of Graal/Truffle? 01:03
psch 5 sec moar vs 10 sec jvm sounds suspiciously consistent with my own experience
as in, stage parse while building rakudo also has 100% longer runtime on jvm than moar for me 01:04
looking at benchmarks is probably more reasonable though
adu psch: it's still much nicer than 1000x longer
psch adu: right, i'm not saying it's slow. i might just be a bit miffed with building on jvm for the interop stuff i'm working on :) 01:05
adu psch: what are you working on? 01:05
psch adu: i'm working on mmd for overloaded constructs when instantiating java classes in perl6 01:06
currently we have to call them with a non-jvm-spec compliant method descriptor, e.g. "constructor/new/(I)V" for a constructor that takes an int
adu mmd? 01:07
multimonitor display?
psch but we of course would like to be able to call &.new
multi-method dispatch
adu oh
psch i've described mmd for methods in the day 12 of perl6advent 01:08
adu I thought JVM added invokedynamic in 1.7 for that
psch well, yes
we're also already using invokedynamic for a few things
but nobody had implemented it yet for interop
or rather, it wasn't user friendly 01:09
adu psch: have you heard of Graal/Truffle? 01:11
jnthn adu: Yeah, I read a paper on Graal/Truffle a few weeks back. Interesting work.
adu every word reminded me of HLL::Grammar and NQP, and Parrot, ...
also: www.slideshare.net/ThomasWuerthinge...ethdec2013 01:12
provides a nice overview 01:13
RSX-11M is it possible "file".IO.lines but with "\n" preserved ? 01:36
jnthn Maybe open("file", :!chomp).lines 01:39
psch m: my @lines-with-break = slurp.comb: /<-[\x0a]>+.<after "\n">/; say @lines-with-break[0] # this'd work 01:42
camelia rakudo-moar 795a32: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤␤» 01:42
psch note two ␤ at the end
although opening it correctly is probably cleaner
jnthn psch: That's...probably also not going to be so fast ;)
psch jnthn: right, it's probably not. i'm thoroughly in "make it work"-mode :) 01:43
psch m: open($*IN, :!chomp).lines[0].say 01:45
camelia rakudo-moar 795a32: OUTPUT«open is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:1␤ in sub open at src/RESTRICTED.setting:5␤ in block <unit> at /tmp/NWTbQt8Ve2:1␤␤»
psch oh right
psch m: slurp().split(/.<(<after "\n">/)[0].say # not sure if this would be faster... 01:47
camelia rakudo-moar 795a32: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤␤»
psch probably not, i'm thinking the lookaround is the slowest bit
jnthn Also slurp can't be lazy, so if it's a big file... :) 01:48
dylanwh camelia speaks irish? 02:00
jnthn speaks zzzz & 02:07
psch 'nite jnthn 02:08
timotimo twitter.com/raocl/status/543959294790488064 - would be glad if someone could reproduce and assist (ideally on twitter as well as irc) 03:10
hagiri TimToady, o/ 03:14
=)
hello all!
;D
psch timotimo: works fine here, This is perl6 version 2014.11-79-g1eb7fad built on MoarVM version 2014.11-66-g23f2089 03:17
timotimo: i don't have a twitter though
i've used the exact script but with the url replaced with heise.de
dj_goku I get the same error if I use REPL but if I put it in a script it runs fine. 03:30
psch huh 03:32
i tried it with -e and got a malloc() error 03:33
$ perl6 -MHTTP::UserAgent -e'$ua = HTTP::UserAgent.new; @a = "heise.de" xx 3; @a.map: { start { $ua.get($_) } }; .contents.say for await @a'
*** Error in `/home/psch/rakudo/install/bin/moar': malloc(): smallbin double linked list corrupted: 0x0c147850 ***
rerunning it hangs... 03:34
leedo_ it works most of the time here. but i got a segfault once 03:38
hmm and now
moar(99704,0x1054c1000) malloc: *** error for object 0x7fce2f5721f0: double free
leedo_ well, here are all the various errors that script triggers for me on moar on OS X 03:45
gist.github.com/leedo/3b11d47c9f7c4db330dc
psch leedo_: that's all with one UA instance?
leedo_ psch: yeah
leedo_ although i can trigger most of those errors with a UA per promise 03:51
pyrimidine Ulti: any updates on the advent post? Haven't seen anything yet... 04:23
psch sleeps & 04:41
adu who maintains www.perlfoundation.org/perl6/index....dex_tablet ? 06:08
"as" and "of" have the same definition, what's the difference? 06:09
moritz adu: nobody maintains it; that'S th eproblem 06:34
adu oh
moritz adu: tablets.perl6.org/ seems to be the maintained (ish) version 06:41
adu tablets.perl6.org/tablet-7-subroutines.html 06:42
ish
moritz though I don't quite understand th emotivation for listing stuff without explaining it 06:43
hence doc.perl6.org (which is also incomplete, though) 06:44
raydiak mayhaps we need an (admittedly very long at first) organized list of work to be done on the docs 07:49
raydiak or a tool to give an overview of the doc coverage of the public api at least by line count or something, per routine, class, etc (especially higlighting the items which have 0) 07:53
(unless that turns out to be an inappropriately laborious undertaking) 07:55
raydiak notices github.com/perl6/doc/blob/master/WANTED 07:56
dalek ast: 2252f8b | usev6++ | S12-meta/primitives.t:
Fudge 6 tests for JVM (todo); skip all tests for Parrot
08:29
brrt \o 09:38
how is it with the perl6 advent calendar? is there still a spot free next week? 09:39
masak brrt: we've got an opening on Wednesday: github.com/perl6/mu/blob/master/mi...4/schedule 10:28
(antenoon, #perl6)
ooh, Mouq++ rose to the mini-challenge right after I went to bed!
timotimo (antenoon '#perl6) 10:29
masak ah, macro humor. 10:30
Mouq: very interesting. quite different from mine. 10:31
here's my version: gist.github.com/masak/732867afd82801004c19 10:32
(I later had the idea to put together an FP version, but I haven't done that yet.) 10:33
Ulti pyrimidi_ nope writing it now 10:52
ssqq in nqp, How to dump a data(hash or list), or view the data structure of a object? 11:28
FROGGS__ ssqq: loop over it... there is no other way AFAICT 11:29
ssqq FROGGS__: I see, thanks.
ssqq nqp-m: ok( (nqp::add_n(1.1, 2.2) == 3.3), 'add_n(1.1, 2.2) == 3.3'); 11:50
camelia nqp-moarvm: OUTPUT«not ok 1 - add_n(1.1, 2.2) == 3.3␤»
ssqq nqp-m: ok( (nqp::add_n(1.1, 2.2) >= 3.3), 'add_n(1.1, 2.2) == 3.3'); 11:50
camelia nqp-moarvm: OUTPUT«ok 1 - add_n(1.1, 2.2) == 3.3␤»
timotimo surprise. add_n is about native floats 11:56
:)
jnthn Afternoon, #perl6 12:06
Yes, testing floats for equality is rarely a good idea. :)
Ulti m: say (1..10) (&) (7..12) 12:09
camelia rakudo-moar 795a32: OUTPUT«set(7, 8, 9, 10)␤»
Ulti m: my %stuff = stuff => (1..6), thing => (7..10); %stuff.grep(*.value (&) (5..6))>>.say 12:10
camelia ( no output )
Ulti :/ 12:11
m: my %stuff = stuff => (1..6), thing => (7..10); %stuff.grep(*.value (&) (5..6)).say
camelia rakudo-moar 795a32: OUTPUT«␤»
Ulti m: say (1..6) (&) (5..6)
camelia rakudo-moar 795a32: OUTPUT«set(5, 6)␤»
Ulti what's up with that?
jnthn m: my %stuff = stuff => (1..6), thing => (7..10); say %stuff.perl
camelia rakudo-moar 795a32: OUTPUT«("stuff" => 1..6, "thing" => 7..10).hash␤»
jnthn m: my %stuff = stuff => (1..6), thing => (7..10); say %stuff.map(*.value).perl 12:12
camelia rakudo-moar 795a32: OUTPUT«(1..6, 7..10).list␤»
Ulti m: my %stuff = stuff => (1..6), thing => (7..10); %stuff.grep(*.value (&) 5)).say
camelia rakudo-moar 795a32: OUTPUT«===SORRY!=== Error while compiling /tmp/jwOH6l7AYL␤Unexpected closing bracket␤at /tmp/jwOH6l7AYL:1␤------> g => (7..10); %stuff.grep(*.value (&) 5)⏏).say␤»
Ulti m: my %stuff = stuff => (1..6), thing => (7..10); %stuff.grep(*.value (cont) 5)).say
camelia rakudo-moar 795a32: OUTPUT«===SORRY!=== Error while compiling /tmp/HYFJqTvn31␤Unexpected closing bracket␤at /tmp/HYFJqTvn31:1␤------> > (7..10); %stuff.grep(*.value (cont) 5)⏏).say␤»
Ulti m: my %stuff = stuff => (1..6), thing => (7..10); %stuff.grep(*.value (cont) 5).say
camelia rakudo-moar 795a32: OUTPUT«"stuff" => 1..6␤»
Ulti yeah that works
jnthn m: my %stuff = stuff => (1..6), thing => (7..10); say %stuff.map(*.value (&) (5..6)).perl
camelia rakudo-moar 795a32: OUTPUT«No such method 'count' for invocant of type 'Set'␤ in method reify at src/gen/m-CORE.setting:8382␤ in block at src/gen/m-CORE.setting:8290␤ in method reify at src/gen/m-CORE.setting:8265␤ in method gimme at src/gen/m-CORE.setting:8781␤ in m…»
jnthn oh...that doesn't curry
m: my %stuff = stuff => (1..6), thing => (7..10); say %stuff.map({ .value (&) (5..6) }).perl 12:13
camelia rakudo-moar 795a32: OUTPUT«(set(5,6), set()).list␤»
jnthn m: my %stuff = stuff => (1..6), thing => (7..10); say %stuff.grep({ .value (&) (5..6) }).perl
camelia rakudo-moar 795a32: OUTPUT«("stuff" => 1..6,).list␤»
Ulti naaw
jnthn suspects (&) should do so, however
Ulti I have a feeling this caught me out ages ago 12:14
and I'm repeating myself
okedoke whatever... or not as the case may be
moritz \o 12:44
timotimo o\ 12:49
%
moritz FROGGS__: ping
FROGGS__ moritz: pong
moritz FROGGS__: we talked about moving testers.perl6.org to the new server 12:50
FROGGS__ moritz: true 12:51
I'd need an account... somewhere I suppose :o)
moritz FROGGS__: the main question is: should it go on the www or the 'hack' server?
moritz FROGGS__: how much CPU, RAM and disk space does it use? 12:52
FROGGS__ good question 12:52
lemme check
timotimo moritz: does the "security-relevant services" host have a name yet? 12:53
moritz www has 4GB RAM, and a single CPU; I could add another one with a short downtime
timotimo: no, it doesn't exist yet; I'm thinking maybe 'risk.p6c.org'
FROGGS__ moritz: is there a connection between both?
timotimo mhm 12:54
moritz FROGGS__: sure, both are on the internet :-)
FROGGS__ like, that the hack server could generate static html pages, and the www server would deliver these (using apache), and the www would also receive reports
so they'd need to share a prostgres db and a directory
maybe rsync'd 12:55
moritz FROGGS__: rsync should be pretty fast; I'd like to avoid setting up an NFS share 12:55
(they are on the same physical machine, so network between them should be pretty fast)
FROGGS__ yes, it feels like the right design anyway
jnthn FROGGS__++ moritz++ 12:56
moritz FROGGS__: mail or msg me your ssh pubkey, then I'll create an account for you on both servers
timotimo is www meant to do mostly static web hosting? 12:58
or are the web services supposed to culminate in a single web server via proxying?
moritz timotimo: it's dimensioned to also run some dynamic pages
timotimo: it has enough RAM to compile rakudo-m, so that's possible too
timotimo for some reason a single CPU still feels a bit weak; or is that two logical cores? 12:59
moritz timotimo: though highly CPU-intensive loads don't fit there
timotimo hm, i suppose web stuff is rather I/O bound
moritz timotimo: well, the server on which I run irclog.perlgeek.de (also written in perl) and a few mostly-static web pages is also a single core, and i mostly idles 13:00
timotimo i wonder how we'd get a libuv-backed socket on moarvm to do TCP fast open
moritz: ah, right. it's most probably mostly peak loads
gotta go AFK for a bit
colomon m: say 1..6 (&) 4..5 13:27
camelia rakudo-moar 795a32: OUTPUT«===SORRY!=== Error while compiling /tmp/osr71uJc0H␤Operators '..' and '..' are non-associative and require parentheses␤at /tmp/osr71uJc0H:1␤------> say 1..6 (&) 4.⏏.5␤ expecting any of:␤ postfix␤…»
colomon m: say (1..6) (&) (4..5) 13:28
camelia rakudo-moar 795a32: OUTPUT«set(4, 5)␤»
colomon m: say Set.new(1..6) (&) Set.new(4..5)
camelia rakudo-moar 795a32: OUTPUT«set(4, 5)␤»
colomon m: say set(1..6) (&) set(4..5)
camelia rakudo-moar 795a32: OUTPUT«set(4, 5)␤»
colomon m: say set($(1..6)) (&) set($(4..5)) 13:29
camelia rakudo-moar 795a32: OUTPUT«set()␤»
pmurias [Coke]: ping 13:33
Ulti m: my %h=hi=>1,world=>2; say %h.map({.value => .key}) 13:42
camelia rakudo-moar 795a32: OUTPUT«use of uninitialized value of type Any in string context in block <unit> at /tmp/8uNoRLhy4z:1␤␤No such method 'count' for invocant of type 'Hash'␤ in method reify at src/gen/m-CORE.setting:8382␤ in block at src/gen/m-CORE.setting:8290␤ in me…»
Ulti so what's up with the above...
m: my %h=hi=>1,world=>2; say %h.map({$_.value => .key})
camelia rakudo-moar 795a32: OUTPUT«1 => "hi" 2 => "world"␤»
Ulti ^ is my confusion 13:43
why the need for the first $_
timotimo so that it doesn't get parsed as a hash literal 13:45
$_ says "this is code block, yo"
Ulti I thought you would need the , for that
timotimo i don't think so
Ulti as in for it to be a hash rather than just a pair literal
timotimo m: say {foo => "bar"}.WHAT
camelia rakudo-moar 795a32: OUTPUT«(Hash)␤»
timotimo m: say {foo => "bar"}.perl
camelia rakudo-moar 795a32: OUTPUT«{"foo" => "bar"}␤»
jnthn I think the implicit use of $_ there should count
So I'd have taht as a bug.
timotimo hm, okay 13:46
jnthn I think there's an RT
Ulti I think its the {} looking hashy before they look blocky
that makes the => a hash rather than a pair
I mean this is what the * is kind of for 13:47
but I can't use it :'(
timotimo you can't, eh? 13:54
does => prevent currying for some reason?
oh, of course, two * will iterate in twos instead of one by one
brrt wednesday is too early for me, have exam that day. thursday is fine :-) 14:11
masak ...cue commit...
brrt i'm not sure i understand 14:15
asdf 14:16
oops
dalek : 7d08475 | masak++ | misc/perl6advent-2014/schedule:
[schedule] book brrt on Thursday
masak like that ^
brrt ah i see
:-)
masak feel free to fill in the topic, too. 14:17
vendethiel eh, I should find a topic to talk about
brrt thanks :-) i'll think about a good title. I was preparing to write about the JIT / spes logging stuff 14:18
in the sense of 'how to see what spesh/JIT does for you' 14:19
or would we lose too much readers that way? :-)
masak write about somthing that piques your interest, is the main thing 14:20
if it's interesting to you, and it comes through, chances are it's interesting to a reader 14:21
brrt ok, i'll try
moritz brrt: a bad post doesn't make us lose readers; if people don't like it, they move on to their next tab 14:28
brrt that is true
moritz brrt: ... you just shouldn't insult them :-)
brrt that is easy
i don't know them
ssqq why in perl6, 1.1+2.2 == 3.3, but in NQP, 1.1+2.2 > 3.3, they have same backends, only with different grammar and action. 14:34
jnthn ssqq: Because 1.1 is not a floating point number in Perl 6
brrt 1.1 in perl6 is (iirc) a rational 14:35
jnthn And in NQP we cheat and make it one.
moritz ssqq: the difference is that 1.1 in Perl 6 is a Rat, which can store the 1.1 exactly
ssqq: but it's not a VM-level type, so NQP doesn't have it
jnthn We could just forbid 1.1 in NQP and force writing 1.1e0 if we want to really force Perl 6 compatibility
But I've barely cared; floating point isn't very useful in compilers, generally.
moritz (and it's not needed much for writing compilers)
timotimo aye
jnthn Sometimes I wonder if NQP could get away with assuming all math is integers and you have to write the nqp::add_n if you want the floating point. 14:36
brrt as in, completely untested by any part of the compilation stack
jnthn We'd generate better code that way. :)
brrt jnthn - i think you could and it would simplify stuff
jnthn It's tempting. :)
brrt very
jnthn After all, the point of NQP is to build compilers and other related runtime bits, not to be general purpose like full Perl 6. :) 14:37
ssqq jnthn: yes, I think float is useless to hack compilers.
masak I'm surprised floats were put into NQP in the first place :) 14:45
moritz having floats is kinda useful for math that generates floats :-) 14:47
masak I guess...
moritz but I think it was really just parrot/PIR legacy 14:48
masak ...but even that explanation feels non-obvious to me. mixing levels, kind of.
moritz well, before NQP, rakudo was written in PIR (shudder) 14:49
so it's kinda obvious to have NQP provide all the PIR features that easily map into a HLL
[Coke] pmurias: pong
masak yeah.
dalek frastructure-doc: eb78d05 | moritz_++ | hosts/www.p6c.org.pod:
Add basic documentation for www.p6c.org.pod
14:56
dalek frastructure-doc: bb00259 | moritz_++ | hosts/hack.p6c.org.pod:
Updte sudoers list
15:03
FROGGS__ .oO( "Updte sders lst" - be consistent ) 15:04
moritz cnsstncy s vrrtd 15:05
masak ooh, I got a case where adding Grammar::Tracer changes the outcome of a parse :> 15:27
jnthn So Grammar::Tracer is SO good it not only helps you debug your grammar, but magically makes it work too? :P 15:29
masak no, it fails with a different failure.
guess that qualifies as a Heisenbug.
jnthn Well, more likely a Grammar::Tracer spoiling something bug...
masak I took a snapshot of the files -- will look at it later. 15:32
right now it would be a detour.
timotimo masak: could be an optimizer bug
oh, wait
yeah, maybe 15:33
masak no matter what the cause, it would be interesting to track it down.
timotimo some time ago i had to teach the optimizer to just ignore the kinds of nodes the debugger adds to regexes
otherwise it wouldn't turn a beginning-of-string anchor at the beginning into a direct fail instead of scanning through the whole string 15:34
smls Ulti: «$seq.Bag.pick($seq)» can be written more simply as «$seq.Bag.pick(*)» (in your advent post draft) 15:42
[Coke] .tell pmurias maybe just leave me a message this way. :) 15:43
yoleaux [Coke]: I'll pass your message to pmurias.
[Coke] .tell pmurias we don't currently smoke nqp, just rakudo. I can see about setting up an nqp-only smoker, but the last time I tried to get nqp-js to work, I kept getting failures. 15:44
yoleaux [Coke]: I'll pass your message to pmurias.
smls Ulti: «token record { ">"<id>" "<comment>"\n"<sequence> }» might benefit in readability from adding a space between each subrule. 15:45
moritz and that's just style, but maybe use single quotes? 15:47
token record { '>' <id> ' ' <comment> \n <sequence> } 15:48
[Coke] broken record 15:59
masak token effort
vendethiel why not use `my @report_lines = do for` in `method report`?(advent)
pmurias [Coke]: hi 16:01
yoleaux 15:43Z <[Coke]> pmurias: maybe just leave me a message this way. :)
15:44Z <[Coke]> pmurias: we don't currently smoke nqp, just rakudo. I can see about setting up an nqp-only smoker, but the last time I tried to get nqp-js to work, I kept getting failures.
pmurias [Coke]: what sort of failures are you getting?
[Coke]: 'make test' works here so failure are interesting for me 16:02
[Coke]: smoke testing for nqp-js would solve the most common 'missing dependency' style failures 16:04
perltricks Hey y'all, are there any docs that descrbe the naming rules for variables? (other than S02) 16:51
masak what are you after that you're not finding in S02? 16:52
smls doc.perl6.org/language/variables explains the twigils 16:53
(but not the rules for underscores/hyphens/apostrophes in custom variable names) 16:54
perltricks masak: i'm looking for rules in terms of what are legal names. I'm actually looking for module name rules, but assumed vars and modules/packages have the same rules.
masak yes. we call the common denominator an "identifier". 16:55
Ulti nooo my grammar doesnt work 16:57
so now I'm debugging it before the post :(
masak perltricks: the rule is this: alphanumerics and underscores are allowed, but the first char must not be a digit. before an alphabetic char you may also insert a single apostrophe (`'`) or hyphen (`-`).
vendethiel Ulti: grammar::debugger is very good :p
masak (but not before the first char)
perltricks masak: thank you! 16:58
masak m: my $_-_-_-_ = 5; say $_-_-_-_
camelia rakudo-moar 795a32: OUTPUT«5␤»
masak make that "before a non-numeric char".
m: my $don't-try-this-at-home = "!"; say :$don't-try-this-at-home.perl 16:59
camelia rakudo-moar 795a32: OUTPUT«"don't-try-this-at-home" => "!"␤»
ugexe its adding a signature to $_? 17:04
gtodd perltricks: it's not a built in to the language rule perse but in PBP (or was it Advanced Perl Programming ...) I remember recommendations like: %hash = (a => , b=> 2); and $hash_ref = \%hash ; ... etc. (quasi guidelines for naming scalars used as references) ... I like those for self-documenting code etc. but with Perl6 ... hmm 17:08
timotimo ugexe: huh? 17:08
gtodd perltricks: references are different or ermm everywhere but the idea of names that help document what is going on still applies ... I'd like to see a P6BP article about that :-D 17:10
on perltricks.com ...
perltricks gtodd: $++ thx for the tip 17:11
gtodd after alll ... perl ... it's not really all that tricky ... :-D
but still thanks for the tricks ... great site ++ 17:12
Ulti sooo this is weird my grammar is working but something is still borked
Ulti scratches his head
smls Ulti: «.grep({ .value (cont) $phospho_site })» can be written as «.grep(*.value (cont) $phospho_site)» , and in «... if ($p53_gene (cont) $snp);» you can leave off the outer parens. 17:14
masak ugexe: no, $_-_-_-_ is a different variable, no relation to $_ 17:15
Ulti smls yeah but you can't for the other ones so I wanted to be consistent 17:19
out parens on the if is a good call though
ok so in a grammar what is the syntax for an optional grouping of tokens 17:20
I have a feeling shoving a ? where I have isn't doing what I think it does
smls [ ... ]? 17:28
Ulti well that was fun :D 17:30
so this grammar for the advent cal is better than the one I've been using for a while lol
should probably improve the tests
smls Ulti: With «token record { ^^ ">" <id> [" "<comment> "\n"]? <sequence> }» it can parse the snippets from the FASTA wikipedia page 17:31
Ulti but yeah I didnt parse a FASTA without a comment before
so that was fun
smls yeah the idea is to have something a little more neat 17:32
perltricks gtodd: thx!
Ulti I also needed to change token to rule for the proto sequence bit because that obviously needs backtracking
also the order was wrong
(these are all good points to make)
Ulti gets writing 17:33
masak Ulti++
Ulti also jnthn++ for Grammar:Debugger its chuffing useful 17:34
Ulti a feature request though, see if an action is bound and being called ;P 17:34
masak yes. I've used Grammar::Tracer a bunch today. it's very useful. jnthn++ 17:36
vendethiel jnthn++ :-) 17:37
smls Ulti: What makes you say that the 'sequence' proto token needs backtracking? 17:44
Ulti because otherwise it doesnt match all the sequence it could
smls It tries all overloads, and the one that matches the longest token wins, doesn't it?
Ulti so like if the start of a sequence looks like DNA it sort of gives up and ruins it 17:45
smls not with token
token its just I keep going along and if I could match something whatever the length it was that token
smls Hm. Are you sure? 17:50
Ulti sure in that its what I observed debugging it
I think its because of the proto 17:51
if it was three optional tokens it would work
<dna> | <rna> | <aa> as tokens that would do what you expect
Ulti I guess proto tokens you want exact non confused tokens rather than something a bit more rule like 17:52
smls Ulti: What do you gain from separating those rules in the first place? «token sequence:sym<aa> { <[A..Z\*\-\n]>+ }» already covers all cases... 18:01
Ulti nothing in that post ;P
but you could in theory attempt to create a different type of sequence object for each
smls m: grammar { rule TOP {<foo>+}; proto token foo {*}; token foo:sym<a> {a+}; token foo:sym<ab> {a b+} }.parse("aaababa").say 18:04
camelia rakudo-moar 795a32: OUTPUT«(Any)␤»
smls m: grammar { rule TOP {<foo>+}; proto token foo {*}; token foo:sym<a> {a+}; token foo:sym<b> {b+} }.parse("aaababa").say 18:05
camelia rakudo-moar 795a32: OUTPUT«「aaababa」␤ foo => 「aaa」␤ foo => 「b」␤ foo => 「a」␤ foo => 「b」␤ foo => 「a」␤␤»
smls hm, looks like you're right, protos don't seem to work like | based LTM...
Ulti but they do as a rule 18:06
pun / actual wording intended
jnthn Ulti: Feel free to drop the feature request in the issues for Grammar::Debugger.
I want to revisit those two modules soon to get them able to use the method cache publishing support that I added to Rakudo in the last days, so they'll run a good bit faster. 18:07
Or rather, slow your grammar down a bit less :)
smls perlcabal.org/syn/S05.html#line_1349 suggests proto token should use longest-token matching though... 18:08
Ulti *shrug* for the sake of this post meh 18:09
smls I'm just trying to understand it all myself... :)
jnthn They do use LTM 18:11
That's the point of proto tokens... :)
the reason the one above doesn't match is that leftmost always wins
jnthn That is, an a+ will eat as many as it can, and then a b+ won't have an a. And tokens don't backtrack. 18:12
smls so 'a b+' is not treated as a single token by LTM? 18:13
jnthn Sure, but
aaaaabb
At the start of the string, it a+ can match 18:14
So it eats all the as
Then the <foo>+ means we try to match <foo> again.
smls oh, right
jnthn But nothing does, 'cus we already ate every a
smls m: grammar { rule TOP {<foo>+}; proto token foo {*}; token foo:sym<a> {a+}; token foo:sym<ab> {a+ b+} }.parse("aaababa").say 18:15
camelia rakudo-moar 795a32: OUTPUT«「aaababa」␤ foo => 「aaab」␤ foo => 「ab」␤ foo => 「a」␤␤»
smls \o/
I wonder which of the two was chosen for the last 'a' there...
jnthn Has to be foo:sym<a>, because there's no b for the b+ to match, surely? 18:16
smls what if it was "a+ b*"
jnthn Same, but then LTM comes out the same and so it tie-breaks on declaration order. 18:17
vendethiel needs to rewrite his Text::Indented because it backtracks too much... 18:17
smls and the one that was declared earlier wins? 18:18
Ulti jnthn good thats how I was thinking about it too... so my mental model isnt totally bogus
smls yeah
at least thats what is happening
jnthn smls: Yeah; that's also how it's spec'd :) 18:19
perltricks is there a max identifier character length?
jnthn perltricks: Yes, you only have so much RAM/swap... :)
perltricks jnthn: heh ok, thanks 18:20
jnthn I'm pretty somebody (probably masak :P) tried out a megabyte long identifier once and it worked :P
*pretty sure
perltricks :D
smls Ulti: 18:21
still not convinced that your case needs backtracking though... :)
smls Can you give an example of an input that only matches when you change proto token to proto rule there? 18:21
jnthn smls: It's regex that backtracks, not rule 18:28
smls right
jnthn (sorry if that's not helpful info; I'm only half-following while I prepare dinner :)) 18:29
smls that makes it even more curious that changing "proto token" to "proto rule" apparently makes something work 18:30
in Ulti's grammar...
Especially since the candidates all consist of a single quantified character class, like «rule sequence:sym<rna> { <[ACGURYKMSWBDHVNX\-\n]>+ }» 18:33
So no significant whitespace for :sigspace to affect, except for the one before the closing brace.
jnthn I know that the char class has \n in it 18:34
smls Is that affected by :sigspace somehow? 18:35
jnthn No, though I'm just wondering if the data has some other kind of space in it 18:37
smls Ulti: Also, I think «($<comment>) ?? (~$<comment>).trim !! ''» would accidentally discard a comment consisting of the character "0" 18:51
Maybe «($<comment> // '').trim» instead? (The .trim method automatically coerces to string.) 18:52
jnthn $<comment> is "did this match" rather than stringy truth 18:53
FROGGS__ m: say so "0"
camelia rakudo-moar 795a32: OUTPUT«False␤»
jnthn So I think it's OK
smls oh, right
jnthn m: "0" ~~ /(.)/; say ?$0
camelia rakudo-moar 795a32: OUTPUT«True␤»
smls although my version is still shorter :P 18:54
jnthn But a failed match is still defined
Oh, or is it...
gah, I can't remember :P
FROGGS__ it's Nil, isnt it?
jnthn I'd have putten || there though
smls I though it was just (any)?
jnthn Uh, *put 18:55
.oO( I made a right turkey of that sentence... )
smls m: say ("a" ~~ /b/).perl
camelia rakudo-moar 795a32: OUTPUT«Nil␤»
jnthn Yeah, then // is fine :) 18:56
nom &
smls say grammar {token TOP { b }}.parse("a").perl 18:56
m: say grammar {token TOP { b }}.parse("a").perl
camelia rakudo-moar 795a32: OUTPUT«Any␤»
smls stops annoying Ulti for now... :P 18:58
pyrimidine Ulti: have any links to advent draft? I'll be on and off today, but can backlog 19:19
Ulti perl6advent.wordpress.com/?p=2437&a...eview=true 19:38
pyrimidine ping
also everyone else I guess
I dont think I want to spend any more time on it
Ulti post set to pending 19:46
pyrimidine Ulti: Odd, getting a 404 on that URL. 20:01
Ulti perl6advent.wordpress.com/2014/12/1...45a2aa2bb3 20:02
yeah sorry had to set to be scheduled first
watch out for the visual editor that will wreck havoc on the formatting 20:03
pyrimidine yeah; I hate wordpress 20:09
Nope, still a 404 :( 20:11
dwarring pyrimidine: are you logged into wordpress 20:13
?
pyrimidine yep
as cjfields
dwarring hmm, both links working for me 20:14
masak pyrimidine: maybe you don't have access to perl6advent
pyrimidine masak: yes, I think that's it 20:15
wordpress.com user name is cjfields if that helps
masak m: -> $x, $y, $x {} 20:18
camelia rakudo-moar 795a32: OUTPUT«===SORRY!=== Error while compiling /tmp/nPLwY6Xoor␤Redeclaration of symbol $x␤at /tmp/nPLwY6Xoor:1␤------> -> $x, $y, $x⏏ {}␤»
masak m: my $x; my $x 20:18
camelia rakudo-moar 795a32: OUTPUT«Potential difficulties:␤ Redeclaration of symbol $x␤ at /tmp/74uM4kpum4:1␤ ------> my $x; my $x⏏<EOL>␤»
masak perl6: sub f(&f) { &f("OH HAI") }; f({ say $^greeting }) 20:23
camelia rakudo-{parrot,moar} 795a32: OUTPUT«OH HAI␤»
pyrimidine masak: anyone I need to ping re: p6advent access? Mainly for Ulti 20:26
*Ulti's article :P 20:27
but not a big deal if it's a pain
BenGoldberg perl6: sub f(&f) { f("iello, uorld!") }; f(&say);
camelia rakudo-{parrot,moar} 795a32: OUTPUT«iello, uorld!␤»
moritz pyrimidine: /msg me your email address 20:33
dwarring Ulti: stray '>' midway through "A Bag of Sequence" section
"> print $seq GCTACCTATAAAGC>"
dwarring nice post 20:34
pyrimidine moritz: sent 20:40
moritz on my web servers, I tend to use name-based virtual hosts for IPv4, and separate IPv6 addreses for each (sub)domain 20:48
does that make sense? Should I do the same on the new www server? 20:49
(I finally managed to enable IPv6 on the server) 20:51
pyrimidine Ulti: awesome post!
Ulti pyrimidine I've logged out if you were making changes 21:33
pyrimidine Ulti: nope, I think dwarring caught the specific one. It hits on all the good points why one would use p6 for this 21:34
Ulti k k, I'll get on with the rest of my life now then lol 21:35
dalek frastructure-doc: 5e26393 | moritz_++ | hosts/ (2 files):
Document IP addresses

particularly important, because IPv6 is not in the DNS yet
timotimo o/ 21:39
timotimo had an exciting drive through thick fog uphill around lots and lots of sharp turns
jnthn Sounds a little *too* exciting... 21:40
raydiak \o
timotimo it was okay, i didn't drive anywhere near the speed limit for some more "exciting" parts :) 21:41
the "driving fast" part of my trip was satisfying, too, though. Deutsche Autobahn is without a speed limit in big parts
jnthn Yes, I've experienced that...as a passenger :) 21:42
timotimo i was going 150 km/h at times and was being overtaken by cars at least 20 or perhaps 30km faster than me on the left
so i thought "why the heck not." and went 180 km/h for a bit, too
every now and then it can feel nice
masak ok, I wrote an FP version of the animal guessing game, as promised: gist.github.com/masak/01c4469169dc88e2c114 21:51
it's shorter, but it makes my head spin a little bit to reason about it.
vendethiel masak: exit(); is not very fp-ish :p
masak and I didn't even try to list the animals on exit. (though it is possible)
vendethiel: just think of it as the QuitProgram monad. 21:52
vendethiel *g*
vendethiel it's like the asm's monad longjmp, amirite 21:52
masak like a trampoline into a pool of ice cold water. 21:53
masak the thing I dislike about this version is that I keep coming up with possible simplifications, and they all turn out not to work :/ 21:56
it's like it's in a local optimum of FP permutation programming. 21:57
raydiak timotimo: I had an exciting drive today too! around meth-addicted drivers in my neighborhood, through SUV police patrols on the freeway, passing under lots and lots of cameras waiting to juice you for extra municipal revenue :) 22:06
Ulti pyrimidi_ dwarring I think the spurious '>' is a feature, the .gist prints out FASTA records i.e. they start with > 22:07
jnthn Sometimes, I'm so darn glad I can't drive :) 22:08
raydiak I've been seriously considering giving it up entirely the last few years, things are getting so much worse than they were when I started driving just a decade ago 22:09
dwarring Ulti++
raydiak jnthn: why can't you drive?
jnthn raydiak: Rentina condition = see in low resolution = can't drive safely. 22:10
raydiak aw, that sucks...apparently retinas are fragile things in the #perl6 circle 22:11
jnthn Well, mine one is genetic, and very stable so far (and family history suggests it stays that way for a lifetime). 22:12
So thankfully it seems I don't have to worry about it getting any worse. 22:13
timotimo raydiak: in what way did driving change? too many mad people on the road?
or just too many in general?
raydiak glad to hear it :)
timotimo raydiak: on the flip side, it gives jnthn an epic beard coloring 22:14
masak .oO( to dye for ) 22:14
raydiak timotimo: in my specific area, the cops are scary, the cameras are multiplying exponentially and send tickets to my 60-yr-old mother in her station wagon, who is an excellent and responsible driver
timotimo :\
raydiak then there is the prevailing social climate, which as you guessed, is much worse 22:15
timotimo .o( "when i get in my car and drive / there aint nobody left alive" )
raydiak aye...between the careless people, angry people, the addicts, the cops...it can get pretty tense 22:17
the cops just in the last decade here have tazed a pregnant woman, shot unarmed minors more than once...stuff I'm surprised didn't go national, honestly
but most of the city, including cops, newspaper, etc, is pretty corrupt and owned by a single family 22:18
but I also have a skewed perspective b/c I'm a way-too-young burnout living in the closest thing we have to a ghetto, so take all that with a grain of salt :) 22:19
raydiak oh and (epic beard coloring)++ 22:21
timotimo hmm :S
masak 'night, #perl6 22:22
raydiak g'night masak 22:22
timotimo gnite masak 22:23
raydiak it's a darn shame too, b/c there are also lots of cool people here, and easy access to some incredible nature, if outdoors is your thing, we even get all 4 seasons which I like 22:25
timotimo ;( 22:26
raydiak just too many elements being mixed under too much pressure in recent years maybe
but I could go on for hours about what I think is wrong with the world around me...I like Perl 6 (and #perl6) b/c it's one of the things that still feels more right than wrong :) 22:29
raydiak goes outside to clear his head and plan the remainder of his day 22:29
ab5tract everything i've been hacking on recently seems to break perl6 :( 22:37
one sequence, three or more outputs: gist.github.com/ab5tract/ff7ea75f0a9262d4e4a4
FROGGS_ ab5tract: that might be because of the BEGIN-block+our-scope design pattern 22:39
I bet the segfaults vanish with the removal of one of them 22:40
sorry that I've got to leave now though :/
gnight #perl6
timotimo gn
ab5tract ciao FROGGS_, thanks for the tip 22:41
ab5tract if removing the BEGIN block means making it a sub and calling it explicitly, that doesn't change anything :/ 22:46
ab5tract haven't been able to get undefined behavior or crashing with the same code on jvm, fwiw 22:48
jnthn Looking at where it fails, I somewhat suspect the qq:x 22:51
The first one suggests some kind of heap corruption, and the second can be explained by corruption of the command given to tput
ab5tract jnthn: that's basically how i had broken it down in my reasoning. but i wouldn't have expected the RHS to affect the LHS in that way, re: the key behavior 22:53
i get those heap corruptions pretty consistently with qq:x on moar/os x
jnthn Oh, you're on OS X... 22:55
ab5tract i thought to cache all the `tput cup y x` strings, and that for loop crashes ~90% of the time, but always in a different place, and with varying forms of "oh-noez-moar-splodes"
jnthn Yeah, there's some instability with moar on OSX that doesn't seem to exist on Windows or Linux. :( 22:56
ab5tract have you been having any luck with it?
jnthn I've spent hours on it already with lldb, guardmalloc, etc. I did find and fix two bugs. Sadly, neither seemed to be The Bug.
They helped get spectest cleaner, but something is certainly still amiss. 22:57
ab5tract :(
jnthn I should take a closer look at qqx. I wonder if it takes a different code path on OSX for some reason. 22:58
ab5tract do i understand correctly that OS X is swapping memory locations/values around?
jnthn Yeah, I suspect ASLR is to thank for the different outcomes between runs. 22:59
ab5tract jnthn: gist.github.com/ab5tract/28aa420074909a6925ae 23:00
that will get you a qq:x crash consistently, guaranteed
jnthn ooh
ab5tract "guaranteed consistency"
i've got to run for now 23:03
i hope it helps with your investigation
jnthn Sadly not on the OSX box I have access to but maybe I should update my Moar/Rakudo there first 23:04
I'll try on the train tomorrow
jnthn should probably sleep now-ish :)
ab5tract happy travels :) 23:05
pmurias jnthn: sleeping is useful for hunting weird segfault ;) 23:06
jnthn Also, for not missing said train... ;) 23:10
'night, #perl6
vendethiel 'night, jnthn++ :) 23:13
perltricks ok a P6 module-starter: github.com/sillymoose/Module-Minter 23:46
I've got an outstanding PR for File::Temp, so haven't added it to the module list yet 23:47
raydiak nice! perltricks++ 23:48