»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:01 stepnem joined
sorear wonders if ey can make it 00:23
00:24 lestrrat left 00:25 lestrrat joined 00:26 whiteknight joined
colomon +1 to sorear and [Coke] making it to YAPC::NA. niecza hackathon! 00:46
sorear heh. I haven't even looked at "where" and "when" yet 00:50
colomon Madison Wisconsin 00:51
June 13-15 00:55
sorear Wisconsin, the one province of the US that I actually have to look up where it is 00:59
(thanks)
colomon we call them "states". ;) 01:07
It's right around the lake from Michigan.
01:13 skids joined
TimToady wait, I'm confused, Michigan is a lake, right? ;) 01:18
sorear thinks "states" is a horrible name, especially when speaking to an int'l audience
TimToady and is Madison named after James or Dolley?
there's the united states, and the untied states... 01:19
TimToady continues to be in the state of confusion
sorear also, why do Americans talk about counties when they've NEVER had counts? 01:23
at least there are priests in Louisiana
skids More importantly, why do some Americans rant about "czars" when they've never had one? 01:27
offby1 do we really rant about czars? 01:43
offby1 mostly rants about bad UI
TimToady czars are 1 off from bad UI :P 01:51
offby1 is enlightened 01:56
02:08 Chillance left
skids How does one fail a regexp from inside a closure without failing the interpreter? 02:10
02:19 Util left 02:20 Util joined 02:21 whiteknight left
TimToady use a <?{ ... }> closure and return false 02:35
02:41 benabik joined 02:43 leprevost left 02:44 bkolera left 03:02 jaldhar joined 03:03 jerome_ left 03:05 jferrero left 03:17 jerome_ joined
colomon niecza: say $*EXECUTABLE_NAME 03:19
p6eval niecza v13-389-g852f0ff: OUTPUT«/home/p6eval/niecza/run/Niecza.exe␤»
03:22 orafu left, orafu joined
colomon niecza: say %*ENV<PERL6LIB> 03:24
p6eval niecza v13-389-g852f0ff: OUTPUT«Any()␤»
colomon tadzik: ping? 03:27
tadzik: unping. Finally figured out where ~/.perl6 is set as the destination for libraries 03:46
03:54 wolfman2000 joined 04:01 kmwallio joined
colomon saddest thing: running a program you think is going to work, and having it simply stop and print "Any()" 04:04
offby1 I can think of sadder 04:10
colomon yeah, probably
still, it's quite annoying 04:11
niecza: die 04:12
p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Died␤ at /home/p6eval/niecza/lib/CORE.setting line 1344 (die @ 3) ␤ at /tmp/wS7piXWxcT line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3607 (modul…
04:14 jaldhar left
diakopter niecza: coredump 04:16
p6eval niecza v13-389-g852f0ff: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'coredump' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1347 (die @ 3) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 33) ␤ at…
diakopter ponders "czars are 1 off..." 04:18
diakopter gives up 04:21
04:22 jaldhar joined 04:39 kmwallio left 04:52 birdwindupbird joined 05:13 jaldhar left
moritz niecza: class A { has $.x; submethod BUILD($a) { $!x = $a } }; A.new('foo') 05:53
p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Excess arguments to Mu.new, used 1 of 2 positionals␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (Mu.new @ 1) ␤ at /tmp/5RPbkW5vm_ line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤ at /home/…
moritz pugs: class A { has $.x; submethod BUILD($a) { $!x = $a } }; A.new('foo') 05:54
p6eval pugs b927740: OUTPUT«*** Must only use named arguments to new() constructor␤ Be sure to use bareword keys.␤ at /tmp/gCepPVcyYH line 1, column 56 - line 2, column 1␤»
06:13 kaleem joined 07:06 ponbiki joined 07:15 birdwind1pbird joined 08:04 birdwind1pbird left 08:11 am0c^ joined
am0c^ is there no such a thing like PERL6_LIB env variable in spec? 08:12
Tene Dunno about spec, but rakudo uses PERL6LIB 08:13
08:15 tarch joined, dbr joined 08:18 wolfman2000 left 08:28 snearch joined 08:39 daxim joined
am0c^ Thanks Tene 08:45
08:50 mj41 joined 09:01 snearch left 09:19 ponbiki left 09:21 kshannon left 09:22 kshannon joined 09:23 fasad joined 09:25 tarch left
moritz and niecza implements the -I command line option 09:31
09:42 am0c^ left 09:47 BooK joined 09:48 Psyche^ joined, BooK_ joined 09:49 Patterner left, Psyche^ is now known as Patterner 09:50 am0c joined
masak good antenoon, #perl6 09:56
interesting discussion over at p6l. 10:05
TheDamian's "Constructor args certainly shouldn't be restricted to just the names 10:06
of public attributes." is especially interesting.
does he mean "private attributes are OK too"? or "other stuff is OK too"?
moritz the latter, judging from his example with dates 10:07
10:07 eiro joined
masak alright, OK. 10:12
then there isn't any discord with his prior statements about encapsulation. goodie. 10:13
moritz at least that's how I read it :-)
masak thing is as far as I know, no-one ever claimed that constructor args would be restricted to the names of public attrs... :) 10:15
maybe if you squint that's the default if you don't override anything.
ah well. I don't yet quite understand what problem is being addressed with the proposed changes, so...
I see the DRY violation that moritz points out, but... that's never been a problem for me in practice, for some reason. 10:16
I usually end up defining my own .BUILD or my own .new -- not so often both of them.
moritz masak: it seems to be unexpected and hard to explain to newcomers, which should be a red flag 10:17
well, the point is, if you use private attributes and a custom .new, you *have* to write a custom BUILD too
and I can't any imagine any reaction to that other than "why the f<explitive deleted> should I have to do that?" 10:18
jnthn morning, #perl6
moritz mrnng, jnthn
jnthn I hope everyone fiddling with object construction is thinking about how to make whatever we settle on possible to do fast as well. :) 10:19
moritz jnthn: I can't speak for everybody, but I do
jnthn :) 10:20
moritz which is another reason I reject pmichaud++'s proposal (from yesterday in the IRC logs) to call another method on the constructed object 10:21
10:21 am0c left
moritz self.bless(*, |%public).PRIVATE(|%private) 10:21
jnthn huh, how'd that work... 10:22
masak o.O
we're meant to make things *easier*.
moritz aye :-)
masak having .new and .BUILD separated is already a head trip for people, who are used to one constructor. 10:23
how about we just re-allow private attrs to be initialized? it's an "I can argue it both ways" issue anyways. 10:24
(in the sense that the act of instantiation in itself is a kind of encapsulation breakage)
moritz dunno if that's possible to do efficiently, but can't we do the private vs. public attributes check is done in .new instead of bless/BUILDALL/BUILD?
then somebody who writes his own .new doesn't have to bother with it anymore 10:25
jnthn moritz: I saw that suggestion and am still wondering how to do it efficiently (more
masak oh! maybe here's an insight. whatever solution we come up with must allow the *class* block to set private attrs at construction (even readonly ones), but nothing outside of it.
jnthn To do it would really mean changing the interface to bless so we can differentiate public vs private there 10:26
Which in turns would mean BUILDALL can
moritz where exactly does the differntiation happen now? 10:27
jnthn moritz: BUILDALL
moritz hm, I do forsee one problem 10:28
class A { has $!x }; class B is A { has $.x }
we need to be careful not to bust that case
jnthn Yeah, that one currently isn't a problem. 10:29
I worry that there's simply too many choices here to make one true sane default
And I'd rather the default be fairly un-magical. 10:30
masak head spin
jnthn We also need to worry about what happens as people refactor (public to private, private to public, etc)
10:35 dbr left
jnthn read through the thread 10:35
10:36 dbr joined
masak jnthn: yes. private to public is the more important one -- I don't mind if making something public private is a bit more work. 10:37
jnthn wonders how much the issue is that we scope attributes lexically to a class, but scope construction to all attributes over the inheritance chain. 10:39
Maybe
10:39 abercrombie left
jnthn self.bless(*, |%named) # will only touch publics 10:39
self.bless(*, A{ x => 42 }) # in this case, a class name was mentioned, and x may initialize A's $!x 10:40
10:40 dbr left
Timbus you touched A's privates :o 10:40
jnthn Timbus: Relax, A seemed to enjoy it :P
So if you're initializing the non-virtual, you're qualifying it. 10:41
10:41 abercrombie joined
jnthn That was, the default .new only initializes publics 10:41
Timbus yes i learned that when my irc bot stopped working :v
jnthn BUT you can write a .new that initializes privates. 10:42
Timbus -ng let me set privates in new and personally i thought that was good?
jnthn And you're made to do it in a way that will still work if the class is subclassed.
moritz Timbus: well, the spec changed
jnthn Timbus: A bunch of people thought it wasn't so good and...what moritz said. So Rakudo just followed that change. :) 10:43
moritz jnthn: I need to think about that, but it does sound interesting
jnthn We do try to implement the spec now and then. :)
moritz: Yes, I need more coffee to ponder that one too.
Timbus i guess readonly public attrs is fine, too
jnthn Timbus: Yes
10:44 dbr joined
moritz Timbus: it made me think about why i wanted to keep some attributes private, and decided there wasn't a good reason to share them with the world 10:44
10:44 dbr left 10:45 dbr joined
fasad hello #perl6 10:45
Timbus lol moritz
10:50 dbr left
masak fasad: greetings, perl6onaut! 10:52
fasad :) so what's a 'package' basically ? 10:53
moritz fasad: it's a relict, mostly
masak it's like a module, but without many of the conveniences of modules. 10:54
moritz so, basically no reason to use one
right?
jnthn It's mostly a "placeholder"
That's its most important role.
moritz ah right
you can stub something as a package
jnthn class A::B { } # A is a Package
note that
moritz and later declare it as a role, class, grammar, ...
jnthn nom: module A { }; module A { }
p6eval nom ce5cca: OUTPUT«===SORRY!===␤Redeclaration of symbol A␤at /tmp/r4U8T98AAu:1␤»
jnthn nom: package A { }; module A { } 10:55
p6eval nom ce5cca: ( no output )
jnthn A package can always have its identity stolen by a module/class/role/grammar etc
Why is why you can do
*Which is...
nom: class A::B { }; class A { }
p6eval nom ce5cca: ( no output )
jnthn And it works.
masak inneresting. 10:56
I did not know this.
fasad jnthn++
jnthn Well, more revealing is
nom: class A::B { }; $A::x = 42; class A { }; say $A::x
p6eval nom ce5cca: OUTPUT«42␤»
jnthn Well, that's sill though 'cus the assignment runs at runtime :) 10:57
moritz I think it took quite some pain until we've figured out all that package stuff
jnthn nom: class A::B { }; BEGIN { $A::x = 42; }; class A { }; say $A::x
p6eval nom ce5cca: OUTPUT«42␤»
jnthn There, that's what I was trying to show. :)
moritz: Yeah...well, we put it off for a while in Rakudo by using Parrot namespaces. :) 10:58
fasad we really need some documentation. looking up the synopses everytime is... ugh :( 11:00
moritz fasad: do you want to become our documentation champion? 11:01
fasad moritz: well i think i could, but then all of you here would be bombarded with questions, mostly trivial ones :p 11:02
moritz fasad: that's OK 11:03
fasad there is a wiki for perl 6: www.perlfoundation.org/perl6/index.cgi?perl_6 . Looks dead !
moritz I think it was locked down due to spam 11:04
or was that reversed? 11:05
masak doesn't really matter -- it's not the final answer anyway.
we need something authoritative, that people treat as authoritative. not Yet Another Wiki.
moritz and that one was really ugly to use 11:06
no, the one authorotative thing should be in a git repo somewhere
fasad moritz: +1 #ugly
masak problem is, the spec will always be authoritative in exactly the way we want, and it will always "win" per default when the docs start to slip and bitrot.
so it's a bit of an uphill battle. 11:07
moritz masak: it simply means we need more people who take care of user docs than who update the specs
fasad so will i have to learn POD then?
fasad wonders why is html bad as a markup language for perl 11:08
moritz fasad: well, first of all it offers no easy option for verbatim code inclusion 11:09
it sucks to have to write <code>if $x &lt; $y {</code>
fasad ok. masak: though the specs will always be authorative, u agree we need something like the perl5 documentation? 11:11
fasad is astonished at his use of 'we' ! 11:12
moritz maybe we can even move stuff out of specs into user docs
for example some of the S32 stuff could well be changed into more user-oriented docs, and then there's no reason for duplicating it 11:13
fasad also, will rakudo, niecza or some new compiler(!) share the documentation? 11:14
moritz well 11:15
I'm sure that rakudo star will ship the docs
but in the form of bundling it, not copying and editing on its own
or maybe importing it for .WHY stuff
fasad moritz: ^^ ? 11:16
moritz fasad: sorry, which part is unclear? 11:17
fasad what is .WHY? #if we had documentaion, i wouldn't be asking :)
moritz there's a way to attach documentation to objects
and ask an object about the docummentation attached to it by calling $stuff.WHY 11:18
fasad masak: i started watching Perl 6 Appetizers (www.youtube.com/watch?v=kOiGF9eRUWY). The first six minutes have no audio :( 11:24
can i rename thw wikipedia page "Rakudo Perl" to "Rakudo Perl 6" ? #need an official name 11:29
moritz sure (but leave a redirect in place) 11:30
11:30 birdwindupbird left
fasad moritz: whenever you renmae a page (called 'moving') on Wikipedia, it automatically creates a redirect 11:31
moritz ah, nice
11:31 snearch joined 11:33 mtk left 11:37 birdwindupbird joined
fasad done 11:45
12:00 Chillance joined 12:09 wolf_ joined
dalek p/bs: 5deb755 | jnthn++ | src/6model/serialization. (2 files):
Refactor serialization code to eliminate a bunch of code duplication and make it more extensible.
12:19
p/bs: 0deef9b | jnthn++ | src/6model/serialization. (2 files):
Similar refactor for deserialization.
jnthn
.oO( To get the day off to a good start, delete 100 lines of code... )
12:20 jferrero joined 12:21 am0c^ joined
masak fasad: oh! it is news to me that the remaining parts of the video *has* audio! 12:34
moritz nom: say 'a' after 'b' 12:39
p6eval nom ce5cca: OUTPUT«False␤»
moritz nom: say 'b' after 'a'
p6eval nom ce5cca: OUTPUT«True␤»
moritz nom: say 10 after 2 12:40
p6eval nom ce5cca: OUTPUT«True␤»
masak fasad: I find that video is pretty useless without the slides. unfortunately, I was never able to put those slides online, because the PDF became too big :( 12:41
fasad: the slides source is online, though: github.com/masak/talks/blob/master...ers/slides
12:52 kaleem left
masak diakopter: fwiw, I didn't get the "czars are 1 off..." thing either. 12:52
fasad masak: i didn't get it either ! 12:54
12:54 skids left 12:55 Chillance left, tokuhirom joined
fasad masak: thanx for the slide source, but it defeats the very purpose of watching a video #fasad is one lazy guy 12:56
masak hehe
in that case, I think that's the wrong video for you. had they filmed the slides, maybe you could've done without the slides source. as it is now, I don't think you'll get much out of it without the source. 12:57
fasad masak: it's all right. who needs the video when you are right here to be pestered to no end... :p 13:00
masak pester away -- I love talking about Perl 6 :)
moritz nom: say 1 cmp 2 13:02
p6eval nom ce5cca: OUTPUT«Increase␤»
masak nom: say 1 cmp 2 cmp 3 13:03
p6eval nom ce5cca: OUTPUT«Increase␤»
13:03 snearch left
masak nom: say 1 cmp 3 cmp 2 13:03
p6eval nom ce5cca: OUTPUT«Increase␤»
moritz std: 1 cmp 3 cmp 2
p6eval std 48335fc: OUTPUT«===SORRY!===␤"cmp" and "cmp" are non-associative and require parens at /tmp/41Bxhgypvu line 1:␤------> 1 cmp 3 cmp ⏏2␤Check failed␤FAILED 00:01 109m␤»
fasad masak: are the slide written in POD ? how do u make slides out of them? maybe i can make them on my own, without the images obviously...
masak fasad: yes, they're written in a subset of Pod6. 13:04
fasad: see github.com/masak/talks/blob/master...esentation
if you whack at that script enough, and have Inkscape installed, eventually slides will fall out.
fasad: are you on Mac OS X?
fasad masak: no. Ubuntu. 13:05
13:05 grondilu joined
masak then you might want to find a way to merge the individual slide PDFs in the end. 13:05
I was on Mac OS X at the time, and it turned out it was easier to just load all individual slide PDFs into Preview, and PgDn from one to the next. 13:06
grondilu perl6: my @a[4]; # of int;
p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Shaped variable declarations are not yet implemented at line 1, near "; # of int"␤»
..pugs b927740: ( no output )
..niecza v13-389-g852f0ff: OUTPUT«===SORRY!===␤␤Postconstraints, and shapes on variable declarators NYI at /tmp/BreesqZ0Wx line 1:␤------> my @a[4]⏏; # of int;␤␤Potential difficulties:␤ @a is declared but not used at /tmp/BreesqZ0Wx line 1:␤------> […
masak grondilu: I want S09 too :/
grondilu ?
masak grondilu: that's part of the NYI parts of S09.
fasad masak: btw, i think's that's a really geeky way to make slides #from text 13:07
but i like it
i also want S09 :/
grondilu well, right now I just noticed that rakudo (and apparently niecza too) don't take the # into account. This is silly.
13:07 Chillance joined
moritz nom: my Int @a; @a[0] = 'Not a Number'; 13:08
p6eval nom ce5cca: OUTPUT«Type check failed in assignment to '$v'; expected 'Int' but got 'Str'␤ in block <anon> at /tmp/CwKAEV6YCI:1␤ in <anon> at /tmp/CwKAEV6YCI:1␤»
grondilu Ahhh sorry. My bad.
fasad perl6: my @a[*];
p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Shaped variable declarations are not yet implemented at line 1, near ";"␤»
..pugs b927740: ( no output )
..niecza v13-389-g852f0ff: OUTPUT«===SORRY!===␤␤Postconstraints, and shapes on variable declarators NYI at /tmp/fbo3iWE4JY line 1:␤------> my @a[*]⏏;␤␤Potential difficulties:␤ @a is declared but not used at /tmp/fbo3iWE4JY line 1:␤------> my [33…
grondilu I thought it was the '# of int' that was the problem. Silly of me. 13:09
13:09 bluescreen10 joined
fasad huh. @a[*] is just the same as @a 13:09
jnthn Rakudo doesn't do trait application on variables just yet.
jnthn wonders what the semantics of my @a[4] = ...some potentially infinite thing that maybe produces 5 elements... :) 13:10
13:10 sbp left
grondilu perl6: class A { method new($x) { self.WHAT.CREATE } }; my A $a .= new "foo"; 13:10
p6eval pugs b927740: OUTPUT«*** ␤ Unexpected "\""␤ expecting operator␤ at /tmp/wWCcEHEleC line 1, column 66␤»
..rakudo ce5cca: OUTPUT«===SORRY!===␤Confused␤at /tmp/FFGQ4yP1IV:1␤»
..niecza v13-389-g852f0ff: OUTPUT«===SORRY!===␤␤Two terms in a row (method call requires colon or parens to take arguments) at /tmp/_DWNXHLBOG line 1:␤------> { self.WHAT.CREATE } }; my A $a .= new ⏏"foo";␤Other potential difficulties:␤ $x is declare…
grondilu perl6: class A { method new($x) { self.WHAT.CREATE } }; my A $a .= new("foo");
p6eval rakudo ce5cca: ( no output )
..niecza v13-389-g852f0ff: OUTPUT«Potential difficulties:␤ $x is declared but not used at /tmp/CBF74Hr3s4 line 1:␤------> class A { method new(⏏$x) { self.WHAT.CREATE } }; my A $a .= ␤ $a is declared but not used at /tmp/CBF74Hr3s4 line 1:␤------> d new($x) { se…
..pugs b927740: OUTPUT«*** No such method in class A: "&CREATE"␤ at /tmp/piTd63UCKz line 1, column 28-45␤»
grondilu Am I supposed to need parenthesis when calling a constructor with arguments? 13:11
jnthn yes, or a colon 13:12
grondilu a colon? 13:13
rakudo: class A { method new($x) { self.WHAT.CREATE } }; my A $a .= new :"foo"; # you mean this? 13:14
p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Confused␤at /tmp/CCuyRg53l7:1␤»
jnthn rakudo: class A { method new($x) { self.WHAT.CREATE } }; my A $a .= new: "foo"
p6eval rakudo ce5cca: ( no output )
jnthn Like that :)
er
self.WHAT.CREATE - the .WHAT is redundant there 13:15
Also you skip any attribute initialization
grondilu never seen this colon notation before. It's in S06?
jnthn Yes
Or S12
grondilu I need to check this out 13:16
the less I use parenthesis, the happier I am :)
13:16 xinming left 13:19 xinming joined 13:23 Chillance left 13:24 Chillance joined 13:25 dudulz joined 13:28 snearch joined 13:35 snearch left 13:41 snearch joined
masak just so long as you know what the colon does to your expression :) 13:44
moritz may I colon-ize you? :-)
masak .oO( "Everyone wants to colon-ize." ) 13:45
sorear: is 'handles' on the roadmap? would it be a difficult addition?
grondilu By the way I don't understand the motto "everyone wants the colon". 13:47
moritz well, it's more of an observation than a motto 13:48
grondilu but what does it mean?
moritz people when asked to come up with a new syntax for a nice feature just often tend to reach for the colon
masak grondilu: it's from the time of the RFCs, when a lot of syntactic proposals contained the colon in various ways.
grondilu: note that it almost requires that ?: go away.
moritz niecza: say 1 cmp 2 13:50
p6eval niecza v13-389-g852f0ff: OUTPUT«Increase␤»
moritz niecza: say 10 before 2
p6eval niecza v13-389-g852f0ff: OUTPUT«False␤»
[Coke] niecza: say ~10 before 2 13:51
p6eval niecza v13-389-g852f0ff: OUTPUT«False␤»
[Coke] niecza: say ~10 before ~2
p6eval niecza v13-389-g852f0ff: OUTPUT«True␤»
moritz perl6: class A { has @.a = 1, 2, 3, 4; method swap { @!a[0, 3] = @!a[3, 0]; self } }; say A.new.swap.a 13:52
p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«4 2 3 1␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected ","␤ expecting "_", fraction, exponent, term postfix, operator or "}"␤ at /tmp/zXwag20ZBB line 1, column 22␤»
14:00 birdwind1pbird joined
masak nom: my int $i = 10_000; $i++ 14:00
p6eval nom ce5cca: OUTPUT«Cannot assign to a non-container␤ in sub postfix:<++> at src/gen/CORE.setting:2537␤ in block <anon> at /tmp/9bXkGSxlTa:1␤ in <anon> at /tmp/9bXkGSxlTa:1␤»
masak bah.
niecza: my int $i = 10_000; $i++; say $i
p6eval niecza v13-389-g852f0ff: OUTPUT«===SORRY!===␤␤Malformed my at /tmp/H7QLx7dT2m line 1:␤------> my⏏ int $i = 10_000; $i++; say $i␤␤Parse failed␤␤»
masak I reject the assumption that just because it's a native, you can't ++ it 14:01
if it's just sugar for '$i = $i + 1', then what's the big problem? 14:02
jnthn That it isn't just sugar for that. :)
masak I know, and I'm not saying it should be. 14:03
jnthn masak: If you want to do the design work for rw on native types and tell me how it works, feel free. Otherwise, you'll just have to wait a bit until I get around to that. :)
masak I'm saying I expect it to be, even though I know better.
14:03 benabik left
jnthn "is rw" 14:03
I agree it should work - it just needs me to solve a general problem.
masak oh good. :)
14:03 Chillance left
masak stands down red alert 14:03
jnthn That's why we still have yellow for native operators in features. :) 14:04
moritz oh, that's not the only reason
for examply the bust the REPL
14:04 Chillance joined
jnthn Well, yeah. And PAST. :) 14:04
masak nom: my $t = now; for ^10_000 {}; say now - $t
p6eval nom ce5cca: OUTPUT«0.21766632631398␤» 14:05
moritz you mean the lots of boxes and unboxe?
jnthn moritz: Right.
masak nom: my $t = now; loop (my int $i = 0; $i < 10_000; $i = $i + 1) {}; say now - $t
p6eval nom ce5cca: OUTPUT«0.0619243610018518␤»
masak nom: say 0.21766632631398 / 0.0619243610018518
p6eval nom ce5cca: OUTPUT«3.5150354851053␤»
masak this factor is the most embarassing part of Rakudo right now.
it should be ~1.
jnthn I'm not sure why you find that surprising.
Unless you mean "Rakudo's optimizer shoudl re-write the first to the second" :) 14:06
masak I mean that.
14:06 spine joined
masak of course it's not surprising that the unoptimized version performs worse :) 14:06
involving, as it does, lists and stuff.
moritz actually I expected the factor to be even worse
masak it probably is, for longer lists. 14:07
jnthn OK, so long as you aren't expecting a C-style for loop with native integers to match lazy list iteration in the general case. :)
masak nom: my $t = now; for ^100_000 {}; say now - $t
nom: my $t = now; loop (my int $i = 0; $i < 100_000; $i = $i + 1) {}; say now - $t
p6eval nom ce5cca: OUTPUT«7.04157658210751␤»
nom ce5cca: OUTPUT«0.535169021351181␤»
moritz aye, worse
masak yes, it is.
jnthn pmichaud: ^^ :)
masak jnthn: my expectations are high... but not quite that high :)
14:07 am0c^ left
jnthn masak: Note that the re-write isn't entirely trivial (more) 14:08
masak I know.
jnthn masak: In the useful case of this you'd actually expect to do something in the loop.
And the for one means $_ needs the iteration variable.
masak as long as you start using the fact that it's a list, you can't optimize the list away.
jnthn Right. It's statically spotting it's a range.
masak I'm just saying we can do more.
jnthn Which means we need to construct the range literal at the compile time.
masak aye, 14:09
s/,/./
jnthn Which is easier when I've done serialization. :)
Good job I'm working on that. ;)
masak ++jnthn
jnthn: consider me your expectant end user, if the mental image helps you work faster :P
masak avoids disclosing whether that's meant as a carrot, or a stick :) 14:10
jnthn
.oO( carrot dangling from a stick )
.oO( stick made of carrots )
moritz phenny: "zuckerbrot und peitsche"? 14:11
phenny moritz: "Carrots and sticks" (de to en, translate.google.com)
moritz phenny: "zuckerbrot"?
phenny moritz: "sugar- bread" (de to en, translate.google.com)
moritz phenny: "peitsche"?
phenny moritz: "whip" (de to en, translate.google.com)
14:12 skids joined
masak phenny: "morot och piska"? 14:12
phenny masak: "carrot and stick" (sv to en, translate.google.com)
masak phenny: "piska"? 14:13
phenny masak: "whip" (sv to en, translate.google.com)
masak phenny: "ris och ros"?
phenny masak: "and fame" (sv to en, translate.google.com)
masak phenny: "ros och ris"? 14:14
phenny masak: "blow hot and cold" (sv to en, translate.google.com)
masak what?
Woodi phenny: "zamienil stryjek siekierke na kijek"
masak Woodi: question mark
Woodi phenny: "zamienil stryjek siekierke na kijek"?
phenny Woodi: "uncle turned into an ax on a stick" (pl to en, translate.google.com)
daxim lolwhat 14:15
masak "stryjek" is "uncle"? is it a diminutive? 14:17
phenny: en pl "uncle"?
phenny masak: "wujek" (en to pl, translate.google.com)
masak phenny: "stryjek"?
phenny masak: "uncle" (pl to en, translate.google.com)
skids mulls various ways to fail a rexexp in an API-visible grammar. 14:18
moritz <!>
skids I wonder if FAILGOAL was really intended to be specced, or just an off the cuff thing.
Yes, <!> fails, but what if I want to attach a message to that failure. 14:19
14:19 mtk joined
skids Certainly I don't want to generate a failure that needs to be caught to keep the program running, since regexps are pften used when you know they will sometimes fail. 14:20
Littering warnings to ERR probably also not so friendly. 14:21
moritz fwiw FAILGOAL is what the ~ combinator calls if it can't find the terminator
and yes, I agree we should have a mechanism for that 14:22
skids So that leaves somehow figuring a way to get an unthrown Failure into the failed Match object.
moritz the obvious answer would be to fail()
(though that's not specced to work that way with regexes)
skids And then, what if you really do want fatality (unless the user explicity catches around the match statement.) 14:24
moritz then you die
skids Ah, of course.
WRT FAILGOAL seems like :dba is only used in that one corner case as well? 14:26
moritz yes 14:27
(though maybe Gramar::Debugger could also use it)
14:27 birdwind1pbird left
Woodi masak: "stryjek" is traditional name for fathers brother. 14:33
14:37 tarch joined
masak ah, so paternal uncle. 14:37
PerlJam That thread about new/BUILD on p6l may mean that we need some better docs on the subject. 14:40
moritz PerlJam: I don't think that's the only answer 14:41
14:41 PacoAir joined
PerlJam of course not. tmtowtdi after all :) 14:41
masak .oO( "...to document it" ) 14:42
14:49 grondilu left 14:51 dbr joined 14:53 wolf_ left
flussence that new/BUILD thing definitely needs some good code examples. I take far too long to figure it out whenever I try to do anything non-default with it. 14:58
moritz everybody here is welcome to take my "let's build an object" blog post as a starting point, and explain it better / more verbose etc. 15:00
and I'll update the blog post to link to the better version :-)
15:01 GlitchMr joined, benabik joined 15:03 snearch left 15:04 dbr left, dbr joined 15:08 dbr left 15:10 lestrrat left, tokuhirom left 15:11 lestrrat joined, dbr joined
skids Somehow I've managed to get myself thinking "I wish there was a ternary op inside regexps" 15:14
skids washes hands frantically. Out damn spot. 15:15
moritz p5 has one
but of course you can emulate one with <?{ ... }>
skids I find myself writing stuff like: [ <? before \s> { warn foo } <!> ] || <!before \s> 15:16
moritz there's no reason for the <!before \s> 15:17
if the next thing is a \s, then <!before \s> can't match
skids It's supposed to match, to make the subrule return true, if there is no \s. 15:18
15:18 nemesit joined
skids e.g. false+warn if there is \s, true if there isn't. 15:19
moritz then you can just add an ? at the end
[ <?before \s> { warn 'foo' } <!> ]?
15:20 dbr left
skids \o/ somehow I just wasn't seeing that. moritz++ 15:20
15:20 dbr joined
moritz skids: if you haven't done it, I'd recommend to read STD.pm6 15:22
skids: it's full of useful idioms
15:23 xinming left 15:25 xinming joined, dbr left
[Coke] aloha, STD.pm6? 15:28
skids Oh no the ? quantifier doesn't do it quite. Need the truth value, and it's always true. 15:30
moritz uhm, why not? 15:31
niecza: github.com/perl6/std/raw/master/STD.pm6
p6eval niecza v13-389-g852f0ff: OUTPUT«===SORRY!===␤␤Confused at /tmp/H9CAD87ZTe line 1:␤------> https⏏://github.com/perl6/std/raw/master/STD.p␤␤Undeclared routine:␤ 'https' used at line 1␤␤Parse failed␤␤»
moritz niecza: github.com/perl6/std/blob/master/STD.pm6
p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to locate module DEBUG in @path␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1347 (die @ 3) ␤ at /home/p6eval/niecza/src/NieczaPathSearch.pm6 line 23 (NieczaPathSearch.load_module @ 12) ␤ at /home/p6eval/niecza/src/Nie…
skids rakudo: say "aaa" ~~ m/ a [ a <!> ]? a /; 15:32
p6eval rakudo ce5cca: OUTPUT«=> <aaa>␤␤»
15:32 PacoAir left
skids Which is correct, of course. 15:32
(I think?)
moritz ah, you don't want the rule to always succeed 15:33
skids exactly.
moritz then I misundertood your intetions earlier on
15:34 PacoAir joined
skids wait, shouldn't that above response be "aa" not "aaa"? 15:36
moritz you're right
nom: say so 'a' ~~ /<!>/ 15:37
p6eval nom ce5cca: OUTPUT«True␤»
moritz oh
it seems that <!> doesn't work :/
skids Well, it has to work in some sense, because I'm using it effectively elsewhere I think. 15:38
moritz if it worked, the above would have said 'False' and not 'True'
skids I guess I just haven't tested that corner of code and just think it is working. 15:39
might explain a few things :-) 15:41
15:46 kaleem joined
skids <!before <?> > seems a good enough work-alike for now. 15:49
TimToady nom: say so 'a' ~~ /<?{False}>/ 15:53
p6eval nom ce5cca: OUTPUT«False␤»
TimToady nom: say so 'a' ~~ /<?{}>/
p6eval nom ce5cca: OUTPUT«False␤»
TimToady that works too
nom: say so 'a' ~~ /<!{1}>/ 15:54
p6eval nom ce5cca: OUTPUT«False␤»
TimToady nom: say so 'a' ~~ /<!{0}>/
p6eval nom ce5cca: OUTPUT«True␤»
masak submits rakudobug
15:55 Trashlord joined
TimToady nom: say so 'a' ~~ /<[]>/ 15:56
p6eval nom ce5cca: OUTPUT«===SORRY!===␤StopIteration␤»
TimToady std: say so 'a' ~~ /<[]>/ 15:57
p6eval std 48335fc: OUTPUT«ok 00:01 112m␤»
TimToady niecza: say so 'a' ~~ /<[]>/
p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to resolve method oplift in class Any␤ at /home/p6eval/niecza/src/RxOp.pm6 line 19 (ANON @ 2) ␤ at <unknown> line 0 (KERNEL map @ 2) ␤ at /home/p6eval/niecza/src/RxOp.pm6 line 19 (RxOp.oplift @ 3) ␤ at /home/p6eval/niecza/s…
masak submits rakudobug 15:58
oh wait. Niecza :P
TimToady that too
masak yeah, the Rakudo one is not good either.
it should simply allow /<[]>/ as meaning, hm, I guess /<!>/ :) 16:01
...which is why you thought to try it :)
masak submits Nieczabug 16:02
TimToady ooh, a mind reader
now if you can just figure out what I *will* think next week...
masak more like a retrograde analyst :P
16:03 jferrero left
moritz QRegex/Actions.pm even has a branch in an action method that deals with <!> 16:03
TimToady nom: say so 'a' ~~ /<!before ''>/ 16:04
p6eval nom ce5cca: OUTPUT«False␤»
jnthn back 16:06
moritz: Ah, think I see what's up with <!> 16:11
16:13 dbr joined 16:17 benabik left, nemesit left 16:18 nemesit joined
jnthn nqp: say("a" ~~ /a <!>/) 16:19
p6eval nqp: OUTPUT«␤»
[Coke] did the qregex branch land before *?
jnthn [Coke]: Which qregex branch?
nqp: say("a" ~~ /a/)
p6eval nqp: OUTPUT«a␤»
jnthn hm
nqp: say("aa" ~~ /[a <!>]? a/) 16:21
p6eval nqp: OUTPUT«a␤»
jnthn nom: say("aa" ~~ /[a <!>]? a/)
p6eval nom ce5cca: OUTPUT«=> <aa>␤␤»
jnthn oh!
nom: say("a" ~~ /a/)
p6eval nom ce5cca: OUTPUT«=> <a>␤␤»
jnthn Right.
[Coke]: The branch that makes NQP parse using QRegex (qbootstrap) ain't done yet. 16:22
16:23 offby1 left
pmichaud good morning, #perl6 16:23
jnthn pmichaud! \o/
16:24 kaare_ joined
masak pmichaud! \o/ 16:25
[Coke] jnthn: i'm pretty sure that's the one I meant. Thanks.
16:25 kmwallio joined
pmichaud rakudo: say 'aaa' ~~ / a [ a <!> ]? a /; 16:25
p6eval rakudo ce5cca: OUTPUT«=> <aaa>␤␤»
pmichaud huh.
jnthn pmichaud: I've got a local patch.
pmichaud: <!> generates anchor with subtype 'fail'
pmichaud: QAST::Compiler didn't implement that ;)
pmichaud that would be the issue then :)
needs test 16:26
[Coke] \o/
pmichaud: |
/ \
masak :D
jnthn pmichaud: If you have a tuit for something regexy though, I'd *really* appreciate it if you could look at RT# 107746
skids jnthn++ pmichaud++ 16:27
16:27 stepnem left
jnthn Did that <!> get an RT ticket? 16:27
masak yes.
rt.perl.org/rt3/Ticket/Display.html?id=109672 16:28
jnthn tack
dalek p: 2208373 | jnthn++ | src/QAST/Compiler.nqp:
Implement subtype 'fail' of anchors in QAST::Compiler.
masak jnthn: пожалуйста :) 16:29
pmichaud jnthn++ # patch
jnthn: yes, I can look at #107746. probably won't get to it until tomorrow
pmichaud looks at his ticket queue
jnthn pmichaud: OK. There's a general issue with the cut handling.
pmichaud: I suspect looking at this will lead you to it.
pmichaud yes, cut is a bit tricky to handle overall. 16:30
jnthn Basically, there are points when matching that the bstack ends up empty.
In :r mode, usually.
And it then goes and throws away all the captures on the cstack.
(Which are still needed.)
pmichaud ah, looks like it needs some mark_commit love
(if that's the case)
jnthn I'm not sure I've seen a notion of mark_commit :) 16:31
So yes, sounds like :)
pmichaud mark commit exists in nqp-rx; I'm not sure where it ended up in the qast stuff.
essentially it's a way of shrinking the bstack (cut) while preserving the cstack
jnthn I think it must be missing. 16:32
16:32 drake01 joined 16:33 awoodland joined
jnthn If that one is fixed, and protoregexes can incorporate their NFA into their caller's NFA, then I suspect we will be very close to doing the bootstrap on qregex. 16:33
16:34 kaleem left
dalek kudo/nom: 6b62395 | jnthn++ | tools/build/NQP_REVISION:
Bump to latest NQP to get <!> fix.
16:35
skids
.oO(wonders if that was what was behind irclog.perlgeek.de/perl6/2012-01-31#i_5083420)
16:36
drake01 Hi guys, I m a python programmer.. Wish to learn perl too. I hear that perl6 is completely different language compared to currently used, perl5.. So for a programmar like me, what is the way to go about perl. Should I start with perl6 or perl5? Suggestions??
huf both?
fasad anyone care to comment on my rather naive variable use -> paste.ubuntu.com/826578/ 16:38
TimToady you can't really get a job programming Perl 6 quite yet, but you'll feel cleaner programming in it :)
16:38 stepnem joined
masak drake01: learn Perl 5 for the practical day-to-day. learn Perl 6 for the super awesome. 16:38
(that said, Perl 5 is pretty awesome in many ways too. and Perl 6 is increasingly practical with each monthly release.) 16:39
TimToady coming from Python, I'd suggest comparing examples on rosettacode.org to see the differences
PerlJam drake01: btw, what's a "programmer like you"? All I know is that you (probably) know python. 16:40
drake01: do you do web apps? Sysadmin stuff? bio-related programming? etc 16:41
TimToady fasad: all symbolic references now use the ::() syntax, so you want @::($name)
fasad masak: i was able to make your slides for Appetizer. yumm :) 16:42
TimToday: duh. thanx
TimToady the obvious @$name is reserved for hard refs only
16:43 kaleem joined
fasad TimToday: so we were discussing (the non-existing) perl 6 documentation earlier. Any thoughts ? 16:43
TimToady only just started backlogging
masak fasad: I'm surprised and delighted :) 16:44
skids fasad: perlcabal.org/syn/S02.html#Interpol...into_names 16:45
16:45 jferrero joined, benabik joined
fasad masak: had to hack your script just so that it works on linux... though the files generated are huge in size ! 16:45
skids: thanks 16:46
16:47 birdwindupbird left
masak fasad: yeah. :/ the images are pretty high-resolution (for extra yumminess) and an image is repeated on each slide. 16:47
that was my big mistake.
jnthn You also made the whole audience hungry :P 16:50
pmichaud jnthn: I don't think that qregex bootstrap is all that far away, if only I can find some dedicated tuits. most of the pieces are in place. 16:51
jnthn pmichaud: Have you seen the qbootstrap branch? :)
pmichaud I only saw that there is one :)
masak jnthn: hey, I asked them to put it before lunch! :)
jnthn pmichaud: I did a bunch of stuff in there. :)
16:52 dbr left
jnthn pmichaud: Including re-working various of the HLL::Grammar methods as needed for QRegex. 16:52
pmichaud: It has a stage 1 built like NQPQ is in master, and thus stage2 is NQP parsed using QRegex. It fails some tests still, but once we get that dealt with, yeah, it should bootstrap. :)
fasad TimToday: i meant, what documentation would be like. Will compilers share it, or are they supposed to write their own? 16:53
jnthn Agree it should be close.
fasad: imo, sounds like something that should be shared.
fasad jnthn++
jnthn It's hard enough to get people to write *one* set of docs, let alone one per compiler! :)
drake01 Oops, started browsing rosettacode.org. PerlJam, I wish to learn perl to add another sorta' general purpose language in the list of languages I know. Though, I'd be using it for sysadmin and for creating webapps stuff..
fasad surely there is more than one way to document it ? :p 16:54
jnthn ;-)
pmichaud fasad: of course, but in p6 we also try to make sure there's one really good way :) 16:55
PerlJam drake01: then definitely learn Perl 5. And maybe learn Perl 6 for fun.
TimToady drake01: and if, while learning Perl 5, you think "this bit is really screwy", you're probably right, and it's probably fixed in Perl 6 :) 16:56
masak drake01: what PerlJam said. Perl 6 may or may not take over the world one day. Perl 5 already has.
fasad TimToday++ #that's what makes going back to Perl 5 hard
pmichaud afk, lunch 16:57
masak Perl 5 is an OK language. we can't judge past mistakes solely by today's standards.
pmichaud well, we *can* ... :)
afk, lunch for real this time 16:58
TimToady I know, let's do *both*! :)
PerlJam Perl 6 really needs a CPAN
benabik panda?
masak panda is great. it is not CPAN.
PerlJam best would be a reliable way to access Perl 5 code so that we could kill 2 birds with one stone
flussence cpanda?
masak flussence++
jnthn ;)
16:58 awoodland left
TimToady 'course, the best parts of CPAN are just builtins to Perl 6... 16:59
PerlJam without that, the current Perl 6 compilers aren't "useful enough" to most people I think
drake01 I m unable to see the differences perl6 is/'llbe having compared to perl5.. I mean python3 too was incompatabile in a few ways compared to 2.x series. But migration was not tough.. How exactly perl6 differ from perl5?
masak TimToady: DBIx, Devel::NYTProf, Carp, B::Deparse...
er, DBIx::Class.
PerlJam drake01: Perl 6 fixes all of the things that can't be fixed in Perl 5 because of backward compatibility. :) 17:00
TimToady obviously, those are just the second-best parts :)
masak TimToady: PPI, Perl::Critic, Catalyst, Dancer...
masak decommutes 17:01
fasad darke01: think about C and C++ #a fairly good analogy
TimToady ouch
fasad *drake: ... ^^
drake01 So migration from perl5 to 6 should not be a painful experience, right?
masak it's migration the other way that's painful :)
fasad "ouch" ?
TimToady comparing Perl 6 to C++ 17:02
masak drake01: there's no automatic way to translate p5->p6. you basically have to learn new syntax and semantics.
fasad should take back his analogy?
jnthn fasad: Well, we like to think that we made things cleaner and saner in Perl 6. ;)
TimToady drake01: python3 was very timid in breaking backward compat. Perl 6 thinks if you're gonna break it, break it Real Good. 17:03
C++ would have been much better off not trying to hang on to the C subset
fasad i meant the relationship between C and C++ . I remember something like "just like C++ is not killing C... perl 6 doesn't kill perl 5"
flussence much prefers web analogies. p5 -> p6 is more like going Firefox 1.0 -> Chromium 1.0; they're both pretty decent, but the newer one is much nicer, if a bit stiff at times 17:04
fasad it was Damian Conway's analogy btw :) 17:05
PerlJam TimToady: I think that was a smart move to get relative speedy adoption "It's just like C, but with some added syntax" 17:06
fasad is looking for the video
mikemol TimToady: Hey, I don't think comparing Perl 6 to C++ ought to carry a negative connotatoin either way. ^^
PerlJam mikemol: you must not have used C++ very much ;) 17:07
mikemol PerlJam: Day job for the past five years. ;)
PerlJam: C++/MFC/Win32. I have a very, very high pain tolerance, it seems.
PerlJam indeed
mikemol But for me, C++ is a very comfortable language. :) 17:08
PerlJam mikemol: do you make heavy use of the STL?
mikemol: do you use templates much?
mikemol PerlJam: Heck yeah. 17:09
drake01 'Break it Real Good' That is scary.. What's the meaning of learning one language twice. Does the new *things* perl6 bring (when compared to perl5) are good enough to spend time learning it?
PerlJam mikemol: Did you use C++ before the STL existed?
mikemol Well, far more with custom templates than with the STL. And I've pushed template classes enough to expose bugs in MSVC10's compilers.
PerlJam: I've had to port forward code from that era, but that's about it. 17:10
PerlJam mikemol: then I think I can begin to understand your perspective.
mikemol Worst I've had to do is work with VC6 on a really, really old app. Gave up and ported it to VC8. That code depended on some jawdropping compiler bugs. 17:11
doy vc6 certainly had some jawdropping compiler bugs 17:12
PerlJam drake01: don't think of it as learning "one language twice" because it's not.
mikemol for(int foo; foo < n; ++foo) { /* some code */ } ; /* use foo for something else; declaration from inside for() was still active... */
PerlJam drake01: Think of it more like ... learning "British English" after learning "American English" though the contrast there isn't great enough 17:13
fasad see the first 5 mins of blip.tv/open-source-developers-conf...te-4461138 for the C++ analogy...
17:15 awoodland joined
drake01 PerlJam: Let me put my question in this way: Why should one learn perl6 if there is perl5 with almost same capabilities (I hope) as perl6? 17:15
fasad drake01: don't think much about all the analogies, 'cause there is none which descibres it perfectly... just jump right into perl6 :)
PerlJam drake01: "same capabilities" reads like "Turing equivalent" to me. 17:18
sorear good * #perl6 17:19
PerlJam Why learn <insert any programming language> if there is <insert any other programming language> with almost the same capabilities?
TimToady sorear: o/
PerlJam drake01: Perl 6 is more expressive and not only makes hard things possible, but some hard things become easy. 17:20
TimToady drake01: to get the same capabilities (almost) in Perl 5, you have to import a whole pile of modules
PerlJam drake01: Perl 6 also makes some seemingly impossible things, possible :)
drake01 PerlJam: not Turing equivalent.. :) I mean, I m not expecting perl6 to offer great improvements in doing things as compared to perl5.. Almost same effort should go in both versions for solving problems from areas perl is good at. 17:21
Or does it?
moritz there are areas where Perl 6 is much stronger than Perl 5
TimToady mikemol: are you suggesting that's a bug? Perl 6 defines loop that way to get consistent semantics; we only use -> $foo to move external declarations into a blcok 17:22
PerlJam drake01: PHP, Python, Ruby, and Perl 5 are all roughly equivalent. They all occupy the same niches these days (though PHP probably lags in sysadmin programming) Why pick one over another?
moritz for example separating binary and text data properly
grammars are a killer feature
proper, built-in classes and roles
and so on
see faq.perl6.org/ for a bigger list 17:23
TimToady real OO, real FP
real signatures
huf macros!
TimToady more to the point, hygienic macros 17:24
drake01 PerlJam: Python asks you to stick to the indentation n what not? Perl doesn't.. the grace python offers in solving problems, php doesn't.. Perl's regexes are stronger n straightforward, I hear, compared to others.. 17:25
PerlJam drake01: See moritz and TimToady for what Perl 6 offers that Perl 5 makes you work a little harder for. 17:26
drake01 PerlJam: * s/grace/elegance
huf grace and elegance are rather subjective i feel 17:27
PerlJam huf: sure, but they're important :)
huf but yes, php doesnt offer it, whatever it is.
PerlJam: oh yes.
TimToady thinks that Perl 6 leapfrogs Python in elegance
huf perl * leapfrogs python imho, but that's just me
PerlJam TimToady: just like some perl people have myopia about the forced indentation of python, some python people have myopia about the sigils and such. 17:28
huf oh yes, it's always the unfamiliar thing that you'll feel as too much 17:29
dalek q: ae47fda | moritz++ | answers.md:
add an anchor for the feature list, and repeat the link to the feature matrix
17:30
mikemol TimToady: Yeah. Having declarations in the first part of a for(;;) group imply that those declarations are tied to that for(;;) statement. If a var needs to be survive the for(;;) statement, it ought to declared prior to the for(;;) statement. At least in languages which have strong relationships with C and C++ syntax. And, at least, IMO. 17:31
It comes from seing things next to each other and expecting them to be closely related. It makes inductive leaps about behavior shorter.
17:32 nemesit left
TimToady well, Perl 5 went that route, and it turns into a complete mess of built-ins doing one thing (sometimes) and non-builtins doing something else 17:32
can't have that in an extensible language where built-ins and non-built-ins are supposed to work the same 17:33
mikemol Sure.
Perhaps the for(;;) construct is simply misnamed in Perl 6.
TimToady it's called loop (;;)
mikemol or perhaps there's an extra parameter. Why not loop (;)? 17:34
TimToady and we very rarely use it
and when we do use it, it's often because we *want* the loop variable to survive
drake01 TimToady: How does perl6 deal with the complete mess you say?
TimToady my only ever declare a variable in the surrounding block 17:35
mikemol drake01: builtins are supposed to be indistinguishable, semantically, from functions and user-defined code.
sorear mikemol: I'm fairly sure that C89 didn't limit for(;;) variables to the loop body
TimToady loop parameters are really formal parameters to the following lambda
sorear mikemol: I have for-variable scoping failed under "C89 and C++ incompatibilities"
17:36 daxim left
TimToady for @list -> $x {...} # we use this to declare $x as a lexical inside the block as a formal parameter 17:36
PerlJam C89 didn't let you declare vars inside the (;;) part IIRC
17:36 awoodland left
moritz C89 only lets you declare variables at the start of the function 17:36
PerlJam start of any block 17:37
mikemol sorear: C89 evolved from K&R, so I'm not really suprised, I suppose. I don't really see the point of the first parameter to for(;;), though.
huf TimToady: is this similarly true for other constructs like if? if my $x = .... { # $x would be visible in the block surrounding the if?
TimToady anyway, there are no special cases that way in Perl 6; with 'my' you know it's outside; with '->' you know it's inside
huf: yes, it's consistent
mikemol Ah, it's an initializer. That makes sense, then.
TimToady but you can also write if ... -> $x {...} and then it's inside 17:38
huf TimToady: ah. i thought there was some tricky sugar on top to keep this consistent AND compatible with perl5 expectations
TimToady: the value of the condition is passed as the first param to the block?
TimToady it's not compatible
mikemol imagines the argument then goes between making the initialization of the var the responsibility of the preceeding code, vs providing a construct-provided reminder.
TimToady huf: if you want it to
huf TimToady: you mean if i declare the block as taking one argument? 17:39
TimToady if only passes a parameter if you explicitly declare one
mikemol So I could see where that comes from. Seems an odd syntax glitch, though.
huf sweet
TimToady mikemol: we haven't found that people actually run into that problem much
most Perl 5 code uses foreach-style loops, and people naturally translate to -> $x form, and it does what they want 17:40
mikemol TimToady: They probably won't for simple cases. I can think of a few where things could get hairy, but they're derived from my understanding of C++ var cleanup, and getting confused about when destructors would get called.
TimToady we don't use RAII in Perl 6 17:41
we have other ways to do things at scope exit
mikemol Then all my cases evaporate. :)
ashleydev RAII?
PerlJam ashleydev: en.wikipedia.org/wiki/Resource_Acqu...ialization 17:42
ashleydev thx
mikemol ashleydev: Resource Acquisition Is Initialization. Which is a really obtuse way of saying that you have object constructors and destructors do interesting things when a var is created on the stack, and when scoping rules say it should pop.
sorear { open my $fh, ">foo"; print $f, "bar"; } # in Perl 5 this doesn't leak filehandles 17:43
mikemol Absolute most common use case I see it in where it's used to hold mutexes.
TimToady otoh, it pretty much requires a reference-counting implementation, which prevents you from running efficiently on most VMs these days
drake01 Ok.. So What I could decide for now is to start with perl5 (as it has good enough documentation n other sources which perl6 doesn't). and after getting familiar with it and using it for sometime, start with perl6 too.. There seems no better approach to learnin Perl.. 17:45
TimToady you'll find a lot of stuff does carry over from Perl 5 to Perl 6 too
it's neither completely different nor completely the same 17:46
PerlJam as long as you don't get hung up on particulars of syntax
PerlJam still boggles at the resistence of moving from -> to . for method invocation
ashleydev hates -> as a method invocer 17:47
TimToady it's much prettier as a kind of sideways lambda :)
huf yeah. 17:48
ashleydev if perl5 moved to . instead of -> it would mean less people will eventually move to perl6 17:49
PerlJam ashleydev: I don't think so
perl 5 would also have to adopt a host of other perl 6 features
ashleydev it is
PerlJam laziness is one of the hard ones
moritz ashleydev: if per5 moved to . instead of -> it would break backwards compatibilty on such a massive scale that it wouldn't be much use anymore 17:50
TimToady yes, the more that Perl 5 tries to adopt Perl 6 features, the more it becomes obvious that you need the whole package
[Coke] I suspect we'll change our tune a bit when we have a 6.0 (1.0? Rakudo Perl 6.0.3 1.2.4)
drake01 TimToady: What should be the good way to start learning perl. Should I start with programming perl or some other book. or Jump into documentation directly.. How to start exploring documentation. any starting points??
17:50 PacoAir left
ashleydev moritz: na, you could use it as a feature with the new versioning scheme that perl5 is doing 17:50
TimToady you can't have smartmatching without the type system, they already discovered :/
[Coke] In terms of backward compat, that is.
PerlJam hey, has the new camel book shipped yet? 17:51
TimToady it's in QC2
[Coke] drake01: I hear Programming Perl (latest) edition is due shortly.
[Coke] is TOO SLOW
moritz ashleydev: I'll believe it when I see it
PerlJam drake01: get the latest Programming Perl edition as soon as it's ready. You can probably pre-order or O'Reilly's web site
drake01: in the mean time, look through learn.perl.org 17:52
moritz: someone posted a patch to p5p to add the dotty syntax as a feature. It wasn't met warmly, but it didn't get a frigid stare either. 17:54
moritz PerlJam: I know about the patch
PerlJam: my doubts are rather on a larger scale
PerlJam: iirc obra's vision was to support not only the syntax but also the semantics of various perl versions 17:55
drake01 PerlJam: Got the offline copy of documentation.. Its like 20 MBs of pdfs. How to go through it if one wishes to.. Some startin points?
PerlJam moritz: aye. that's my understanding as well
moritz ie if you write 'use 5.16.2' in perl 5.20, then you'll get version 5.16.2
it's long shot from a -> to . patch to that versioning framework 17:56
drake01: perlintro
drake01 moritz: Thanks.. :) 17:57
PerlJam moritz: it's closer now tha the patch exists though.
moritz: maybe only marginally closer, but still :)
17:59 PacoAir joined
drake01 Leaving now.. It's great being here.. See Ya' people.. :) Bye! 18:00
18:00 drake01 left 18:01 bacek left
TimToady hmm, if BUILD set its capture into $_, then "has $!mine = .<mine>;" could pull from the named arguments maybe 18:01
18:02 kaleem left
TimToady hmm, except it would probably look in the wrong place for $_ if one wasn't passed 18:04
jnthn We already gave $_ a meaning now. 18:05
iirc
TimToady in BUILD?
or in initializers?
jnthn TimToady: No, in the closure on the RHS or a has decl.
TimToady alias for self?
jnthn nom: class A { method m() { say 42; A.new } }; class B { has A $.x = .m }; B.new # I think... 18:06
p6eval nom 6b6239: OUTPUT«42␤»
jnthn That.
TimToady nom: class A { method m() { say 42; A.new } }; class B { has A $.x = self.m }; B.new
p6eval nom 6b6239: OUTPUT«Method 'm' not found for invocant of class 'B'␤ in method <anon> at /tmp/2r7mX4G_G5:1␤ in method BUILDALL at src/gen/CORE.setting:583␤ in method bless at src/gen/CORE.setting:573␤ in method new at src/gen/CORE.setting:558␤ in block <anon> at /tmp/2r7mX4G_G5:1␤ i…
jnthn TimToady: It's set to the attribute's current value 18:07
TimToady: Which'll be a type object.
Believe S12 specs it that way. Not sure how useful it is. :)
TimToady nom: class A { method m() { say 42; A.new } }; class B { has A $.x .= m }; B.new
p6eval nom 6b6239: OUTPUT«use of uninitialized value of type Mu in string context␤use of uninitialized value of type Mu in string context␤===SORRY!===␤error:imcc:syntax error, unexpected DOT ('.')␤ in file '(file unknown)' line 22100176␤␤»
jnthn Heh. :)
Don't do that. ;)
ooc 18:08
std: class C { has $.x .= new }
p6eval std 48335fc: OUTPUT«ok 00:01 109m␤»
jnthn Is that parsed as an initializer?
TimToady yes
jnthn ah, good
TimToady = .= := and ::=
jnthn Then that'll be another bug down when I get to the initializer changes. \o/
18:09 stepnem left
TimToady now contemplates whether special casing 'has $!mine = *;' to set from the capture would be cool 18:10
jnthn TimToady: What did you make of my suggestion that named arguments to bless can only initilize things with accessors (as today), matching their virtualness, but autovivifying thingies can initialize privates (since they identify the non-virtual target)? 18:11
Thus giving a way to write a .new that will initialize privates, and be Liskov-safe... 18:12
(And trivially making the default not to touch privates...) 18:13
TimToady I'd need to see an example
jnthn TimToady: As in, a real world one, or just the syntax I'm refering to? 18:14
TimToady syntax
jnthn oh :)
class A { has $!a; method new($a) { self.bless(*, A{ a => $a }) } }
We already have the syntax. 18:15
18:15 stepnem joined
TimToady it bothers me to overload WHENCE for that, when its primary purpose is to direct traffic to the proper BUILD 18:16
jnthn TimToady: We'd still do that (more) 18:17
TimToady and it gives the control to the caller rather the class, which I don't like
18:17 mj41 left
TimToady I'd rather have an easy way of marking which private attributes provide a 'one-time' initialization interface 18:18
jnthn TimToady: It's just that when finding values for uninitialized private attributes after running any BUILD methods, we'd let them come from the WHENCE thingy.
TimToady: That is a good argument against this.
TimToady and the initializer seems like a good place to specify it 18:19
since it's about initialization, after all
jnthn *nod*
TimToady giving access to the capture would also allow the private name to change and alias a different name from the capture 18:20
has $!mine = $*CAPTURE<theirs>;
but shorter :)
jnthn Yeah, that's a bit awkward. Right idea though. 18:21
We *could* put it in $_. I'm curious how much code out there uses the existing semantics.
18:21 bacek joined
moritz erm 18:21
TimToady esp if .= is available for teh current usage
moritz somehow I feel we're discussing it backwards right now 18:22
TimToady my basic assumption is that private means private
by default
moritz we want to give .new a way to initialize private attributes
not something that requires an extra mapping on the end of the attributes
TimToady $s!mine = 42; already works in niecza 18:23
a class trusts itself, so you can set private attributes in new
I was discussing this earlier, but everyone ignored me :)
moritz well, it's not something that seems to scale nicely to initializing many attributes 18:24
TimToady but I think putting it in new is wrongish, if it's an attribute of the, er, attribugte
moritz nto as nicely as self.bless(*, :$foo, :$bar)
TimToady it's still the wrong place if you have multiple constructors 18:25
it's whether the attribute allows public initialization under that name
moritz why "public"?
new is a method in the same class as the attribute
so it can do private stuff too, as you just said 18:26
TimToady *only* if it's a submethod, or written as generally as the default new!!!
new is the wrong place to do anything infrastructural if it can be inherited!!! 18:27
(unless you're very, very careful)
moritz the point of writing a custom .new *is* that you want somthing more specific than Mu.new
TimToady remapping args is not infrastructural, and is fine for inheritance 18:28
setting private attributs is *not* fine
infrastructure belongs in BUILD or in has
18:28 kaleem joined
dalek p/bs: 3e5b40c | jnthn++ | t/serialization/02-types.t:
First few basic tests for type serialization, just knowhow for now.
18:29
p/bs: fdf9376 | jnthn++ | src/6model/serialization.c:
Start stubbing in STable serialization/deserialization.
p/bs: d82072a | jnthn++ | t/serialization/02-types.t:
Simplify initial type serialization test - use the P6int REPR (P6opaque is needier).
p/bs: 23841b2 | jnthn++ | src/6model/reprs/KnowHOWREPR.c:
Implement serialize/deserialize REPR functions for KnowHOWREPR.
p/bs: ad6c86b | jnthn++ | src/6model/serialization.c:
Make sure we create STables that are properly initialized when deserializing.
p/bs: f3156d5 | jnthn++ | t/serialization/02-types.t:
Oops, correct test count.
p/bs: 3e8a06a | jnthn++ | src/6model/knowhow_bootstrapper.c:
A KnowHOW really should publish a type check cache, so it at least matches itself.
p/bs: 54ce490 | jnthn++ | src/6model/serialization.c:
Serialization/deserialization of type check caches.
18:31 mj41 joined
pmichaud back from lunch 18:31
moritz TimToady: I thikn we'll have a hard time educating the user about what belongs into .new and what doesn't
tadzik good evening 18:33
TimToady it's really pretty simple: one constructor gets called, and many initializers, so the one constructor can't do anything that needs to know *which* initializer is running
jnthn o/ tadzik
18:34 fasad left
TimToady we're running into a similar problem with various string conversions like .gist, where people write methods that inadvertently speak for descendants and do the wrong thing 18:35
or worse, .perl 18:36
18:36 kaleem left
TimToady .gist is at least allowed to drop information, and it might be okay to drop a descendants info, or it might not 18:36
the descendant should pick that though, not the parent class
so we probably need PERL and GIST submethods that get called as appropriate by a generic .perl or .gist method 18:40
then we can have sane defaults, with overrides, rather than requiring every class to always define them 18:43
perl6: class A { has $.a = 1; }; class B is A { has $.b = 2 }; B.new.gist.say 18:52
p6eval pugs b927740: OUTPUT«*** No such method in class B: "&gist"␤ at /tmp/9bz5bkcq41 line 1, column 57 - line 2, column 1␤»
..niecza v13-389-g852f0ff: OUTPUT«B.new(...)␤»
..rakudo 6b6239: OUTPUT«B.new(b => 2, a => 1)␤»
TimToady I think .gist should probably be B{ b => 2, A{ a => 1 }}
masak +1 18:53
TimToady and maybe even .perl, with a .new on the end, if we can .new a WHENCE
B{ b => 2, A{ a => 1 }}.new 18:54
rather than cluttering it up with .new all over the place
it's also more obvious here that A{} has its own control of .gist/.perl, and that gets embedded into the external structure by the default gister 18:55
niecza: say set <a b c> 18:57
p6eval niecza v13-389-g852f0ff: OUTPUT«set(a, b, c)␤»
TimToady bbl & 18:59
benabik WHENCE? 19:02
moritz jnthn: something's wrong with the NQP revision in rakudo 19:03
jnthn moritz: Hm :S
moritz jnthn: rakudo wants
2012.01-8-g2208373
moritz@jacq:~/p6/rakudo/nqp>git describe origin/master
2012.01-6-g2208373
19:04 nebuchadnezzar left
moritz jnthn: did you forget to push some commits? or is that from another branch? 19:04
19:04 nebuchadnezzar joined
jnthn huh, I did git describe to get that! 19:04
moritz: No, I only did it to get the <!> fixing patch
I'm terribly confused about how I managed to screw this up... 19:05
moritz hm
2208373 is the start of the patch that fixes <!>
jnthn yeah
moritz but git describe gives me a 6, not an 8
ah well
jnthn Looking on github I only see 6 commits to...
OK, well, s/8/6 then 19:06
moritz ok
jnthn <- confused
masak nom: say join 'ne', '', 'buchad', 'zzar'
p6eval nom 6b6239: OUTPUT«nebuchadnezzar␤»
dalek kudo/nom: acbec86 | moritz++ | tools/build/NQP_REVISION:
fix NQP_REVISION
19:07
jnthn moritz++
19:11 [particle] left 19:12 [particle] joined 19:15 nemesit joined
moritz jnthn: btw, I've started the 'has-self' branch, and it mostly works... 19:22
except that when we parse 'has $.x = ...', the RHS has $*HAS_SELF eq ''
even though I wrote 19:23
+ token scope_declarator:sym<has> {
+ <sym>
+ :my $*HAS_SELF := 'partial';
+ <scoped('has')>
but the action method 'variable' called by <scoped('has'>) has $*HAS_SELF eq '' 19:24
I have no idea what's wrong; there shouldn't be any grammar rules between 'scoped' and 'variable' which reset $*HAS_SELF 19:26
jnthn moritz: This is why we need the initializer fixes :) 19:27
moritz: <scoped('has')> does not parse the = and what follows it in Rakudo's grammar 19:28
(Changed in STD recently)
moritz oh.
jnthn Thus $*HAS_SELF is no longer set when we parse the RHS of the =.
moritz same for 'constant', I assume?
jnthn moritz: Yes.
A bunch of stuff will get cleaner we switch to the new STD way of parsing initializers. :) 19:29
moritz yes, I can believe that :-) 19:30
19:31 birdwindupbird joined
jnthn Time for something to eat here. :) 19:34
And will have a couple more hours for Perl 6 related bits afterwards :)
19:39 nemesit left 19:41 awoodland joined 19:43 awoodland left
moritz nom: say (1, 2).fmt('%04d', '|') 19:43
p6eval nom acbec8: OUTPUT«0001|0002␤»
19:46 awoodland joined 19:47 awoodland left 19:51 jferrero left 19:55 jferrero joined 19:56 dudulz left 19:58 kmwallio left 20:03 Trashlord left
moritz masak: some people, when faced with a problem, think "Oh I know, I'll use Java". Now they have ProblemFactory. 20:09
colomon +1 20:12
20:15 bluescreen10 left, Trashlord joined
masak moritz: Ö= 20:25
moritz: :)
20:27 bluescreen10 joined 20:31 Chillance left
tadzik :P 20:34
masak probably they have an IProblem and an AbstractProblem as well. 20:36
you know, because it's nice to separate a problem into an interface and an abstract implementation.
20:38 birdwindupbird left
jnthn tries to remember the last time he actually wrote an abstract class 20:38
[Coke] moritz++ #PF 20:41
moritz nom: multi trait_mod:<is>(Mu $, :$abstract!) { }; class Concrete is abstract { }; say Concrete.new 20:42
p6eval nom acbec8: OUTPUT«Concrete.new()␤»
moritz now remembers the last time he actually wrote an abstract class :-)
jnthn nom: class Abstract is repr('Uninstantiable') { }; Abstract.new() 20:43
p6eval nom acbec8: OUTPUT«You cannot create an instance of this type␤ in method bless at src/gen/CORE.setting:571␤ in method new at src/gen/CORE.setting:558␤ in block <anon> at /tmp/HAp2cKM6sF:1␤ in <anon> at /tmp/HAp2cKM6sF:1␤»
jnthn :)
20:55 tarch left 21:05 GlitchMr left 21:29 simcop2387 left 21:31 simcop2387 joined 21:38 bluescreen10 left 21:55 bluescreen10 joined 21:56 skids left 22:00 kaare_ left, SHODAN left 22:02 SHODAN joined 22:03 am0c joined
dalek p/bs: d638979 | jnthn++ | t/serialization/02-types.t:
Add a test case for serializing a P6opaque based type with knowhow meta-object; it has a single attribute.
22:06
p/bs: 5d153d9 | jnthn++ | src/6model/serialization.c:
Should not try to serialize body of type objects, as they don't have one.
p/bs: 8b5594d | jnthn++ | src/6model/s (2 files):
Add hook for REPR data serialization/deserialization.
p/bs: ea75288 | jnthn++ | src/6model/serialization.c:
Remove unused variable to get rid of a warning.
p/bs: 4df246b | jnthn++ | src/6model/s (3 files):
Add write/read functions for serializing references to STables.
p/bs: 2b2818f | jnthn++ | src/6model/reprs/P6opaque.c:
Get serialization and much of the deserialization (minus the derived info we'll re-calculate) in place for the P6opaque REPR data. Gets the P6opaque-based type with attribute tests passing.
masak reify, reify, reify, reify, gimme, eager. Rakudo stack traces read a bit like spam :/ 22:11
tadzik Imagine. A module, which puts ads in stacktraces 22:14
jnthn Then figure out how you want them to look and make it happen. :)
tadzik reify, gimme, CHEAP MEDICINE, reify
jnthn reify, gimme, DRUGS TO MAKE ME, eager
masak shudders
I guess my point is that I'd welcome a less cluttered and more meaningful stacktrace. 22:15
or, here's an idea, none at all.
because what I really want is the error message, and I have to scroll back for it across a lot of meaningless lines.
jnthn Well, that's an easy patch :) 22:16
Maybe a --backtrace option to enable them
If you really wanted it, just run again.
:)
am0c hello, I think PERL6LIB environment variable should be in Perl6 spec
tadzik gimme, reify, TIRED OF BUGS? TRY TARDIS!, reify, reify, reify...
22:17 Moukeddar joined, erana_ joined
jnthn am0c: Sounds somewhat sane. 22:17
slavik am0c: I would argue that it is implementation dependent 22:19
jnthn: PERL6LIB does not really makes sense as a language spec ... unless there is a section on implementations honoring specific things
masak am0c: TimToady has said that PERL6LIB is a stop-gap solution. 22:20
am0c I see. 22:21
masak S11 proposes that modules end up in a database somewhere, that is, entirely divorced from a directory structures. frankly, I wouldn't mind if that never happened. 22:22
jnthn Yes, clearly we should make the way modules are located very different over the various implementations, so you never know what to expect. :P
PERL6LIB may not be a stopgap, but I suspect we want some kind of standardization in this area. 22:23
Probably a bit early yet though.
er, s/may not/may/
22:24 colomon left
am0c if there will not be somewhat standard thing, it could be harder to manage them. 22:24
masak indubitably. 22:25
22:28 benabik left 22:29 colomon joined 22:39 spine left 22:48 packetknife joined 23:00 PacoAir left 23:01 PacoAir joined 23:02 PacoAir left
jnthn night, #perl6 23:08
masak 'night, jnthn
23:15 mj41 left
masak 'night, #perl6 23:16
am0c good night 23:17
23:25 Radvendii joined
Radvendii o/ perl6 23:25
i know you guys explained it to me before, but remind me why FETCH is getting called twice, when i only access the variable once? 23:26
[Coke] there are irc logs, btw. 23:32
www.google.com/search?q=site%3Airc...rl%3Aperl6
(I don't remember the answer.) 23:34
slavik (05:49:31 PM) jnthn: Radvendii: Proxy is a scalar container. Various bits of the runtime - as you pass the container around - will want to decontainerize it. 23:36
you're welcome :)
friday on the 20th
23:42 skids joined