Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-02-17

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:08 masak 'night, #perl6
00:09 TimToady o/
00:23 benabik joined #perl6
00:48 fridim_ joined #perl6
00:50 leprevost joined #perl6
01:02 scott__ joined #perl6
01:06 woosley joined #perl6
01:20 Psyche^ joined #perl6
01:41 lestrrat joined #perl6
01:47 sorear good * #perl6
01:54 araujo sorear, o/ !
02:30 leprevost joined #perl6
02:31 lestrrat joined #perl6
02:35 Psyche^ joined #perl6
02:43 colomon \o
03:32 orafu joined #perl6
03:34 wolfman2000 joined #perl6
03:48 pernatiy joined #perl6
03:54 jtpalmer joined #perl6
04:07 y3llow joined #perl6
04:32 mucker joined #perl6
04:58 Trashlord joined #perl6
05:03 birdwindupbird joined #perl6
05:54 birdwindupbird joined #perl6
05:57 moritz \o
05:57 TimToady yo
05:58 araujo o/
05:58 moritz nqp: 1.?foo();
05:58 p6eval nqp: OUTPUT«Confused at line 1, near "1.?foo();"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
06:02 Teratogen nqp:  say 1 + 1
06:02 p6eval nqp: OUTPUT«Confused at line 1, near "say 1 + 1"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
06:02 Teratogen what the
06:03 moritz nqp doesn't parse listops
06:03 moritz needs parens around a sub call
06:03 Teratogen nqp: (say 1+1)
06:03 p6eval nqp: OUTPUT«Confused at line 1, near "(say 1+1)"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
06:03 Teratogen I give up
06:03 benabik Teratogen: Around the arguments
06:03 benabik nqp: say(1+1)
06:03 p6eval nqp: OUTPUT«2␤»
06:04 Teratogen oh
06:04 Teratogen =D
06:07 Tarmvred joined #perl6
06:10 kaleem joined #perl6
06:12 amirite joined #perl6
06:13 sorear (say 1+1)
06:13 * sorear hugs Teratogen, good Lisp user
06:13 Teratogen haha
06:14 Teratogen nqp: (say (1+1)
06:14 p6eval nqp: OUTPUT«Confused at line 1, near "(say (1+1)"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
06:14 Teratogen nqp: (say (1+1))
06:14 p6eval nqp: OUTPUT«Confused at line 1, near "(say (1+1)"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)␤»
06:14 Teratogen baw
06:14 amirite left #perl6
06:16 Woodi joined #perl6
06:17 benabik nom: (say ([+] 1, 2, 3))
06:17 p6eval nom f9fcb2: OUTPUT«6␤»
06:21 moritz nom: (say (&infix:<+> 1, 2, 3))
06:21 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2␤»
06:21 moritz nom: (say (infix:<+> 1, 2, 3))
06:21 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'infix:<+>' will never work with argument types (int, int, int) (line 1)␤    Expected any of:␤    :(Any $x = { ... })␤    :(Any \$a, Any \$b)␤    :(Real \$a, Real \$b)␤    :(Int:D \$a, Int:D \$b)␤    :(int $a, int $b)␤    :(Num:D \$a…
06:21 moritz nom: (say (infix:<+> 1, 2))
06:21 p6eval nom f9fcb2: OUTPUT«3␤»
06:22 benabik moritz++
06:24 sorear niecza: (say (infix:<+> 1, 2)) # cuirous
06:24 p6eval niecza v14-42-g1d02da9: OUTPUT«3␤»
06:27 Teratogen can you do postfix in perl?
06:28 Teratogen err, perl 6?
06:28 moritz Teratogen: yes, see S03
06:28 sorear "no, you would need async I/O and better socket support to emulate postfix in perl 6"
06:28 sorear ++ is a postfix operator
06:29 moritz I thought ++ was a prefix operator :-)
06:29 sorear niecza: my $x = 3; say postfix:<++> $x; say $x
06:29 p6eval niecza v14-42-g1d02da9: OUTPUT«3␤4␤»
06:29 sorear it's that too
06:29 Teratogen cool
06:29 Teratogen perl 6 does everything
06:29 Teratogen it's like perl + lisp + forth
06:30 TimToady .oO(+ Java + Haskell + BASIC + JS + ...)
06:30 sorear meh, without homoiconicity perl 6 will never be lisp, and without the ability to run on PIIs (never mind 8085s) Perl 6 will never be Forth
06:30 TimToady if homoiconicity were the right thing, we'd work directly with DNA, not proteins :P
06:31 sorear oh, TimToady, that reminds me - JavaScript "var foo", Perl5 "my $foo" have strikingly similar semantics.  Who stole what from whom?
06:31 TimToady we certainly didn't steal it from them
06:31 sorear (apologies if I asked this earlier and forgot)
06:32 * sorear expects to get an answer like "both got it from $obscure_60s_mainframe_scripting_language"
06:32 TimToady well, Pascal had 'var', if I recall
06:33 sorear did pascal allow you to use "var" as an expression?
06:34 Teratogen speaking of obscure mainframe, I used to do multics pl/1 when I was at the Pentagon.
06:34 sorear what I really picked up on was that Perl 5 and JS don't really have initializers.   "my $foo" is an lvalue expression
06:34 sorear Teratogen: then you'll fit right in here.
06:34 Teratogen I had an honest to god VT-100 terminal on my desk.
06:34 Teratogen and I set it to 132 column mode!
06:35 Teratogen I also had a Tektronix 4014 next to my desk, and I used pl/1 to write fractal programs to display on the 4014.
06:35 sorear likewise "var foo = 5" means "(var foo) = 5"
06:35 Teratogen Those were the days!
06:36 TimToady in Pascal, var just introduce the section where you declare variables
06:36 benabik In my uni machine room, we have a VT-100 that's a serial terminal to all the servers.
06:36 TimToady *duced
06:36 Teratogen benabik, yes but is it an actual DEC VT-100, or some knockoff clone?
06:36 TimToady how fancy; my first CRT was a VT05
06:37 TimToady 72x20, uppercase only
06:37 benabik Teratogen: I think it's a real one...  I'll have to check when I work next.
06:37 Teratogen Before the VT-100 was the VT-52 I think.
06:37 Teratogen It's bell was a bzzzzzzzzzzzt noise.
06:38 TimToady the VT05 was much longer than it was wide
06:38 Teratogen TimToady, I also worked with Decwriters.
06:38 Teratogen They were great serial terminal/printers.
06:38 Teratogen And built like a tank.  You could probably drop one off a cliff and it would still work.
06:39 sorear vt100 probably wouldn't survive much of a fall, being made of glass and all that...
06:40 TimToady well, the VT05 was much nicer than the ASR33 I used before that...
06:40 TimToady the benefits of actually working for the computer center
06:41 * sorear is, erm, 2e1
06:41 TimToady I thought you were 2.1e1
06:41 moritz O(2e1) :-)
06:41 sorear closer to 2.13e1, but that's just precision
06:42 Teratogen ASR33 was a teletype with a side order of paper tape, right?
06:42 TimToady yup, 10 characters per second
06:42 TimToady and LOUD
06:43 Teratogen We had those in high school, along with 300 baud modems with cups on them.
06:43 Teratogen When we ran out of paper we'd steal rolls of paper towels from the bathroom.
06:43 sorear did people ever use hearing protection in your computer installation(s)?
06:43 TimToady eh, what did you say?
06:43 sorear you said LOUD not BRIGHT :P
06:44 Teratogen We used the 300 baud modems to connect to an HP 2000 minicomputer downtown.
06:44 Teratogen They would run HP timesharing basic during the day then shut that down so they could run card fortran at night.
06:44 Teratogen HP timesharing basic had the coolest name for the substring function: SST. =D
06:44 TimToady used to be, when the lights flickered, I'd call up the computer's modem bank and whistle at it; if it whisled back, I knew the computer was still up; if not, I knew I'd better head to the computer center
06:45 Teratogen The Concorde SST was just making its maiden flight around then, I think, so that was pretty cool.
06:45 TimToady our boss in the computer center used to work for HP, but had to switch to DEC when he came :)
06:46 sorear TimToady: you could hit a tone the modems understood?
06:46 TimToady I could warble the tone appropriately enough by poking my cheek
06:47 * sorear is quite impressed
06:47 TimToady a 110 baud modem is not difficult to fool
06:47 Teratogen I wrote an hp timesharing basic program that would print large letters on paper tape, some idiot from central high school broke into our account, stole my program, and put his name on it.
06:47 Teratogen plagiarization!
06:48 Teratogen so one of my friends broke into central high school's account, and deleted all their files.
06:48 TimToady you should be flattered
06:48 Teratogen BUT HEY IT WAS ALL IN GOOD FUN!
06:48 Teratogen high school rivalry you know
06:49 Teratogen Let's see what else, I was an explorer scout that was hosted by Honeywell so I got to play around with GCOS.
06:50 Teratogen And in college we had a hulking Univac 1108.
06:51 sorear Teratogen: where in the world was this?
06:51 Teratogen Arizona
06:51 TimToady the first time I played adventure was on a DECSYSTEM-20 in the lobby of the DECUS convention in Las Vegas at the MGM Grand Hotel that eventually burned and kill 85 people
06:51 sorear I suppose there is probably more than one "Central High" in the US, huh
06:51 Teratogen and later on, I was stationed at the Pentagon (those were the Multics years)
06:51 takesako joined #perl6
06:51 TimToady where I grew up it meant Central Kitsap County
06:52 replore_ joined #perl6
06:52 sorear Did it do the burning and the killing during DECUS?
06:52 TimToady I've programmed in Pascal on an Amdahl, and in Algol on a Burroughs mainfraim
06:52 Teratogen Although I also got to play around with the first 16 bit computers to arrive at the Pentagon, the Zenith Z-100 and Z-150.
06:53 TimToady sorear: nah, that wasn't till 1980
06:53 sorear first computer I used ...
06:53 sorear a 486 running Windows 3.11 *lameness*
06:53 Teratogen Let's see, I was in high school in the early 1970s, my first computer was the HP-2000.
06:54 Teratogen My first personal computer was an Atari ST.
06:55 Teratogen TimToady, there was an Algol compiler for the HP-2000, I never fooled around with it, but my friend (the one who deleted central high school's files) wrote a few programs for it.
06:57 wtw joined #perl6
06:58 takesako joined #perl6
06:58 TimToady the first thing I ever programmed had nixie tubes for a display
06:59 Teratogen sorear, Windows 3.1 with Trumpet Winsock and Netscape Navigator on a 28.8k modem was actually pretty peppy back in the day.
07:00 dalek rakudo/sink: 5081a51 | moritz++ | src/ (3 files):
07:00 dalek rakudo/sink: Apply traits in sink context
07:00 dalek rakudo/sink:
07:00 dalek rakudo/sink: ... except in Perl6::World, where
07:00 dalek rakudo/sink:    if pir::can__IPs($ret, 'sink') { $ret.sink }
07:00 dalek rakudo/sink: mysteriously dies because it can't find method sink in
07:00 dalek rakudo/sink: Associative. WTF.
07:00 dalek rakudo/sink: Also doesn't fix 'use Test;'. Not sure what else is missing.
07:00 dalek rakudo/sink: review: https://github.com/rakudo/rakudo/commit/5081a51d4b
07:01 * TimToady is looking forward to seeing "Useless use of" warnings from rakudo soon
07:01 Teratogen Or, "Usage is deprecated" ?
07:02 TimToady those aren't so useful
07:02 TimToady eval: use warnings; 1 + rand; 0
07:02 buubot_backup TimToady: Useless use of addition (+) in void context at (eval 20) line 1. 0
07:03 TimToady eval; print (1+2),3
07:03 buubot_backup TimToady: 33
07:04 TimToady eval: print (1+2),3; 0
07:04 buubot_backup TimToady: 30
07:04 TimToady eval: use warnings; print (1+2),3; 0
07:04 buubot_backup TimToady: print (...) interpreted as function at (eval 20) line 1. Useless use of a constant (3) in void context at (eval 20) line 1. 30
07:05 TimToady eval: use warnings; my $a = 1,2; 0
07:05 buubot_backup TimToady: Useless use of a constant (2) in void context at (eval 20) line 1. 0
07:05 TimToady very much more useful than mere deprecations; Useless use warnings often point out a misunderstanding of syntax or precedence
07:06 Teratogen I that's right, it is Java that has all of those deprecated classes. =)
07:08 raoul joined #perl6
07:12 moritz if we want to be able to generate such useelss use warnings, we need purity annotations or analysis
07:12 TimToady but you need that for constant folding anyway
07:13 moritz well
07:13 moritz it's not that easy
07:14 moritz what would you expect from   class A { ... }; A.new() + 1   ?
07:14 Woodi joined #perl6
07:14 moritz always warn? only warn if A.Numeric can be determined to be pure? never warn?
07:14 TimToady I would expect + to know it's pure, even if A isn't
07:15 moritz then it doesn't use the same kind of purity information as the constant folder
07:15 TimToady the constant folder needs to know more, sure
07:16 TimToady but the purity of + is one of things it needs to know
07:17 moritz well, not all + candidates are really pure, which is what I'm trying to say :-)
07:17 TimToady then they probably violate the purity declared on the proto, assuming it's declared there, and assumed part of the API of all + operations
07:18 sorear writing impure .Numeric methods is erroneous, so the compiler sould warn
07:18 sorear after all, nowhere do we spec the number of times .Numeric is called by a given compound operation
07:18 moritz sorear: that doesn't make writing an impure .Numeric operation errornous
07:18 moritz just very stupid
07:19 TimToady I'm fine with outlawing impure operations derived from pure protos
07:19 TimToady or at least, forcing the declarator of such to work harder
07:19 TimToady like, by providing a less pure proto
07:20 TimToady I much prefer people to come up with new operators than to overload existing ones with bogus and unexpected semantics
07:21 Teratogen <@-^-@>
07:21 Teratogen I have no idea what that does.
07:21 Teratogen But it would be a cool operator.
07:21 moritz nom: say <@-^-@>
07:21 p6eval nom f9fcb2: OUTPUT«@-^-@␤»
07:23 sorear Teratogen: <...> is quote syntax, trampling on that with an operator is considered mildly unkind
07:23 moritz well
07:23 moritz there's also < as an infix
07:23 moritz and < ... > as a postcircumfix
07:24 TimToady perl6: sub infix:['<@-^-@>'] ($a, $b) { @$a (^) @$b }; say <a b c> <@-^-@> <b c d>
07:24 moritz so we already have 3 uses; adding more would be quite confusing
07:24 p6eval rakudo f9fcb2: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix ^ instead at line 1, near ") @$b }; s"␤»
07:24 p6eval ..niecza v14-42-g1d02da9: OUTPUT«set(a, d)␤»
07:24 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected ":['<@-^-@>']"␤    expecting "::", "handles", "is", bare trait, subroutine parameters, trait or block␤    at /tmp/hmRx5XM_7K line 1, column 10␤»
07:24 TimToady niecza++
07:24 Teratogen yikes!
07:24 moritz in rakudo you currently need to write infix:«...» for that
07:24 TimToady perl6: sub infix:«<@-^-@>» ($a, $b) { @$a (^) @$b }; say <a b c> <@-^-@> <b c d>
07:24 p6eval pugs b927740: OUTPUT«decodeUTF8': bad data: '\171'␤decodeUTF8': bad data: '\187'␤*** ␤    Unexpected "(^)"␤    expecting operator or "}"␤    at /tmp/Vznq2HX7wJ line 1, column 36␤»
07:24 p6eval ..niecza v14-42-g1d02da9: OUTPUT«set(a, d)␤»
07:24 p6eval ..rakudo f9fcb2: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2␤»
07:25 TimToady but rakudo doesn't have the Set op yet, alas
07:25 moritz and maybe it also doesn't LTM enough
07:25 TimToady I think it probably does...
07:26 TimToady perl6: sub infix:«<@-^-@>» ($a, $b) { @$a ~ " and " ~ @$b }; say <a b c> <@-^-@> <b c d>
07:26 p6eval pugs b927740: OUTPUT«decodeUTF8': bad data: '\171'␤decodeUTF8': bad data: '\187'␤*** No such subroutine: "&infix:@-^-@"␤    at /tmp/ow_srTtqa4 line 1, column 59 - line 2, column 1␤»
07:26 p6eval ..rakudo f9fcb2: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name␤at /tmp/fiKr62pYu9:1␤»
07:26 p6eval ..niecza v14-42-g1d02da9: OUTPUT«a b c and b c d␤»
07:26 TimToady well, maybe not
07:27 TimToady Teratogen: but you see why LTM (longest token matching) is so essential to the extensibility of Perl 6
07:27 Teratogen Not really, because I don't know what LTM is. =)
07:27 TimToady which is why I defined it in parens
07:27 Teratogen is it like greedy regular expression matching?
07:28 TimToady yes, like that
07:28 TimToady whenever the grammar has a set of alternative tokens, it picks the longest first
07:28 TimToady so more to do with what it does over | than it does with *
07:28 TimToady but similar notion
07:29 Teratogen Maybe I am old fashioned and showing my age here, but I wish Perl 6 would have included a plain old text preprocessor, like the one C language has.  *sigh*
07:29 TimToady when we say "infix" it is really identifying an alternation that happens to be named rather than using |
07:30 Teratogen I know Perl 6 has a super duper macro preprocessor of some sort.
07:30 TimToady well, yes, except for the "pre" part, which is evil
07:30 TimToady Perl 6 is very strict about doing one-pass parsing
07:30 sorear Perl 6 is supposed to include everything but the kitchen sink ... that includes a Filter::Util::Call replacement
07:31 sorear s/include/make possible/
07:32 TimToady the problem with multi-pass parsing is that the input language and the output language are two different languages, which confuses people no end
07:33 TimToady not to mention theparser
07:34 TimToady the only way for a parser to know exactly which language it's parsing at any point is to do it one pass
07:34 TimToady anything else ends up being a form of russian roulette
07:35 jnthn morning, #perl66
07:35 TimToady you think you're getting away with it, and having fun, till you don't, and aren't
07:35 TimToady o/
07:35 mj41 joined #perl6
07:36 jnthn ooh, sticky 6 key...
07:36 TimToady as long as it doesn't stick more than that, nobody will mistake you for the antichrist
07:38 TimToady hmm
07:38 TimToady perl6: sub infix:«<\@-^-\@>» ($a, $b) { @$a ~ " and " ~ @$b }; say <a b c> <@-^-@> <b c d>
07:38 p6eval rakudo f9fcb2: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name␤at /tmp/d2oEDh6Vxa:1␤»
07:38 p6eval ..niecza v14-42-g1d02da9: OUTPUT«a b c and b c d␤»
07:38 p6eval ..pugs b927740: OUTPUT«decodeUTF8': bad data: '\171'␤decodeUTF8': bad data: '\187'␤*** No such subroutine: "&infix:@-^-@"␤    at /tmp/5qdwbLarWE line 1, column 61 - line 2, column 1␤»
07:39 TimToady I guess it's not a problem of interpolating insice «», or a different problem
07:40 TimToady perl6: sub infix:<\<@-^-@\>> ($a, $b) { @$a ~ " and " ~ @$b }; say <a b c> <@-^-@> <b c d>
07:40 p6eval niecza v14-42-g1d02da9: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Non-declarative sigil is missing its name at /tmp/dSv3zN2sS9 line 1:â�¤------> [32m) { @$a ~ " and " ~ @$b }; say <a b c> <[33mâ��[31m@-^-@> <b c d>[0mâ�¤â�¤Use of uninitialized value in string contextâ�¤  at /home/p6eval/niecza/b…
07:40 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected "infix"␤    expecting "=", subroutine parameters, trait or block␤    at /tmp/txZxhMdPBl line 1, column 5␤»
07:40 p6eval ..rakudo f9fcb2: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name␤at /tmp/KxFGJ0mcUH:1␤»
07:40 jnthn yay, my favorite coffee machine is working again today...
07:40 TimToady hmm, that oughta work, methinks
07:40 cognominal___ Tdratogen: one of the problem with preprocessors is that you can't stack them because they suppose they parse a instance of the original language.when the very purpose of them is to change it.
07:42 TimToady perl6: sub infix:<< <@-^-@> >> ($a, $b) { @$a ~ " and " ~ @$b }; say <a b c> <@-^-@> <b c d>
07:42 cognominal___ the fashion for source filters did not last in Perl 5
07:42 p6eval pugs b927740: OUTPUT«*** No such subroutine: "&infix:@-^-@"␤    at /tmp/TkcixSjT5y line 1, column 63 - line 2, column 1␤»
07:42 p6eval ..rakudo f9fcb2: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name␤at /tmp/6GVRdsDUit:1␤»
07:42 p6eval ..niecza v14-42-g1d02da9: OUTPUT«a b c and b c d␤»
07:44 sorear o/ jnthn
07:44 Teratogen perl 5 had -P =P
07:44 Teratogen I wonder who added THAT
07:45 sorear most likely TimToady sometime around Perl 2.0
07:45 Teratogen actually
07:45 sorear several other languages from Perl's ecological niche support using the C pre-processor even when nothing like C
07:45 Teratogen Perl 5 HAS -P.
07:46 sorear right, Perl 5 people hate removing features.
07:46 Teratogen Of course it usually doesn't work on Windows, because there is no C Preprocessor on Windows (usually).
07:46 sorear there was a riot earlier this week over the fact that 5.16 removes defined(@array)
07:46 sorear do you want to guess when it was formally deprecated?
07:47 jnthn Last millenium? :)
07:47 doy $ perl -P # Unrecognized switch: -P  (-h will show valid options).
07:47 doy ?
07:47 sorear jnthn: very good!  1998, 5.005_something
07:48 Teratogen doy, what the
07:48 Teratogen -P has been removed from Perl!?
07:48 sorear my Debian-shipped 5.12.0 also fails -P
07:49 * sorear half-guesses doy is on 5.16 or bleadperl
07:49 doy looks like it was deprecated in 5.10 and removed in 5.12
07:49 doy (i'm on 5.14.2)
07:49 doy we're really trying to start removing things these days
07:50 doy convincing people is hard, but we're trying
07:50 doy (:
07:50 Teratogen Why not integrate a text preprocessor into Perl 5.10+?
07:51 Teratogen It would make it two-pass, but hey, preprocessors are fun!
07:51 sorear because you could just use Filter::Simple and a pure-Perl cpp
07:51 sorear and it would be more portable that way
07:51 sorear ?
07:51 Teratogen is Filter::Simple a core module?
07:51 doy yes
07:51 Teratogen Nifty.
07:51 doy we haven't gotten rid of source filters yet, unfortunately
07:52 sorear how *would* you get rid of source filters without breaking D::D?
07:52 doy by getting rid of d::d
07:52 sorear you think people can live without mx:d et al?
07:52 sorear :)
07:54 sorear wait, this isn't #moose, I should probably write the module names in full
07:54 sorear Devel::Declare, MooseX::Declare
07:54 doy no, i mean - we have better non-source-filtery options in the works
07:54 sorear ah
07:55 doy lots of work to make the lexer and parser more pluggable directly
07:55 sorear \o/
07:58 doy the p5-mop syntax is actually using one of the new prototypes for that
08:02 moritz can I see the p5-mop syntax somewhere?
08:03 moritz nom: pir::say pir::can__IPs(Associative, 'sink')
08:03 p6eval nom f9fcb2: OUTPUT«1␤»
08:03 doy https://github.com/stevan/p5-mop/blob/master/t/000-examples/002-basic-example.t
08:03 moritz nom: Assocative.sink
08:03 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Assocative' called (line 1)␤»
08:03 doy it's still very much in progress, but that's what it looks like currently
08:04 moritz doy: thanks
08:05 doy the test suite covers a decent range of things
08:06 moritz though it's really class syntax, not MOP syntax
08:07 doy what would 'mop syntax' even mean?
08:08 doy i was just using 'p5-mop' as the name of the project
08:08 moritz well, Perl 6 has the $class.^meta_method syntax for accessing the MOP
08:08 moritz erm, s/class/object/
08:08 replore joined #perl6
08:15 replore_ joined #perl6
08:19 pomysl_ joined #perl6
08:34 Psyche^ joined #perl6
08:37 au whee, got a PD strategy that reliably wins over all other strategies in rakudo (not yet tested niecza).
08:38 moritz PD?
08:38 au iterated prisoner's dilemma
08:38 moritz \o/
08:38 moritz au: then submit away :-)
08:38 au nah :)
08:39 au I'll just post here instead: https://gist.github.com/1851858
08:39 au you'll see why I won't submit :)
08:39 sorear \o/ au \o/
08:39 colomon :p
08:39 moritz :-)
08:39 sorear long time no see
08:40 au # 792 au 600 bad good random 502 evil-tit-for-tat tit-for-tat
08:40 au sorear: indeed!
08:40 moritz wait, WHAT? :-)
08:41 moritz ah, now I understand
08:41 moritz au: it does deserve a dishonorable mention :-)
08:42 au then mention away :)
08:43 sorear au: What do the numbers mean?
08:43 au sorear: they're respective scores from each strategy
08:43 au output from moritz++'s https://gist.github.com/1710688
08:44 sorear Why are there numbers before only some strategies?
08:44 sorear I haven't been playing this game.
08:44 au it's 600 bad, 600 good, 600 random
08:44 au I just merged them a bit
08:45 moritz that solution does unify the numbers a bit :-)
08:45 au the-monkey-ministry-of-truth.p6
08:47 moritz au: I expected a submission somewhat like yours (though I expected fiddling with the harnesses lexicals), but not from you :-)
08:47 au well, the aim of this strategy is precisely to game against harness lexicals
08:48 au since I expect they'll just tweak truth value but not the .does'ness
08:48 sorear why does gaming .Stringy affect anything?
08:49 au sorear: the lookup table is %scoring{"$current-a $current-b"}.
08:49 moritz I thought more along the lines of pir::find_caller_lex__PS('@scores') = (1000, 0);
08:49 sorear ah
08:49 au moritz: *nod* though that's rakudo specific
08:49 sorear au: how've things been for yu?
08:49 moritz au: right
08:50 sorear @CALLER::scores = (1000, 0); # (:
08:50 moritz sorear: yeah, but according to spec that's only allowed if @scores is declared as contextual, no?
08:51 au also that kinda depends on the lexical order of your strategy
08:51 sorear moritz: the specs seem to be very confused about what contextual means
08:51 au so you'd need to call your strategy name something like "\x00"
08:51 sorear but I concede that
08:52 moritz au: well, it'd need to check &a and &b too, to do it the right way
08:52 au sorear: things are good. I've been @Paris this week and staying for two more weeks.
08:52 sorear TimToady has made clear that most variables are supposed to be protected from monkeying by default
08:52 au moritz: yup. tbh I started with that but couldn't quite get it to work without using rakudo internals
08:53 sorear awesome
08:53 * sorear wants to be a world traveller someday
08:53 moritz @CALLER::scores = &Caller::a === $?ROUTINE ?? (1000, 0) !! (0, 1000) # though NYI in rakudo
08:53 au exactly.
08:53 moritz oh wait
08:54 moritz using === on closures is also a bad idea
08:54 sorear &CALLER::, ne?
08:54 moritz yes
08:54 moritz and &?ROUTINE
08:54 moritz so, clearly untested code :-)
08:54 moritz rakudo now has .static-id to compare closures while disregarding their clonedness
08:55 moritz nom: sub gen($x) { sub () { $x } }; say gen(3) == gen(5); say gen(3).static_id === gen(5).statid_id
08:55 p6eval nom f9fcb2: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤:(Mu:U \$v, Mu %_!)␤␤  in method Numeric at src/gen/CORE.setting:657␤  in sub infix:<==> at src/gen/CORE.setting:2297␤  in block <anon> at /tmp/nyvUb6opy7:1␤␤»
08:55 moritz nom: sub gen($x) { sub () { $x } }; say gen(3) === gen(5); say gen(3).static_id === gen(5).statid_id
08:55 p6eval nom f9fcb2: OUTPUT«False␤Method 'statid_id' not found for invocant of class 'Sub'␤  in block <anon> at /tmp/c_rpT6JxfG:1␤␤»
08:55 moritz nom: sub gen($x) { sub () { $x } }; say gen(3) === gen(5); say gen(3).static_id === gen(5).static_id
08:55 p6eval nom f9fcb2: OUTPUT«False␤True␤»
08:55 sorear cute, although I still think there should be a way to talk about subs without talking about *any* instantiation
08:55 moritz meh. Helps to spell
08:56 moritz sorear: probably, yes
08:56 moritz (fwiw I've needed that for the internals of the backtrace printer)
08:57 au -> breakfast + more touristy stuff &
08:58 sorear -> sleep
09:01 replore_ joined #perl6
09:07 au moritz: another won't-submit-and-please-don't-mention strategy is this...
09:07 au Evil => -> *% { for %strategies.keys.sort -> $k { print 1 if $k eq 'Evil'; say "0\t$k" }; exit }
09:07 au but I'm sure you've thought of that already :
09:07 au :)
09:08 moritz au: :-)
09:08 moritz I did think of fiddling with %strategies, though not in that way
09:09 au I guess this is a bit faster. maybe put it in an INIT block for additional performance gains :)
09:10 * au goes afk for real to refrain from turning a simple friendly PD game into CoreWars
09:10 jnthn moritz: Not got a build handy to ry this but http://6guts.wordpress.com/2012/01/29/this-months-rakudo-star-release-and-whats-coming-next/#comment-148
09:10 jnthn *try
09:11 moritz jnthn: I'll try it
09:11 moritz nom: pir::say pir::can__IPs(Associative, 'sink')
09:11 p6eval nom f9fcb2: OUTPUT«1␤»
09:12 moritz nom: Associative.sink
09:12 p6eval nom f9fcb2: OUTPUT«Method 'sink' not found for invocant of class 'Associative'␤  in <anon> at src/gen/Metamodel.pm:1163␤  in block <anon> at /tmp/vmOvXm44UM:1␤␤»
09:12 moritz jnthn: that one currently blocks me from properly sinking traits
09:12 jnthn moritz: er, associate is a role...
09:12 jnthn *Associative
09:12 moritz ... and?
09:13 jnthn Just wondering where it's showing up
09:13 jnthn In its type object form
09:13 moritz jnthn: it's a return value from a trait
09:13 jnthn oh.
09:14 moritz probably from 'does Associative' or so (while compiling the setting)
09:15 jnthn nom: role Foo { }; pir::say pir::can__IPs(Foo, 'bar')
09:15 p6eval nom f9fcb2: OUTPUT«1␤»
09:15 jnthn ah
09:15 jnthn yeah, pir::can calls find_method. On a role this always returns something that when invoked puns the role
09:16 jnthn It would probably pun and then check.
09:16 jnthn And only then return something.
09:16 moritz eeks.
09:16 jnthn s/would/should/
09:17 jnthn nom: say so Associative.can('sink')
09:17 p6eval nom f9fcb2: OUTPUT«False␤»
09:17 jnthn That is more honest :)
09:18 jnthn I can probably fix it so the pir::can is honest too :)
09:18 moritz I'd prefer that to emitting .can('sink') calls
09:20 jnthn https://github.com/rakudo/rakudo/blob/sink/src/Perl6/Metamodel/RolePunning.pm
09:20 jnthn the find_method in there wants a tweak
09:20 jnthn instead of just returning the closure, do
09:20 jnthn pir::can__IPs($!pun, $name) ?? ...the closure... !! nqp::null()
09:20 jnthn (by "the closure" I mean the pointy at the end)
09:21 kaleem joined #perl6
09:23 moritz I'll try that
09:27 ab5tract joined #perl6
09:30 moritz fwiw I can't reproduce the hang in the UP6 example
09:30 moritz with newest rakudo, that is (haven't tried with the release)
09:35 moritz and I've checked various typical errors (additinal newline at the end, file not found) and none gave me a hang
09:38 jnthn oddness
09:39 moritz also I don't understand "Program stop on: for $file.lines -> $line"
09:39 moritz where does he get that information?
09:39 cogno joined #perl6
09:40 jnthn Maybe by putting print statement befoer that line and seeing it outputs? :)
10:23 noam joined #perl6
10:30 tarch joined #perl6
10:33 JimmyZ_ joined #perl6
10:33 noam joined #perl6
10:35 noam joined #perl6
10:47 masak good almost-noon, #perl6.
10:48 moritz good lunchtime, masakist
10:48 masak http://vimeo.com/36579366 has exceeded all my expectations. you must now all watch it.
10:49 moritz if that's the one from Mr. Victor, I must disappoint you
10:49 moritz I've already watched it :-)
10:49 masak then you don't have to watch it again.
10:50 masak everyone else does, though.
10:50 moritz and yes, it is very inspiring.
10:50 moritz it made me want to write Term::ReadKey in Perl 6, so that we can get closer to interactivity
10:52 Teratogen noscript is saying no to so many sites on that vimeo url
10:52 Teratogen I give up.  It's just not going to play.
10:52 moritz yes, it's quite a hassle. But well worth it
10:53 moritz you can just make a temporary excpetion for all sites.
10:53 Teratogen is it on youtube?
10:54 masak not that I know of.
10:55 Teratogen ok let me try "allow all scripts"
10:55 Teratogen although I normally don't do that
10:58 masak moritz: when I watch this, I feel like he's successfully written a lot of tools that have only been a glimmer in my eye, or even less than that.
10:59 * JimmyZ_ can't  viist http://vimeo.com/36579366
10:59 JimmyZ_ *visit
11:00 masak vimeo is petty-bourgeoise and must be suppressed!
11:02 JimmyZ_ I can't search "学习" in google too
11:03 masak wtf
11:04 JimmyZ_ I don't think study in google should be suppressed :(
11:04 moritz I think China has a political interest to make Google less useful than Baidu
11:04 masak to be honest, I don't think anything should be suppressed. :(
11:06 JimmyZ_ well, baidu search result is  filterd by polity
11:08 JimmyZ_ *filtered
11:11 tarch_ joined #perl6
11:15 tarch__ joined #perl6
11:15 moritz niecza: class A { method x($y) { say $y }; method call-x() { $.x(3) } }; A.new.call-x
11:15 p6eval niecza v14-42-g1d02da9: OUTPUT«Unhandled exception: No value for parameter '$y' in 'A.x'␤  at /tmp/6atFpM7H7T line 0 (A.x @ 1) ␤  at /tmp/6atFpM7H7T line 1 (A.call-x @ 3) ␤  at /tmp/6atFpM7H7T line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤  at /h…
11:15 moritz that one totally messes up XML::Writer on niecza
11:16 * moritz submits nieczabug
11:16 masak why is it that all software feels like crap after watching someone like Bret Victor?
11:17 moritz because he spends an highly above-average effort on polishing his stuff
11:17 moritz and not just polishing
11:18 daxim joined #perl6
11:18 masak sure it's polished. but even the underlying ideas should have more recognition and be more commonly known.
11:18 moritz perl6: class A { method x($y) { say $y }; method call-x() { $.x(3) } }; A.new.call-x
11:18 p6eval niecza v14-42-g1d02da9: OUTPUT«Unhandled exception: No value for parameter '$y' in 'A.x'␤  at /tmp/G8ufQvzFQQ line 0 (A.x @ 1) ␤  at /tmp/G8ufQvzFQQ line 1 (A.call-x @ 3) ␤  at /tmp/G8ufQvzFQQ line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤  at /h…
11:18 p6eval ..rakudo f9fcb2: OUTPUT«3␤»
11:18 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected "-"␤    expecting "::", "handles", "is", bare trait, subroutine parameters, trait or block␤    at /tmp/3xe7cdqicc line 1, column 47␤»
11:21 MayDaniel joined #perl6
11:27 Tarmvred joined #perl6
11:38 birdwindupbird joined #perl6
11:42 am0c joined #perl6
11:54 masak nom: sub step($s) { $s.subst(/^(\(+)(\)+)\(/, -> $/ { [~] "()" x ($1.chars - 1), "(" x ($0.chars - $1.chars + 2), ")" }) }; .say for "()()()", &step ... "((()))"
11:54 p6eval nom f9fcb2: OUTPUT«()()()␤(())()␤()(())␤(()())␤((()))␤»
11:54 masak niecza: sub step($s) { $s.subst(/^(\(+)(\)+)\(/, -> $/ { [~] "()" x ($1.chars - 1), "(" x ($0.chars - $1.chars + 2), ")" }) }; .say for "()()()", &step ... "((()))"
11:54 p6eval niecza v14-42-g1d02da9: OUTPUT«()()()␤(())()␤()(())␤(()())␤((()))␤»
11:54 masak \o/
11:57 Teratogen masak, can I ask why you used a sigil on step (&step)
11:58 masak because I talk about the function as an object.
11:58 masak without the sigil, it's a function call.
11:58 Teratogen I thought in Perl 5 at least supposed to be moving away from using sigils for subroutines
11:58 masak yes, but Perl 5 has a different convention there.
11:58 Teratogen ok
11:58 Teratogen Don't get me wrong, I love sigils.
11:58 masak basically, in older Perls you had to use the '&' sigil to make a function call.
11:59 Teratogen And I think sigil invariance (is that what it is called) is a big mistake.
11:59 masak there were syntaxes such as '&foo()' and 'do foo' to make calls.
11:59 masak sigil invariance is what Perl 6 does. where @array is always @array, even when you @array[$index].
12:00 masak I've met others who think it's a bad idea too. it's a small minority, though.
12:00 Teratogen Yes, I don't like sigil invariance.
12:00 masak feel free to load a pragma to make things interesting for you, then :)
12:00 Teratogen to me, $array[$index] makes a lot more "sense".
12:00 masak ok.
12:00 Teratogen Maybe that's because I have never tried to program in Perl 6.
12:01 masak we won't change it just for you. :)
12:02 Teratogen baw
12:07 snearch joined #perl6
12:08 ab5tract joined #perl6
12:08 cogno joined #perl6
12:11 masak eval: my $L = 13; my $s = "[]" x $L; my $t = 1; until ($s eq "[" x $L . "]" x $L) { $s =~ s/ ^ ( \[+ ) ( \]+ ) \[ / "[]" x (length($2) - 1) . "[" x (length($1) - length($2) + 2) . "]" /xe; $t++ }; print $t
12:11 buubot_backup masak: 7429001
12:12 masak eval: my $L = 13; my $s = "[]" x $L; my $t = 1; until ($s eq "[" x $L . "]" x $L) { $s =~ s/ ^ ( \[+ ) ( \]+ ) \[ / "[]" x (length($2) - 1) . "[" x (length($1) - length($2) + 2) . "]" /xe; $t++ }; $t
12:12 buubot_backup masak: 742900
12:12 masak that's better :)
12:12 masak this takes 3 seconds in the Linux VM on my laptop.
12:12 Teratogen Speaking of VMs, I am thinking about getting a VPS.
12:12 masak the corresponding Perl 6 program (based on those above) is still running, and will probably run for an hour.
12:13 masak so, for this particular use case, with just a lot of strings being generated, and no IO in the middle, there's a factor of 20 difference between Perl 5 and Perl 6.
12:14 fsergot joined #perl6
12:15 masak fsergot! \o/
12:15 fsergot hi o/ :)
12:16 jnthn masak: Would be interesting to profile it.
12:16 fsergot how are You masak? :)
12:16 masak fsergot: I am good fsergot how are you_
12:17 masak ?
12:18 fsergot masak: I'm good too. :)
12:20 whiteknight joined #perl6
12:21 noam joined #perl6
12:24 masak fsergot: written anything cool in Perl 6 yet?
12:25 jnthn nom: say "ice"
12:25 p6eval nom f9fcb2: OUTPUT«ice␤»
12:25 jnthn It's easy to write cool things in Perl 6 \o/
12:25 masak nom: say Cool
12:25 p6eval nom f9fcb2: OUTPUT«Cool()␤»
12:27 pmurias joined #perl6
12:32 noam joined #perl6
12:35 * moritz works on prisoner's dilemma visualizations
12:35 moritz it seems that generating the visualizations takes about 10x more time than running the strategies :-)
12:42 fsergot masak, not yet. I'm still learning p6 :)
12:42 moritz the two don't contradict :-)
12:43 fsergot masak: i hope it'll change in the near future. :)
12:43 fsergot :)
12:44 fsergot Right :)
12:51 masak fsergot: it's not possible to learn Perl 6 well without writing it. at least not for me.
12:51 masak by which I mean "writing Perl 6 code", not necessarily "implementing Perl 6 itself"
12:52 fsergot masak: I write a lot of code. :)
12:54 fsergot but this code isn't cool :P
12:56 masak hehe
12:57 masak perl6: say "This code ", <is isn't>.pick, " cool."
12:57 p6eval rakudo f9fcb2: OUTPUT«This code isn't cool.␤»
12:57 p6eval ..pugs b927740, niecza v14-42-g1d02da9: OUTPUT«This code is cool.␤»
12:57 masak :)
12:58 masak see? whether code is cool or not is a matter of perspective :)
12:59 flussence perl6: say <solid liquid gas plasma handwavey-sciencey-stuff>.pick; # annual vapourware status check :)
12:59 p6eval rakudo f9fcb2: OUTPUT«liquid␤»
12:59 p6eval ..niecza v14-42-g1d02da9: OUTPUT«gas␤»
12:59 p6eval ..pugs b927740: OUTPUT«plasma␤»
13:00 moritz :-)
13:00 fsergot :)
13:00 masak Niecza is clearly vapourware.
13:00 masak probably because it doesn't have a homepage :P
13:00 flussence it's cookin'!
13:00 * masak .oO( this implementation's a gas! )
13:00 Teratogen o/~ hey good lookin' / whatchya got cookin'? o/~
13:02 GlitchMr joined #perl6
13:07 noam joined #perl6
13:11 bluescreen10 joined #perl6
13:20 masak nom: sub foo { my $value = "HAHAHA DISREGARD THAT"; our sub bar { say $value } }; our &bar; bar()
13:20 p6eval nom f9fcb2: OUTPUT«Any()␤»
13:21 moritz perl6: sub foo { my $value = "HAHAHA DISREGARD THAT"; our sub bar { say $value } }; our &bar; bar(); foo; bar
13:21 p6eval niecza v14-42-g1d02da9: OUTPUT«Any()␤Any()␤»
13:21 p6eval ..pugs b927740: OUTPUT«*** Cannot use Undef as a Code object␤    at /tmp/Rcrpv9o_AR line 1, column 88-93␤»
13:21 p6eval ..rakudo f9fcb2: OUTPUT«Any()␤HAHAHA DISREGARD THAT␤»
13:21 moritz I'd submit a bug report if I knew which one is wrong :-)
13:22 masak rakudo is correct here.
13:22 masak &bar gets re-bound upon &foo entry.
13:24 shinobicl_ joined #perl6
13:30 [Coke] (multics years) weird, I know someone whose nickname is multics.
13:42 shinobicl_ perl6: class D is Date { has Bool $.ok is rw; multi method new(Str $datespec, Bool $ok) { $.ok = $ok; nextwith($datespec) } }; my D $var = D.new("2010-01-01", Bool::False);
13:43 p6eval rakudo f9fcb2: OUTPUT«Cannot look up attributes in a type object␤  in method ok at src/gen/CORE.setting:1392␤  in method new at /tmp/eVkxdjuy2k:1␤  in block <anon> at /tmp/eVkxdjuy2k:1␤␤»
13:43 p6eval ..niecza v14-42-g1d02da9: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Unhandled trait Date for this context at /tmp/khN8rum5Ql line 1:â�¤------> [32mclass D is Date [33mâ��[31m{ has Bool $.ok is rw; multi method new([0mâ�¤â�¤Potential difficulties:â�¤  $var is declared but not used at /tmp/khN8rum5Q…
13:43 p6eval ..pugs b927740: OUTPUT«*** Class prototype occured where its instance object expected: D␤    at /tmp/5KDykIpPlf line 1, column 84-94␤       /tmp/5KDykIpPlf line 1, column 84-94␤»
13:43 shinobicl_ i'm not sure how should i use "nextwith"
13:44 masak perl6: sub foo { constant value = "OH HAI"; our sub bar { say value } }; our &bar; bar()
13:44 p6eval niecza v14-42-g1d02da9: OUTPUT«Potential difficulties:â�¤  &foo is declared but not used at /tmp/AsRm9qPC9W line 1:â�¤------> [32msub foo [33mâ��[31m{ constant value = "OH HAI"; our sub bar[0mâ�¤â�¤OH HAIâ�¤Â»
13:44 p6eval ..rakudo f9fcb2: OUTPUT«OH HAI␤»
13:44 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected "="␤    expecting ":" or "("␤    at /tmp/Lz81jx2WOV line 1, column 26␤»
13:44 masak perl6: sub foo { constant $value = "OH HAI"; our sub bar { say $value } }; our &bar; bar()
13:44 p6eval niecza v14-42-g1d02da9: OUTPUT«Potential difficulties:â�¤  &foo is declared but not used at /tmp/3HoPPSo5BX line 1:â�¤------> [32msub foo [33mâ��[31m{ constant $value = "OH HAI"; our sub ba[0mâ�¤â�¤OH HAIâ�¤Â»
13:44 p6eval ..rakudo f9fcb2: OUTPUT«OH HAI␤»
13:44 p6eval ..pugs b927740: OUTPUT«*** Cannot use Undef as a Code object␤    at /tmp/iBo9fGxXXM line 1, column 79 - line 2, column 1␤»
13:45 moritz shinobicl_: first you can't assign to $.ok in method new, because no object has been created yet
13:45 masak shinobicl_: .new is usually a "static method" (or "class method") in Perl 6.
13:46 masak shinobicl_: generally, a constructor in Perl 6 is just a method that calls .bless on a type object.
13:47 masak (which is why, as moritz++ said, you can't access the attributes, because 'self' is the type object and not the new instance)
13:47 moritz nom: class D is Date { has $.ok; method new(Str $datespec, $ok) { my $new = self.Date::new($datespec); $new.MYBUILD($ok) }; submethod MYBUILD($ok) { $!ok = $ok } }; say D.new('2012-02-12', True);
13:47 p6eval nom f9fcb2: OUTPUT«Nominal type check failed for parameter '$datespec'; expected Str but got Int instead␤  in method new at /tmp/3IQniH5cEy:1␤  in method new at src/gen/CORE.setting:8967␤  in method dispatch:<::> at src/gen/CORE.setting:784␤  in method new at /tmp/3IQniH5cEy:1␤  in bloc…
13:48 shinobicl_ if the object does not exists yet, how can i use "self" then?
13:48 moritz shinobicl_: in a class method, 'self' refers to the type object
13:49 Trashlord joined #perl6
13:49 moritz nom: class D is Date { has $.ok; method new(Str $datespec, $ok) { my $new = callwith($datespec); $new.MYBUILD($ok) }; submethod MYBUILD($ok) { $!ok = $ok } }; say D.new('2012-02-12', True);
13:49 p6eval nom f9fcb2: OUTPUT«Nominal type check failed for parameter '$datespec'; expected Str but got Int instead␤  in method new at /tmp/mvhbMEHl6n:1␤  in method new at src/gen/CORE.setting:8967␤  in <anon> at src/gen/Metamodel.pm:2533␤  in call_with_args at src/gen/Metamodel.pm:2530␤  in block…
13:49 moritz why Int?
13:50 masak no idea.
13:50 jnthn And, uh, why is your new ABOVE a new method in CORE.setting in the backtrace?
13:51 [Coke] moritz: (self refers to class in class method) Ew.
13:51 * [Coke] would prefer it were spelled "class" then.
13:51 jnthn [Coke]: It refers to the type object.
13:51 jnthn There IS no class object in Perl 6.
13:52 [Coke] moritz: (self refers to type in class method) Ew.
13:53 moritz it is consistent with the rest of the p6 OO model
13:53 jnthn It works out pretty well in general.
13:53 * [Coke] tries to find the code snippet moritz was commenting on.
13:53 jnthn I do miss it being this way in toher languages.
13:53 jnthn *other
13:55 [Coke] ah, this is related to the distinction between BUILD and new, which is also ew.
13:55 * [Coke] looks forward to reading the "perl6 for java programmers" guide that explains all of this to Coke et al. ;)
13:55 moritz something is very Ew in the whole example
13:56 dalek rakudo/sink: f9e18ea | moritz++ | src/Perl6/ (2 files):
13:56 dalek rakudo/sink: fix pir::can on roles. jnthn++
13:56 dalek rakudo/sink: review: https://github.com/rakudo/rakudo/commit/f9e18eaff8
13:56 moritz but I'm a bit distracted
13:58 moritz perl6: my @a = [1, 2], [3, 4]; say @a.map({.reverse.item}).perl
13:58 p6eval rakudo f9fcb2, niecza v14-42-g1d02da9: OUTPUT«([2, 1], [4, 3]).list␤»
13:58 p6eval ..pugs b927740: OUTPUT«(2, 1, 4, 3)␤»
14:00 masak [Coke]: +1 on what moritz and jnthn is saying. 'self' referring to the type object is perfectly a-OK with the rest of Perl 6.
14:01 masak [Coke]: if you want the invocant of a "class method" to be called '$class', consider naming the invocant in the method signature.
14:01 masak also, cf. Perl 5, where exactly the same rules apply (except that Perl 5 doesn't even have a default term 'self').
14:04 shinobicl_ class D { has $.x; has $.y; multi method new(:x!, :y!) { my $ret = self.bless(*, :x, :y) }   }; my D $var = D.new(x=>100, y=>200); say $var.perl;
14:05 shinobicl_ oops sorry didnt meatn to post that here
14:06 masak thanks anyway. looks good. :)
14:06 masak the only reason you're declaring your own .new there is because your nameds are required, I guess?
14:07 shinobicl_ rakudo: class D { has Int $.x; has Int $.y; multi method new(:$x!, :$y!) { my $ret = self.bless(*, :$x, :$y); return $ret }   }; my D $var = D.new(x=>100, y=>200); say $var.perl;
14:07 p6eval rakudo f9fcb2: OUTPUT«D.new(x => 100, y => 200)␤»
14:07 masak hm, if you make it multi, does that mean that a call without the required named arguments dispatches to the .new in Mu?
14:07 moritz yes
14:07 masak rakudo: class D { has Int $.x; has Int $.y; multi method new(:$x!, :$y!) { my $ret = self.bless(*, :$x, :$y); return $ret }   }; my D $var = D.new(x=>100); say $var.perl
14:07 p6eval rakudo f9fcb2: OUTPUT«D.new(x => 100, y => Int)␤»
14:07 masak \o/
14:07 shinobicl_ i want to have a subclass of Date, and i want to implement as many constructors as Date has
14:07 masak ah.
14:08 PerlJam multis++
14:09 bluescreen10 joined #perl6
14:09 moritz it might be a bit harder than necessary because the Date constructors aren't writen with inheritance in mind
14:10 moritz it is often not a good idea to inherit from value types; if you do, you have to take extra care
14:10 shinobicl_ so, my problem now is that i want to have a Date plus the x and y members.... so i must call "nextwith" and "glue" it the x and y values
14:10 shinobicl_ and i'm not sure how to do that
14:12 PerlJam shinobicl_: Why do you want a Date to also have and X and Y ?
14:12 tokuhirom joined #perl6
14:13 shinobicl_ ok X and Y is just an example, but what i want to do is to add a _complex_ attribute to a date. This attribute is an object itself
14:13 shinobicl_ i want to represent a date PLUS a "calendar" object
14:13 shinobicl_ class Workdate is Date { has WorkdayCalendar $.calendar is rw ........
14:14 shinobicl_ so i can have a constructor liek this:
14:14 shinobicl_ my Workdate $w_date = Workdate.new(year=>2011, month=>12, day=>09, calendar=>WorkdayCalendar.new($calendar));
14:14 moritz shinobicl_: also Date objects are immutable. If you make a mutable subclass, make sure to override the WHICH method
14:14 moritz otherwise you'll break a whole lot of assumptions
14:14 kaleem joined #perl6
14:14 shinobicl_ moritz: noted
14:16 shinobicl_ so... if i want a constructor like that, i should overload the new methoids in "Date" so they accept the $.calendar attribute, or use a 'default' new calendar if not specified. Something like this:
14:17 shinobicl_ (defined inside Workdate class...)    multi method new(:$year!, :$month, :$day, :$calendar = WorkdayCalendar.new) {  $.calendar = $calendar;  return nextwith(year=>$year, month=>$month, day=>$day);  }
14:17 shinobicl_ well i know that this is not gonna work... is just to express the general idea
14:21 moritz nom: class D is Date { method new(|$args) { nextwith(|$args) } }; say D.new('2011-01-14');
14:21 p6eval nom f9fcb2: OUTPUT«2011-01-14␤»
14:21 moritz nom: class D is Date { method new(|$args) { nextwith(|$args) } }; given D.new('2011-01-14') {say .WHAT; .say };
14:21 p6eval nom f9fcb2: OUTPUT«D()␤2011-01-14␤»
14:21 moritz nom: class D is Date { method new(|$args) { my $obj = callwith(|$args); $obj } }; given D.new('2011-01-14') {say .WHAT; .say };
14:21 p6eval nom f9fcb2: OUTPUT«D()␤2011-01-14␤»
14:23 moritz nom: class D is Date { has $.x is rw; method new(|$args) { my $obj = callwith(:$x, |$args); $obj.x = $x; $obj } }; given D.new('2011-01-14') {say .WHAT; .say };
14:23 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤Variable $x is not declared␤at /tmp/3fPKg8BDkK:1␤»
14:23 moritz nom: class D is Date { has $.x is rw; method new(:$x, |$args) { my $obj = callwith(|$args); $obj.x = $x; $obj } }; given D.new('2011-01-14') {say .WHAT; .say };
14:23 p6eval nom f9fcb2: OUTPUT«D()␤2011-01-14␤»
14:23 moritz nom: class D is Date { has $.x is rw; method new(:$x, |$args) { my $obj = callwith(|$args); $obj.x = $x; $obj } }; given D.new('2011-01-14', :x<foo>) {say .WHAT; .say .x.say};
14:23 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2␤»
14:23 moritz nom: class D is Date { has $.x is rw; method new(:$x, |$args) { my $obj = callwith(|$args); $obj.x = $x; $obj } }; given D.new('2011-01-14', :x<foo>) {say .WHAT; .say; .x.say};
14:23 p6eval nom f9fcb2: OUTPUT«D()␤2011-01-14␤foo␤»
14:24 moritz shinobicl_: is that something you can work on?
14:24 moritz s/on/with/
14:24 shinobicl_ yes :D thanks... i just don't understand the |... IIRC that was the "flatten" operator...
14:25 moritz correct
14:25 moritz in the signature, it captures all the rest of the argument list
14:25 moritz and in the paramter list, it interpolates everthing from $args in the parameter list
14:25 shinobicl_ oh, so instead of bless, you create a new object with callwith (that calls the parent 'new'). Now that the object exists you can assign $.x
14:26 moritz yes (though inside new it's not called $.x)
14:26 shinobicl_ (brb)
14:30 shinobicl_ cool... it now works as i expected... thanks moritz... now i think i can finish my Workdaycalendar library :D
14:30 shinobicl_ thank you very much! going back to work... bye!
14:32 * moritz thinks that mutable subclasses of value types are a kind of a Liskov violation
14:33 shinobicl_ i'm not sure if i understand that whole sentence... hehehe, but i think you are suggesting that i should look for another way to implement that
14:33 moritz shinobicl_: I'd use delegation
14:34 moritz ie your object has a date, and not is a date
14:35 shinobicl_ i used to have workdate as a parametric role ($calendar was the parameter). I
14:35 shinobicl_ .
14:35 masak moritz: odd -- I feel Liskov is so much easier to uphold if the objects are read-only. :)
14:35 masak no way to call .setWidth and .setHeight on the derived Square, etc.
14:36 moritz masak: yes, that's why it feels weird to introduce mutability in subclasses
14:36 shinobicl_ i'm not familiar with "delegation"... i'll read about that, and maybe return with another few questions :)
14:36 moritz nom: class A { has $.str handles <Str split>; } say A.new(str => 'a sentence with spaces).split(' ').perl
14:36 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤Confused␤at /tmp/_9p47gi072:1␤»
14:37 shinobicl_ the mutability is about the "is rw" part of the $.calendar member?
14:37 moritz nom: class A { has $.str handles <Str split>; }; say A.new(str => 'a sentence with spaces).split(' ').perl
14:37 p6eval nom f9fcb2: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2␤»
14:37 moritz shinobicl_: yes
14:37 moritz nom: class A { has $.str handles <Str split>; }; say A.new(str => 'a sentence with spaces').split(' ').perl
14:37 p6eval nom f9fcb2: OUTPUT«("a", "sentence", "with", "spaces").list␤»
14:37 PacoAir joined #perl6
14:38 shinobicl_ oh i'll remove that part then. i'm, not expert on p6 oop yet :) i put "is rw" in all my class members hehe
14:38 shinobicl_ because until now i didn't understand clearly how to make constructors of that 'bless' part
14:39 shinobicl_ now i think i got it
14:40 masak I avoid "is rw" on anything whenever I can.
14:40 masak that's why it isn't the default :)
14:41 shinobicl_ nom: class D is Date { has $.x is rw; method new(:$x, |$args) { my $obj = callwith(|$args); $obj.x = $x; $obj } }; given D.new('2011-01-14', x=>"foo") {say .WHAT; .say; .x.say};
14:41 p6eval nom f9fcb2: OUTPUT«D()␤2011-01-14␤foo␤»
14:41 [Coke] moritz++ # handles example
14:41 shinobicl_ nom: class D is Date { has $.x; method new(:$x, |$args) { my $obj = callwith(|$args); $obj.x = $x; $obj } }; given D.new('2011-01-14', x=>"foo") {say .WHAT; .say; .x.say};
14:41 p6eval nom f9fcb2: OUTPUT«Method 'static_id' not found for invocant of class 'Mu'␤»
14:41 moritz oops, that's an error from within the backtrace printer
14:42 moritz shinobicl_: wihtout 'is rw' you can't simply assign to $obj.x
14:42 moritz shinobicl_: you could for example add a private method that sets $!x, and call that from within .new
14:43 shinobicl_ ok... seems fine to me.
14:46 jferrero joined #perl6
14:48 masak for those morbidly interested in macros: my latest musings -- https://gist.github.com/1853560
14:53 birdwind1pbird joined #perl6
14:54 dalek rakudo/nom: 1e966bb | moritz++ | src/core/Backtrace.pm:
14:54 dalek rakudo/nom: fix thinko in backtrace printer
14:54 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1e966bb77b
14:55 PacoAir joined #perl6
14:59 moritz masak: good read. It sounds as if you've understood macros now.
14:59 moritz (well, that part of macros)
14:59 * moritz managed not to include a "finally" in that sentence o/
15:00 masak :)
15:00 jnthn masak has FINALLY understood macros?!
15:00 jnthn :P
15:00 masak the fixup at B was something I hadn't understood until this Sunday.
15:03 jnthn All this "Let's talk about X" is making me expect a "WAT" somewhere in here soon :P
15:07 jnthn ooh, there'll be a ninaskajp tomorrow
15:07 jnthn crap, wrong window!
15:07 moritz masak++ # macro post
15:07 jnthn masak: nitpick: B need not happen either...
15:08 jnthn (that is, potentially a macro may be unused)
15:08 moritz and thus boring :-)
15:09 * jnthn is also pondering how well this will fall out of the closure handling he's doing in the serialization work already
15:09 jnthn (for the pre-compiled case)
15:11 jnthn If it's done by actually have a dummy closure being taken and passed in to the quasi incarnation, then we steal the context from that at fixup time, it probably works out very easily.
15:12 jnthn ...to the extend that closure serialization is easy. :)
15:12 jnthn *extent
15:12 moritz well, it's not easy, but jnthn++ does it. So easy for masak++ ;-)
15:13 jnthn :P
15:14 jnthn Sadly, we can't yet serialize ASTs, since they're PAST nodes. Another reason we need QAST.
15:18 masak jnthn: I pondered mentioning that B needn't happen either. since you saw it, I'll point it out.
15:20 pomysl joined #perl6
15:20 pomysl joined #perl6
15:26 noam joined #perl6
15:27 pernatiy joined #perl6
15:28 mtk joined #perl6
15:29 cogno joined #perl6
15:32 whiteknight joined #perl6
15:39 kaare_ joined #perl6
15:40 colomon joined #perl6
15:41 ab5tract joined #perl6
15:43 Psyche^ joined #perl6
15:45 kst joined #perl6
15:46 thou joined #perl6
15:47 jnthn time for the long journey home &
15:51 sivoais joined #perl6
15:54 gfldex nom: my @a 1,2,3; say [+]@a;
15:54 p6eval nom 1e966b: OUTPUT«===SORRY!===␤Confused␤at /tmp/fAcbghOfZs:1␤»
15:54 gfldex nom: my @a 1,2,3; say [+] @a;
15:54 p6eval nom 1e966b: OUTPUT«===SORRY!===␤Confused␤at /tmp/pM8afx1sOf:1␤»
15:54 gfldex nom: my @a=1,2,3; say [+]@a;
15:54 cosimo joined #perl6
15:54 p6eval nom 1e966b: OUTPUT«===SORRY!===␤Confused␤at /tmp/N8kuFNoBKZ:1␤»
15:54 gfldex nom: my @a=1,2,3; say [+] @a;
15:54 p6eval nom 1e966b: OUTPUT«6␤»
15:55 gfldex std: my @a=1,2,3; say [+]@a;
15:55 p6eval std 52f3895: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a row (listop with args requires whitespace or parens) at /tmp/df5cE2jCJ6 line 1:â�¤------> [32mmy @a=1,2,3; say [+][33mâ��[31m@a;[0mâ�¤    expecting any of:â�¤    POSTâ�¤   argument listâ�¤  bracketed infixâ�¤        infix or meta-infixâ�¤
15:55 p6eval ..postfix…
15:55 gfldex i like std's error message a lot better :)
16:01 am0c joined #perl6
16:02 sftp joined #perl6
16:05 tarch__ joined #perl6
16:05 cogno joined #perl6
16:06 masak we all do :)
16:07 tokuhirom joined #perl6
16:14 GlitchMr42 joined #perl6
16:21 MayDaniel joined #perl6
16:23 moritz on my way home I realized why some stuff in the sink branch fails
16:23 moritz traits often return type objects
16:23 moritz and I'm putting them in sink context
16:23 moritz and List.sink wasn't safe when called on the type object
16:24 dalek roast: 2b82f29 | (Solomon Foster)++ | S03-operators/set.t:
16:24 dalek roast: Add proper subset tests.
16:24 dalek roast: review: https://github.com/perl6/roast/commit/2b82f29760
16:24 dalek roast: 9c421d3 | (Solomon Foster)++ | S03-operators/set.t:
16:24 dalek roast: Add superset tests. (with a little help from Rop!)
16:24 dalek roast: review: https://github.com/perl6/roast/commit/9c421d3057
16:26 masak moritz: in other words, the method was written not taking type object invocation into account?
16:27 tarch__ joined #perl6
16:28 emss joined #perl6
16:29 kst joined #perl6
16:32 kaleem_ joined #perl6
16:39 masak $ ./perl6 -e 'macro foo { my $a = "OH HAI"; quasi { say $a } }; foo'
16:39 masak Null PMC access in find_method('gist') in sub say at src/gen/CORE.setting:5932
16:39 masak (this is locally, on the macros2 branch)
16:40 masak I just had a look at the PIR, and to me it *looks* as though the block from the quasi has the correct OUTER.
16:40 masak does anyone have a good way to explain the Null PMC access?
16:41 TimToady does it have it at the right time?
16:42 slavik1 joined #perl6
16:42 TimToady till bs lands, rakudo still has phase issues
16:42 masak well, the PIR is the product of the compilation, so the macro should've done all it wants by then.
16:43 masak I can nopaste the PIR if that helps.
16:43 TimToady won't help me :)
16:43 masak :)
16:43 MayDaniel joined #perl6
16:43 * TimToady has too few braincells to waste any on PIR
16:43 masak hardly helps me either. I find PIR harder to read under nom.
16:44 moritz masak: try with --ll-exception
16:45 masak oh!
16:45 moritz jnthn: regarding https://github.com/rakudo/rakudo/blob/nom/src/Perl6/World.pm#L764 how can the invocation of $precomp ever work if $precomp is false?
16:46 masak I always forget about --ll-exception :)
16:47 moritz jnthn: it seems to be that it should be   if $precomp { $precomp(|@pos, |%named) } else { $compiler_thunk() }
16:49 moritz I'm getting a failure while trying to invoke Any
16:50 am0c_ joined #perl6
16:51 masak moritz: stacktrace doesn't tell me much, I think: https://gist.github.com/1854332
16:52 aoeuhtns joined #perl6
16:53 moritz masak: most likely $a ends up being the Null PMC
16:53 moritz lines 4 and 5 are the mainline
16:54 moritz masak: am I right in guessing that the macro application just pushes PAST nodes onto the current scope (and doesn't enclose anything in a PAST::Block or so)?
16:57 TimToady masak: re http://irclog.perlgeek.de/perl6/2012-02-17#i_5162698 maybe we need 'use MONKEY_VALUES;' to turn on mutability :)
16:58 masak moritz: I don't remember whether the PAST::Block gets included or not. I can check.
16:58 masak yes, clearly the Null PMC is related to $a somehow.
16:58 TimToady moritz: re http://irclog.perlgeek.de/perl6/2012-02-17#i_5162590 I wish we could find some systematic way of detecting when someone has written a method that should be a submethod
16:58 masak or rather, to the failed lookup of $a.
16:59 masak TimToady: heh, I don't find 'is rw' as horrible as monkey patching :P
16:59 TimToady the average Haskell programmer would classify them in the same bucket :)
17:00 TimToady maybe we should change 'is rw' to 'is mutable-under-monad(IO)'  :)
17:01 * masak locks TimToady inside a monad until he lets go of his axes to grind :P
17:02 TimToady you're think of it inside out; it's not a monadstery, but a monadic tribal existence
17:02 TimToady *ing
17:04 au "wow, all these tourists live behind iron bars!"
17:05 au -- monadic monkey
17:06 pmurias -/exit
17:06 mikemol joined #perl6
17:07 pmurias joined #perl6
17:07 * masak .oO( the OOK monad )
17:07 moritz is that related to OOKness?
17:07 TimToady noodnood
17:19 kst joined #perl6
17:23 lateau_ joined #perl6
17:36 pyrimidine joined #perl6
17:38 lateau_ joined #perl6
17:41 Chillance joined #perl6
17:43 mucker joined #perl6
17:48 whiteknight joined #perl6
17:55 simcop2387 joined #perl6
17:57 [Coke] # 02/17/2012 - niecza at 99.88%
17:57 [Coke] "niecza",     20055,     8,   751,  1573, 22387, 23257
17:57 [Coke] "rakudo",     20078,    28,   610,  1863, 22579, 23267
17:57 [Coke] (no change)
17:58 kst joined #perl6
17:59 masak interesting how, as Niecza and Rakudo started comparing test pass numbers, they "got stuck" only a few dozen tests apart. :)
17:59 [Coke] observational bias?
18:00 masak not if you count actual spectests passed. Niecza hasn't been passing this many for more than a month or so.
18:00 masak whereas Rakudo's level has been much more stable in the past months.
18:00 pyrimidine joined #perl6
18:06 [Coke] yes. we started observing when niecza's growth was stable, I thought. then observation, then rapid growth to match rakudo, now stability.
18:08 colomon [Coke]: ... hmm, I added over 100 new tests at about 11am this morning...
18:09 kst joined #perl6
18:10 masak hm, I didn't notice before about http://www.lispcast.com/modern-language-wishlist -- that's a really weak definition of "homoiconic".
18:11 masak my definition is much stronger: *all* code is also available as data.
18:16 PerlJam why do all venn diagrams seem to relate 3 things?
18:17 masak because that's the maximum venn diagram that doesn't hurt to look at?
18:18 PerlJam perhaps
18:18 masak you quickly run up against planarity.
18:19 [Coke] colomon: that was probably after my run.
18:19 PerlJam ah, that makes more sense
18:19 PerlJam and I guess it'a another variation on "doens't hurt"
18:19 colomon my all-time favorite venn: http://flowingdata.com/2011/10/28/venn-diagram-platypus-playing-a-keytar/
18:27 sivoais joined #perl6
18:29 fridim_ joined #perl6
18:33 masak colomon: :D
18:35 whiteknight joined #perl6
18:40 TimToady masak: the schedule of school terms has much more to do with niecza's progress curve than anything else
18:40 TimToady sorear++ for not blowing off school *all* the time :)
18:41 masak oh, indeed.
18:41 revdiablo joined #perl6
18:41 masak I wasn't implying being anything less than utterly impressed by the progress in Niecza of late.
18:42 lateau_ joined #perl6
18:42 masak just remarking on my expectations that once Niecza and Rakudo got very similar test pass numbers, either implementation would quickly overtake the other.
18:43 * moritz is stuck with sink
18:43 y3llow joined #perl6
18:44 birdwindupbird joined #perl6
18:44 TimToady and pmichaud++ for keeping his family first, and au++ for learning to pace herself
18:44 flussence .oO( Perl 6: everything, but the kitchen sink's clogged )
18:45 kst joined #perl6
18:45 TimToady "Sink me!"  -- the Scarlet Pimpernel
18:46 masak "Frankly, my dear, I don't give a sink."
18:47 preflex_ joined #perl6
18:47 revdiablo joined #perl6
18:49 PerlJam TimToady++ for being our fearless language designer
18:49 PerlJam :)
18:50 [Coke] Iunno, a little more fear might be a good thing. :)
18:51 lateau_ joined #perl6
18:51 masak have the appropriate amound to fear.
18:51 masak amount*
18:52 TimToady maybe a mound is the appropriate amount
18:52 TimToady but don't be afraid of me, just be afraid of what I might do :)
18:52 moritz now that it turns out that we rarely write Mu as a smart-matcher, can we rename it to Object again?
18:54 masak oh yes please yes
18:54 TimToady well, it's really Any that fills the role of Object; I think of objects as something other than concepts like junctions or failure
18:54 am0c joined #perl6
18:54 PerlJam Calling something "Object" doesn't seem very perlish  ;)
18:54 moritz it was perl6ish about 8 years long
18:55 PerlJam yeah, but that was just a first approximation and everyone knows those are always wrong
18:55 TimToady Illuminati...Nomenclatura...the Cosmic All...non-OO OO...
18:56 TimToady but it's still "most undefined"
18:56 TimToady commuting &
19:02 GlitchMr joined #perl6
19:04 pernatiy joined #perl6
19:09 fridim_ joined #perl6
19:27 TimToady & computing
19:42 lateau_1 joined #perl6
19:46 lateau_ joined #perl6
19:47 alester joined #perl6
19:51 kst joined #perl6
19:56 zby_home_ joined #perl6
19:57 * PerlJam watches DHH's "Why Ruby?" talk and it sounds like he's talking about Perl
20:06 masak url?
20:06 PerlJam http://vimeo.com/17420638
20:06 PerlJam rubyconf 2010
20:06 masak dz
20:07 lateau_ joined #perl6
20:11 raoul joined #perl6
20:14 PerlJam argh ... he says monkey patching is the one thing that makes him happy about ruby
20:16 masak I've heard people wax lyrical about '5.times { ... }' too. :)
20:17 mj41 joined #perl6
20:18 moritz that was stolen from smalltalk, no?
20:19 ksi_ joined #perl6
20:19 moritz whenever I see that, I wonder "is control flow really the task of an integer"?
20:19 Psyche^ joined #perl6
20:21 doy i feel that way about python's "'+'.join(['a', 'b'])" too
20:22 snearch joined #perl6
20:24 moritz looks like somebody did a pass over the perl 5 builtins, and then used the first argument as invocant :-)
20:25 Teratogen cutting and pasting code is never a good idea
20:25 Teratogen but it comes in handy sometimes
20:25 Teratogen except in python
20:26 Teratogen if someone uses a different indentation scheme than you do
20:26 Teratogen good luck cutting and pasting their code
20:27 moritz as a vim user I can just say gg=G
20:28 doy that doesn't work if the changing indentation is meaningful
20:28 Teratogen oh, I use vim, but I don't know what that does
20:28 Teratogen what does gg=G do?
20:29 moritz gg goes to the start of the file
20:29 moritz = re-indents code
20:29 moritz and G stands for the end of the file
20:29 TimToady sometime soon we need to start working on py2p6 and rb2p6 translators :)
20:29 moritz so it re-indents the whole file
20:32 Teratogen how is p52p6 going?
20:34 localhost joined #perl6
20:34 GlitchMr42 joined #perl6
20:37 Teratogen not going?
20:37 Teratogen going once...
20:37 Teratogen going twice...
20:37 masak no-one is working on that right now.
20:38 Teratogen I thought Perl 6 was supposed to be able to run Perl 5 code
20:38 masak it is.
20:38 [Coke] Teratogen: If that's an itch you want to scratch, awesome!
20:39 * masak has been thinking about it recently
20:39 * [Coke] wonders if there is currently a better plan than "embed perl5"
20:40 masak Perl 5 on Parrot would be nice.
20:40 PerlJam "embed perl 5" seems like the best plan to me.
20:40 [Coke] masak: No comment!
20:41 masak please elaborate :)
20:41 * moritz wants a Ponie!
20:41 * masak too!
20:41 au uh, there is a working p5top6 compiler if I'm not mistaken...
20:42 au ...that doubles as p5tojs: http://perlcabal.org/~fglock/perlito5.html
20:42 masak right, perlito.
20:42 moritz au: but that only does a tiny subset of p5
20:42 awwaiid yummy perlito
20:43 masak I sjould look into perlito, to get a handle on what it can and can't do.
20:43 masak should*
20:43 awwaiid recent commits, https://github.com/fglock/Perlito
20:43 au moritz: concurred. it's somewhat useful though, if one'd like to write javascript in perl syntax (instead of, say, in coffeescript syntax)
20:43 moritz au: aye
20:43 masak I'm coming up on such a project.
20:44 * PerlJam likes coffeescript
20:45 PerlJam well ... except for making the ternary op more wordy
20:45 * [Coke] might be odd, but I'd rather write JS in JS. ;)
20:45 au yeah. that ternary thing (among a lot other things) was apparently lifted straight from haskell.
20:46 kst joined #perl6
20:47 * [Coke] would like to get pugs running on his feather login so he can add it to the daily spectest runs!
20:48 [Coke] (speaking of sends from au ~~ /haskell/)
20:48 au set PATH to a dist/pugs built on some other home directory? :)
20:49 [Coke] to get at /a/ running copy, or to somehow bootstrap my own?
20:49 au to get at a running copy
20:49 PerlJam au: btw ... are you "back" or just visiting?  :)
20:49 [Coke] au: any idea why this failure? https://gist.github.com/1827728
20:50 au PerlJam: yes :)
20:50 PerlJam good answer :)
20:50 au [Coke]: I had no idea; haskeline should've defined that instance.
20:53 * [Coke] has, btw, checked out Pugs.hs, cd'd to Pugs, and run "make". (each time running cabal install as it complained). wondering if there's a step that isn't documented.
20:54 au [Coke]: have you tried just "cabal install Pugs"?
20:54 au (affter a "cabal update", of course)
20:56 [Coke] I /think/ that's what make does. I just reset the git repo, trying that.
20:57 [Coke] (does .../Pugs require a pre-built pugs for bootstrapping?)
20:57 au no. it was designed after Hugs, a stand-alone interpreter.
20:58 masak oh, good. leveraging au to get a working Pugs.hs -- [Coke]++
20:59 * masak does a 'cabal update', Justin Case
20:59 [Coke] masak: it feels like cheating, but I'm not above that. ;)
21:00 [Coke] au: once I get it running, I'm going to spend some time refudging the spectest suite, i think. You see any issues there?
21:00 * au marvels at how a complete Pugs compilation with recursive dependencies took just 10min  here
21:00 au (it used to take ~3hrs.) Moore++
21:01 au [Coke]: sounds good.
21:02 [Coke] lining!
21:02 [Coke] *linking!
21:02 flussence .oO( silver linking! )
21:02 au . o O ( slivers linking! )
21:03 [Coke] linking slooww
21:03 colomon . o O ("Lowered him down on a silver chain")
21:04 [Coke] $ /home/coke/.cabal/bin/pugs -e "'woot'.say"
21:04 [Coke] woot
21:04 [Coke] so, I'm guessing the Makefile is broken.
21:04 [Coke] make is running "cabal build", but au said "cabal install Pugs"
21:05 au it's like "cpanm" vs "cpanm Pugs".
21:05 au one is building local checkout, one is fetching from hackage.
21:05 geekosaur yeh, that just means "do the build phase in the current directory"
21:08 au (fwiw, both worked for me on feather with fresh github audreyt/Pugs.hs checkout.)
21:10 au [Coke]: mind if I run "make" in your ~coke/sandbox?
21:11 [Coke] NOOOOOO, go right ahead. ;)
21:11 [Coke] (but now that I did the build, it might ack differently. Iunno)
21:12 [Coke] au: how would you normally run the spectests?
21:12 sorear good * #perl6
21:12 au uh, the last time I hacked perl6, it was before spectests :)
21:12 PerlJam Is someone going to update http://perl6.org/compilers/features.html with pugs info?  :)
21:13 au [Coke]: /home/coke/sandbox/Pugs.hs/Pugs/dist/build/pugs/pugs built just fine.
21:13 au (under "sudo su - coke")
21:13 au so maybe the cabal update picked up a good haskeline release version, or some such.
21:13 [Coke] au - might be because I had a successful install already. *shrug*
21:13 [Coke] right.
21:14 [Coke] no matter, it works now.
21:14 au \o/
21:14 masak sorear! \o/
21:14 masak [Coke]: whatdidyoudo whatdidyoudo!?
21:14 * PerlJam idly wonders if all of the Perl 6 implementors have ever been in #perl6 simultaneously
21:15 au PerlJam: it'll be yellow ± on pretty much all rows :)
21:15 au so, not exactly informative
21:15 masak we'll change that :)
21:15 PerlJam au: sure it will ... as people update it, those rows will change color
21:16 au *nod*
21:17 [Coke] masak: try "cabal install Pugs" instead of "make"
21:17 masak ooh
21:17 * masak tries
21:17 [Coke] github under attack again? :(
21:18 ksi_ joined #perl6
21:18 sorear o/ masak
21:18 sorear o/ o/ au
21:18 au hey sorear :)
21:19 flussence [Coke]: cat thing says yes. https://status.github.com/
21:19 flussence well yes as in "our five nines are under attack!"
21:20 au wow, it's past 10pm already... have a good localtime hackers. -> {sleep}
21:21 flussence eek, page just went red
21:26 masak \o/ # Pugs built!
21:26 masak au++
21:27 masak [Coke]: we should do something about the instructions in INSTALL, though.
21:27 [Coke] masak: I'll let you. I'm glaring at spectests.
21:27 masak oh wait, INSTALL is full of 'cabal install Pugs'
21:27 masak huh!
21:28 masak had I only read this properly, instead of trying to run 'make', it'd probably have worked the first time...
21:28 PerlJam reading++
21:28 [Coke] masak: one of the things does say to run make, though.
21:29 [Coke] https://gist.github.com/1855576
21:29 masak running 'make' still doesn't work.
21:29 masak same error.
21:30 kst joined #perl6
21:30 masak yes, .gist is very new.
21:30 au masak: try "rm -rf Pugs ; git reset --hard"?
21:31 * masak does so
21:34 [Coke] the spectest cleanup is going to be monumental. ;)
21:34 * [Coke] will get something committed this weekend that has at least enough so folks can say "make spectest" and run /something/
21:35 [Coke] s/cleanup/refudge
21:35 sorear au: do you know about git clean -dfx ?
21:35 masak au: same error after "rm -rf Pugs ; git reset --hard"
21:35 masak the one saying 'No instance for (MonadIO (InputT IO))'
21:35 masak [Coke]: aren't you getting this error any more?
21:36 au sorear: I didn't. thanks!
21:39 au masak: I'm reinstalling haskeline for you, a sec.
21:40 masak thanks. I had an error message about haskeline, so I did 'cabal install haskeline' two 'make's ago.
21:40 masak maybe that wasn't enough, though.
21:44 pomysl_ joined #perl6
21:46 au yeah. I ended up doing
21:46 au "ghc-pkg unregister haskeline; cabal install --reinstall haskeline"
21:46 au and that worked.
21:47 au masak: you have an entirely unoptimized build of pugs in ~/Pugs.hs/Pugs/dist/build/pugs/pugs now -- share & enjoy :)
21:47 au (might want to git clean -dfx and rebuild again to get optimized version instead of the fast-building-slow-running "cabal install -O0" one.)
21:47 au g'localtime for real :) &
21:53 * jnthn home :)
21:55 masak au++!
21:55 masak au: thanks!
21:59 [Coke] moritz++ - very easy to copy over the t/* utilities I need from niecza/rakudo
21:59 jnthn masak: #110918 is a dupe
21:59 [Coke] (and quite a few spectests still pass in pugs with no additional fudging!)
22:00 [Coke] au++
22:01 pmurias joined #perl6
22:01 masak jnthn: hm -- it felt a little like one when I submat it.
22:04 [Coke] if I want a t, t/spec hierarchy in pugs, where do I put it? top level? .../Pugs subdir?
22:04 * [Coke] thinks toplevel.
22:05 masak +1
22:07 [Coke] "pugs",       637,     0,     1,     0,   638, 22744
22:07 [Coke] ... that's with about 10m of effort.
22:08 PerlJam Coke++
22:08 masak \o/
22:08 masak this'll be fun!
22:08 masak Coke++
22:09 masak [Coke]: don't forget to push whatever you create in t/spec :)
22:09 masak (the rest of us want to play, too!)
22:10 [Coke] masak: commuting shortly. You'll have something to play with in the morning, OK?
22:13 masak deal.
22:13 masak jnthn: tickets merged, thanks.
22:13 jnthn asbra :)
22:14 masak phenny: sv en "asbra"?
22:14 phenny masak: "asbra" (sv to en, translate.google.com)
22:14 masak translator I am disappoint.
22:14 masak phenny: sv en "bra"?
22:14 phenny masak: "good" (sv to en, translate.google.com)
22:14 masak phenny: sv en "as-bra"?
22:14 phenny masak: "as- well" (sv to en, translate.google.com)
22:15 jnthn fail :)
22:15 masak phenny: sv en "så jävla bra"?
22:15 phenny masak: "so damn good" (sv to en, translate.google.com)
22:15 masak :)
22:16 jnthn Ain't jävla a place just a bit north of Stockholm? :)
22:16 [Coke] masak: hurm. I changed my mind. Here you go:
22:16 dalek Pugs.hs: 466f840 | coke++ | / (5 files):
22:16 dalek Pugs.hs: Run (some) spectests.
22:16 dalek Pugs.hs:
22:16 dalek Pugs.hs: This commit adds in a bunch of tools from niecza/rakudo to run the
22:16 dalek Pugs.hs: spectests, as well as a small list of known-to-pass spectests in
22:16 dalek Pugs.hs: t/spectest.data
22:16 dalek Pugs.hs: review: https://github.com/perl6/Pugs.hs/commit/466f840500
22:17 [Coke] I added some directions/caveats in HACKING.
22:17 [Coke] Please do not eat ALL the low hanging fruit. ;)
22:18 kst joined #perl6
22:18 [Coke] Should be possible to bump that 637 number up to several thousand this evening.
22:19 [Coke] (with only minimal fudging)
22:19 [Coke] ping me with any problems on the HACKING notes. back online in a few hours.
22:20 lestrrat joined #perl6
22:20 masak [Coke]++
22:21 masak jnthn: no, that's "Gävle" :)
22:21 masak but I can see the possibility of confusion there.
22:22 pmurias sorear: what's the slow part of compiling NieczaActions.pm?
22:23 pmurias sorear: or generally what slows down the compilation the most?
22:33 aoeuhtns left #perl6
22:34 rgc joined #perl6
22:35 sorear pmurias: I don't really have a clue.
22:36 sorear I think the memory usage could probably be cut some by hacking in a method to throw away branches of the parse tree that we're done with
22:36 * sorear checks calendar ... good, a whole week until release day
22:38 pmurias sorear: should 2GB of ram be enough?
22:39 pmurias sorear: for the memory usage not to be a problem?
22:39 arlinius joined #perl6
22:40 sorear absolutely
22:40 sorear remember, my dev box has 0.375GB :D
22:40 jnthn You can even compile *RAKUDO* with 2GB and it's currently a memory pig.
22:42 pmurias sorear: is the command flag to show time use per compilation phase still present?
22:43 pmurias sorear: do you recompile niecza with make after making a change or just the file?
22:44 sorear I use make
22:45 sorear if you have a sufficiently new mono (2.8.1+), use MONO_ENV_OPTIONS=--gc=sgen
22:45 sorear that activates the Mono native GC, which saves a bit of memory per object
22:50 pmurias does that speed up stuff?
22:50 sorear usually
22:50 sorear it makes allocations a lot faster, but slows down writes (write barrier)
22:51 sorear niecza makes a lot of garbage...
22:52 diakopter gigo :P
22:58 * masak .oO( Affirming the Consequent )
23:00 ilogger2 joined #perl6
23:00 diakopter wb ilogger2
23:00 masak ilogger2 is the silent, stoic kind of bot.
23:01 masak ilogger2: aren't you? aren't you the silent, stoic kind? yes, you are! yes, you are!
23:01 ilogger2 masak: I am a logger bot. Lines starting with [off] won't be logged. Extra help available at http://colabti.org/irclogger/irclogger_logs.
23:01 * masak ruffles ilogger2's fur
23:01 masak whoa :)
23:02 masak not so silent, I guess. but polite :)
23:02 pmurias sorear: niecza doesn't seem to print the time usage per compiler part anymore
23:02 pmurias with the --verbose flag
23:04 sorear pmurias: yeah, there are no stages anymore
23:04 sorear pmurias: stuff had to be interleaved to make BEGIN work
23:05 kst joined #perl6
23:10 pmurias the stack traces from exceptions are getting annoying :(
23:13 diakopter lol [off] the magic dragon
23:13 masak I thought you might like that one :)
23:13 masak but you just blew our cover :P
23:13 diakopter oops
23:14 diakopter maybe it means off not [off]
23:14 diakopter no
23:22 pmurias sorear: why do we need Run.*.dll?
23:22 benabik Otherwise it won't know how to run?
23:23 pmurias benabik--
23:24 benabik awh
23:24 pmurias benabik: there's both Run.Kernel.dll and Kernel.dll
23:24 sorear pmurias: Run.Kernel.dll is compiled from the current version of lib/*.cs
23:24 sorear Kernel.dll is copied from niecza-14.zip
23:25 sorear by giving them different names, they don't interfere with each other
23:25 pmurias sorear: eval(:from<perl5>,...) throws a casting C# exception when run from NieczaActions.pm6
23:25 pmurias sorear: could it have anything to do with it?
23:26 sorear yes
23:26 sorear I do not endorse calling eval from within the compiler
23:27 sorear the idea is that there are two sandboxed spaces - you can have NieczaActions in user code, and it won't interfere with the compiler
23:27 sorear (this is necessary for bootstrapping)
23:28 sorear eval(:from<perl5>,...) doesn't make the switch from compiler space to user space, so even if it worked, it would be wrong
23:32 pmurias i understand
23:32 pmurias so how can i call the user space eval?
23:38 sorear I'd probably do it by adding a new method to $*unit
23:38 sorear $*unit.foo calls the "unit_foo" method in lib/CodeGen.cs in user space
23:38 sorear that is fundamentally the only way the transition happes
23:57 kst joined #perl6

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

Perl 6 | Reference Documentation | Rakudo