»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! | feather will shut down permanently on 2015-03-31
Set by jnthn on 28 February 2015.
labster m: "|".IO.perl.EVAL 01:14
camelia rakudo-moar af823c: OUTPUT«Method 'IO' not found for invocant of class 'Any'␤ in block <unit> at EVAL_0:1␤ in any <unit-outer> at EVAL_0:1␤ in block <unit> at /tmp/zFcIhD9qTq:1␤␤»
labster m: "foo|bar".IO.perl.EVAL
camelia rakudo-moar af823c: OUTPUT«5===SORRY!5=== Error while compiling EVAL_0␤Two terms in a row␤at EVAL_0:1␤------> 3q|foo|7⏏5bar|.IO(:SPEC(IO::Spec::Unix),:CWD</home␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statemen…»
labster m: "foo".IO.perl.EVAL.say 01:16
camelia rakudo-moar af823c: OUTPUT«"/home/camelia/foo".IO␤»
dalek kudo-star-daily: cc8774d | coke++ | log/ (2 files):
today (automated commit)
04:35
Ven \o, #perl6! 07:29
lizmat good *, #perl6! 07:45
openjdk.java.net/projects/panama/ # wonder if this could be of interest to rakudo on jvm users
lizmat m: my $a will begin { $_ = 42 }; say $a 07:56
camelia rakudo-moar af823c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/j_k4AQLrsz␤Cannot assign to an immutable value␤at /tmp/j_k4AQLrsz:1␤»
dalek kudo/nom: a34d024 | lizmat++ | / (2 files):
Make my $a will begin { $_ = 42 } work
08:02
labster m: 3.path # I should be deprecated 08:04
camelia ( no output )
lizmat m: 3.IO.perl.say 08:08
camelia rakudo-moar af823c: OUTPUT«q|3|.IO(:SPEC(IO::Spec::Unix),:CWD</home/camelia>)␤»
lizmat
.oO( need some inspiration to get back to the newio branch )
08:09
but meanwhile, commute to Oslo & 08:10
btyler timotimo: fun to see you mention ZK -- I wrote the run animation for some of the walker bots years and years ago :) 08:32
itz damm missing jnthn tutorial in .no .. I hope it's re-appearing over the summer at YAPC::EU or somewhere else? 09:03
nwc10 oh g.noes 09:04
brrt jnthn giving tutorials again 09:07
how come i didn't know
itz it does look like perl6.101 rather than jit.301 :) 09:08
FROGGS [Coke] / bartolin: do you already have a way to know what test files in roast we do *not* run? 09:13
brrt fair enough :-)
FROGGS [Coke] / bartolin: I found it quite surprising that we did not run S05-capture/alias.t until yesterday
dalek pan style="color: #395be5">perl6-examples: bff64aa | paultcochrane++ | categories/rosalind/trie-grondilu.pl:
[rosalind] simplify command line data input
09:17
pan style="color: #395be5">perl6-examples: 5f3c6ac | paultcochrane++ | categories/rosalind/trie-grondilu.pl:
[rosalind] Add usage information
pan style="color: #395be5">perl6-examples: d08200a | paultcochrane++ | lib/Pod/Htmlify.pm6:
Sort menu tabs
pan style="color: #395be5">perl6-examples: 1fbd9ec | paultcochrane++ | categories/rosalind/trie-grondilu.pl:
[rosalind] add problem description to trie example
pan style="color: #395be5">perl6-examples: 29b25be | paultcochrane++ | / (4 files):
Merge branch 'master' of github.com:perl6/perl6-examples
dalek pan style="color: #395be5">perl6-examples: 9702a33 | paultcochrane++ | lib/Pod/Htmlify.pm6:
Loop over categories table sorted by key
09:18
FROGGS std: class Foo { has $.x is rw }; class Bar is Foo { }; my Foo $u .= new(:5x); say $u.x; $u = Bar.new(Foo{:12x}); 09:26
camelia std 28329a7: OUTPUT«ok 00:00 143m␤»
FROGGS std: class Foo { has $.x is rw }; class Bar is Foo { }; my Foo $u .= new(:5x); say $u.x; $u = Bar.new(Foo::x => 12); 09:28
camelia std 28329a7: OUTPUT«5===SORRY!5===␤Preceding context expects a term, but found infix => instead at /tmp/lZ7s0c3QBi line 1:␤------> 3new(:5x); say $u.x; $u = Bar.new(Foo::x 7⏏5=> 12);␤Parse failed␤FAILED 00:00 140m␤» 09:29
FROGGS I think I'd prefer this to set the parent's attribute
Foo{ ... } just looks weird IMO
TimToady: what do you think?
FROGGS or is Foo::x already a sub call? 09:31
m: class Foo { }; say (Foo{:12x}) 09:32
camelia rakudo-moar a34d02: OUTPUT«(Any)␤»
FROGGS m: class Foo { }; say (Foo{:12x}).WHAT
camelia rakudo-moar a34d02: OUTPUT«(Any)␤»
FROGGS hmmm
FROGGS and one would have to repeat the Foo:: for every attr in my proposed version 09:33
RabidGravy I think there needs to be something on the run time application of roles in the docs.perl6.org/language/objects#Roles - will do that later 09:34
RabidGravy right, off out to strike my blow for democracy now. catch y'all later. 09:40
itz "vote early, vote often" 09:40
DrForr Chicago FTW. 09:41
brrt oh, yeah, good luck british people 09:51
brrt try not to make any irrevocable geopolitical mess 09:56
itz we've out sourced that to the EU ;) 09:57
dalek kudo/nom: 89c43cc | FROGGS++ | t/spectest.data:
run test S12-class/parent_attributes.t
ast: 80cd397 | FROGGS++ | S12-class/parent_attributes.t:
RT #125129 skip test for initializing parent attrs
09:58
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125129
grondilu Hello. What is this 'will' thing and where is it documented? (it's no easy to grep it in the spec) 10:33
grondilu grepped C<will> and found something in S14 10:35
FROGGS [Coke] / bartolin: nvm, I've got a one-liner that does what I need
RabidGravy grondilu, design.perl6.org/S14.html#Traits
the actually implemented traits may or may not be documented elsewhere 10:39
cygx o/ 10:53
grondilu m: say (^100)[*-10 .. *-1]; 10:54
camelia rakudo-moar 89c43c: OUTPUT«90 91 92 93 94 95 96 97 98 99␤»
cygx Is github.com/cygx/p6-tinycc/commit/b...6413a607b1 the correct way to declare callback parameter in NativeCall?
grondilu m: my @primes = 2, grep *.is-prime, (3, 5 ... 999_997); say @primes[*-10..*-1]; # wondering if this is supposed to be fast 10:55
cygx (the native trait gets applied in EXPORT to a .clone of that sub)
camelia rakudo-moar 89c43c: OUTPUT«(timeout)» 10:55
timotimo grondilu, try a simple range instead? 11:02
FROGGS cygx: there needs to be whitespace between the param name and the signature 11:05
cygx: dunno if that's all
cygx FROGGS: Rakudo helpfully told me I should use :() for signatures 11:14
FROGGS: but I only got it to parse by omitting the name
so what should it read?
sub tcc_set_error_func(Pointer, Pointer, &cb (Pointer, Str))
FROGGS yes, that should work 11:28
cygx sadly, it does not for me :( 11:36
if anyone else wants to look into it, here's a test case: gist.github.com/cygx/2f4aecee744fccefcab9
I used a recent version of TCC from repo.or.cz/w/tinycc.git 11:37
dalek ast: 66f2576 | FROGGS++ | S02-literals/pod.t:
fudge test because of a bug and lang spec reasons
11:46
andreoss m: my $x = 1; let $x = EVAL 'die'; say $x 11:51
camelia rakudo-moar 89c43c: OUTPUT«Died␤ in block <unit> at EVAL_0:1␤ in any <unit-outer> at EVAL_0:1␤ in block <unit> at /tmp/KTX74XZIEP:1␤␤»
nwc10 a 11:54
dalek ast: fd322e4 | FROGGS++ | S02-magicals/block.t:
skip &?BLOCK test on rakudo, RT 125131
11:59
dalek ast: dcbfdc7 | FROGGS++ | S02-magicals/subname.t:
bring subroutine name tests in shape
12:10
nwc10 domm++ # giving a talk that keeps FROGGS hacking :-) 12:20
FROGGS *g* 12:22
dalek ast: ae9c765 | FROGGS++ | S04-statements/when.t:
skip tests for NYI'd exception type RT #125132
12:29
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125132
dalek ast: c719c99 | FROGGS++ | S05-modifier/repetition-exhaustive.t:
fudge test about too greedy captures RT 125133
12:48
dalek c: c092762 | paultcochrane++ | lib/Type/List.pod:
Update classify() example output
13:31
c: 6b192ff | paultcochrane++ | lib/ (3 files):
Merge branch 'master' of github.com:perl6/doc
jnthn evening, #pelr6 14:47
*perl :)
RabidGravy erp
dalek pan style="color: #395be5">perl6-examples: 8a8cb90 | paultcochrane++ | categories/euler/prob151-shlomif.p6:
[euler] add docs for solution to problem 151
14:48
pan style="color: #395be5">perl6-examples: 90ef9b2 | paultcochrane++ | categories/euler/prob151-shlomif.p6:
Correct expected result

Compare sorted output lists in event006
This allows us to better compare the output data, rather than simply the ordering of the output data which doesn't matter in this case.
hoelzro morning #perl6 14:48
[ptc] oh dear, there I go killing dalek again...
moritz [ptc]++ # only a killed dalek is a good dalek 14:49
[ptc] heh :-) 14:50
nwc10 this dalek seems to have more lives than a cat 15:00
impossible to exterminate it
nwc10 FROGGS is live again 15:01
(That's why he has pinged out)
Ven I've seen pypy.js linked here, but it's actually more impressive than it first looked! 15:02
"An rpython JIT backend that emits asmjs at runtime: ./deps/pypy/rpython/jit/backend/asmjs/."
masak afternoon, #perl6 15:26
nwc10 heresy! :-) 15:27
nwc10 although it would explain why I'm feeling a bit tired. 15:31
timotimo evening 15:38
nwc10 "herersier" :-) 15:38
TimToady .tell FROGGS it seems to me that Foo::x doesn't scale well to multiple attributes, but I agree Foo{} is weird, so maybe we can think of something better 15:39
yoleaux TimToady: I'll pass your message to FROGGS.
jnthn TimToady: Bah, I was gonna implement Foo{...} in the near future; it's been one of those "easy enough" things that I never quite got to... :) 15:53
japhb What is FROGGS speaking about this session? 15:53
timotimo what does the "glob" function in perl5 do? search for files by shell expression?
japhb jnthn: Can we get yoleaux in #moarvm, or is there a reason not to? 15:53
timotimo: Yeah, basically 15:54
jnthn japhb: I don't mind yoleaux being there, though most people on the channel are also on #perl6 :)
japhb (There are some details about *which* shell expansion, but yeah)
jnthn japhb: and so can use the bot there
japhb: And the bot doesn't namespace .tell's by channel anyways :)
japhb jnthn: Yeah, I just figured to .ask questions or .tell things in the right channel, but if it doesn't namespace, I guess that doesn't matter much. 15:55
japhb Speaking of yoleaux uses ... 15:55
itz such as the standard Unix shell /bin/csh would do 15:55
:D
. o O ( standard in 1984?) 15:56
japhb .ask FROGGS Besides the "C++ in progress" bit, what else has changed? I assume OpaquePointer -> Pointer ..... And what was the rant about?
yoleaux japhb: I'll pass your message to FROGGS.
geekosaur back in the day, it would try to use csh's glob operator because that would do output in a way useful to avoid special characters
(like space and newline)
timotimo what do we recommend people to use in perl6? 15:57
japhb itz: Well, there's some bits about bsd_glob IIRC, so not exactly what a shell user might naively assume
itz timotimo: I assumed "dir" 15:58
examples.perl6.org/categories/cookb...ttern.html 15:59
japhb Cellular dead spots, I shake my fist at theee 16:00
tony-o m: .basename.say for '.'.IO.dir
camelia rakudo-moar 89c43c: OUTPUT«.bash_history␤p6eval-token␤std␤.ssh␤star␤perl5␤.perl6␤.rcc␤p1␤nqp-js␤.bashrc␤evalbot.log␤star-2014.09␤rakudo-star-2015.03.tar.gz␤ugexe-was-here␤rakudo-star-2015.02␤rakudo2␤.viminfo␤rakudo-inst-2␤.cpanm␤mbox␤.perlbr…»
timotimo thanks itz 16:02
japhb wonders what .rcc is for 16:03
tony-o m: .basename.say for '.'.IO.dir: test => /^'.'/ 16:07
camelia rakudo-moar 89c43c: OUTPUT«.bash_history␤.ssh␤.perl6␤.rcc␤.bashrc␤..␤.viminfo␤.cpanm␤.perlbrew␤.npm␤.lesshst␤.␤.local␤»
ugexe is there a best practice for when to use a rule vs token? or should i only base that on the need of back tracking and code formatting via spaces? 16:08
timotimo i think so
jnthn They have identical backtracking semantics 16:10
They only differ by sigspace
timotimo er, right 16:11
itz is there a simple mapping rosetta of glob -> dir and similar 16:12
?
timotimo is there more to glob than * and ? ? 16:13
itz maybe an error should suggest dir rather than just undefined for glob? 16:14
timotimo well, once we get it, using something that's not defined will also look through the ecosystem for modules that provide it 16:15
itz so I typo something basic and wait for lots of network access :) 16:17
geekosaur traditional glob was * ? [cset] (no ability to invert, simple ranges). modern shells typically add cset inversion (! instead of ^)
and often have many more glob operators
timotimo no, no, that's all in the data you update from the 'nets with "panda update"
that'll surely scale very well 16:18
geekosaur but the minimal set that glob would be expected to support is ? * and [cset]/[!cset] 16:18
timotimo ah, i forgot about that part 16:19
liztormato waves from Oslo 16:21
itz timotimo: is that in the main panda now .. I remember reading about this in p6weekly 16:21
timotimo no, it's not 16:21
but panda already requires a "provides" section for all modules 16:22
itz which branch?
timotimo it's not implemented at all :)
itz ah ok
timotimo er, actually i was wrong 16:22
that feature is about having a "use" statement for something that's not installed
itz I meant the data structure serialisation 16:24
itz ah its in MoarVM not panda yet? 16:24
timotimo oh!
timotimo i'm confused :) 16:24
timotimo we currently have the same data that'd go into the serialized blob ... it's just in a json file instead 16:25
itz I was interested in stealing it to use elsewhere :) 16:26
timotimo it's in the "jsoff" branch, but it doesn't work completely yet 16:32
dalek rl6-roast-data: 4ee886b | coke++ | / (9 files):
today (automated commit)
16:34
itz timotimo: ty 16:35
timotimo as in: expect explosions
[Coke] FROGGS / bartolin - tools/update-passing-test-data.pl 16:38
pmichaud good morning, #perl6 16:48
TimToady good morning, pmichaud :) 16:48
long time no see!
PerlJam pmichaud: greetings! 16:49
TimToady (we just dropped pm off at the airport a few minutes ago :) 16:50
pmichaud TimToady: yes, long time no see. Like, perhaps 30 minutes.
[Coke] wonders what conference he's missing right now 16:51
jnthn o/ pmichaud
TimToady you missed Collision
jnthn and you'll soon miss OSDC.no 16:52
[Coke] *sigh* 16:53
pmichaud I made it to Collision, and expect to be at OSDC.no in about 24 hrs
jnthn pmichaud: When you land? 16:54
jnthn at 13:30 or so
But my flight is only 55 mins ;)
pmichaud jnthn: I land at 09:50 16:56
jnthn OK, way before me. :) 16:57
pmichaud jnthn: you arrive 13:30 fri? 17:00
jnthn pmichaud: Yes, tomorrow
13:30 today already came and went ;)
(locally)
pmichaud ah, yes.
tadzik I'll be there at 13:50 or so 17:14
jnthn tadzik: oh, didn't even know you're coming :) 17:20
andreoss is implementing <=> enough for max to work on objects of my own class?
hoelzro andreoss: I think it would probably be cmp you'd have to implement 17:22
hoelzro checks impl of max
yes, max uses cmp
tadzik jnthn: that's what sh... yeah, passively though, not giving a talk or anything :) 17:23
andreoss it seems to throw results at random, even with cmp defined 17:24
jnthn :P
tony-o andreoss: how old is your build
timotimo github.com/beefsack/git-mirror - this could be interesting
tony-o beefsack 17:25
PerlJam andreoss: and did you implement cmp correctly? ;)
jnthn tadzik: I'm sure you'll make enough noise anyway :P
tadzik hehe
I guess that says a lot about me, not sure if it's good or bad... :P 17:26
pmichaud boarding soon... back again later
timotimo tadzik: we should get back into game dev again :P
jnthn pmichaud: Safe flight! :) 17:28
timotimo aye, safe flight!
andreoss PerlJam: paste.debian.net/172705/ 17:29
may be not
tony-o: This is perl6 version 2015.04-168-g1763049 built
[Coke] Writing a class to get the comparator seems very java. 17:34
tadzik timotimo: oh yes :) 17:37
TimToady jnthn, FROGGS: the advantage of the Foo{} notation is twofold; it naturally looks like a hash of values, and it bundles them together as a single unit that can be passed to parent objects without having to examine each attribute at every BUILD level 17:42
and as a special form, we can force it to check that the types are known, and allow it to pass a bundle to an uninstantiable role parent, as well as to a class parent 17:43
TimToady sightseeing & 17:44
PerlJam andreoss: What makes you think it "throws results at random"? 17:45
timotimo $*PROGRAM_NAME.IO.dirname ~ '/base_exp.txt' - hooray, concatenating strings with ~ :) 17:46
raydiak m: class C { has Numeric $.a }; multi sub infix:<cmp> (C $a, C $b) { $a.a <=> $b.a }; my $a = C.new: :a(1e2); my $b = C.new: :a(10); say $a max $b; 17:50
camelia rakudo-moar 89c43c: OUTPUT«C.new(a => 10)␤»
tony-o timotimo: wouldn't it be better as $*SPEC.catdir($*PROGRAM_NAME.IO.dirname, 'base_exp.txt') /
timotimo tony-o: say that to andreoss :) 17:51
raydiak ^^^ how would anyone make that work as intended? golfed restating of andreoss's problem
timotimo goes AFK for a bit
andreoss PerlJam: in 1 time of 10 it looks random
or maybe even 20
PerlJam perhaps libtommath can't handle so many digits? 17:52
(or maybe <=> has trouble with them)
raydiak I think it's not using the custom cmp at all and is instead doing max on the stringification of the object, as illustrated above
timotimo libtommath is supposed to handle as many digits as your RAM can hold 17:53
PerlJam or maybe what raydiak said.
:)
raydiak and the way he's doing it, he's not going to get a bunch of digits, that's why he does log(base) instead of exp**10 17:54
tony-o andreoss: do you have a test file? it works consistently for me
colomon I’m not seeing the original (probably just need to backlog more) but there’s a decent change log doesn’t work properly on huge numbers?
raydiak erm, log(base)*exp instead of base**exp
colomon ah, found link 17:55
raydiak they're only 6 digits
m: say log(1e9)
camelia rakudo-moar 89c43c: OUTPUT«20.7232658369464␤»
andreoss tony-o: i just run it in a loop 17:56
raydiak m: class C { has Numeric $.a }; multi sub infix:<cmp> (C $a, C $b) { say "CALLED"; $a.a <=> $b.a }; my $a = C.new: :a(1e2); my $b = C.new: :a(10); say $a max $b; 17:57
camelia rakudo-moar 89c43c: OUTPUT«C.new(a => 10)␤»
tony-o i put a few lines in the file and did: for i in {0..100}; do perl6 andreoss.pl6; done and it printed out the max number 100 times
raydiak ^^ very simple illustration that it's not getting called at all
andreoss tony-o: you can get the original file from PE, the link is in the pod 17:58
tony-o maybe my test file just sucked
colomon oh, right!
it’s not getting called because of scoping
ie rakudo’s core cannot see your custom cmp 17:59
raydiak ah ha
now that we're on the right track...afk :)
colomon that’s been plaguing me for 5+ years now. :)
andreoss colomon: i put warn in my cmp, and it's indeed not called 18:00
should have done it earlier
geekosaur shouldn't it support an adverb then? max :by(mycmp)
colomon geekosaur: I don’t know about that, but for sure you can call it as ($a, $b).max(:by(mycmp)) 18:01
Looking at the source, I don’t think you can use :by for infix:<max> 18:02
github.com/rakudo/rakudo/blob/nom/...ny.pm#L675 18:03
hardcoded to use infix:<cmp> 18:04
m: class C does Real { has $.a; method Bridge() { $.a } }; my $a = C.new: :a(1e2); my $b = C.new: :a(10); say $a max $b; 18:06
camelia rakudo-moar 89c43c: OUTPUT«100␤»
colomon of course, that’s basically saying C is a Real number, which may not be desirable in general
timotimo oh, hold on
yeah, you can't get the "cmp" into the scope of the sorting thingie 18:07
until we have "lift" or something equivalent
colomon right
and AFAIK, we don’t have lift yet
moritz lift was unspecced 18:08
timotimo right
colomon on the other hand, if you tell p6 your type is a Real, the core will treat it as one, even today.
raydiak back; good morning #perl6 :)
I also saw in S03 "As with all cmp-based operators, this may be modified by an adverb specifying different semantics."...is that implemented? even just for cmp vs leg vs <=> if not for custom routines? if so what does it look like? 18:09
moritz gist.github.com/anonymous/48efcb021cc1dd55fdd2 you can emulate lift with CALLER::LEXICAL 18:10
TimToady++
tony-o ++ for the hitchhiker's ref 18:11
colomon that emulation doesn’t help at all for Rakudo’s core, does it?
colomon raydiak: it’s not implemented anyway in Rakudo so far as I know 18:12
moritz colomon: it would, I think, but it'd wreak havoc to static inlining 18:15
as well as static dispatch
andreoss m: sub my-max($a, $b) { $a }; say [&my-max] 1, 2, 3, 4, 5; 18:16
camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/13H49C8Z3I␤Two terms in a row␤at /tmp/13H49C8Z3I:1␤------> 3sub my-max($a, $b) { $a }; say [&my-max]7⏏5 1, 2, 3, 4, 5;␤ expecting any of:␤ infix␤ infix stopper␤ postf…»
andreoss m: sub my-max($a, $b) { $a }; say [my-max] 1, 2, 3, 4, 5;
camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BeujDZ22Gr␤Two terms in a row␤at /tmp/BeujDZ22Gr:1␤------> 3sub my-max($a, $b) { $a }; say [my-max]7⏏5 1, 2, 3, 4, 5;␤ expecting any of:␤ infix␤ infix stopper␤ postfi…»
colomon moritz: I mean, without us spreading CALLER::LEXICAL use liberally throughout the core code, it will not work with the core. 18:18
m: sub my-max($a, $b) { $a }; say [[&my-max]] 1, 2, 3, 4, 5
camelia rakudo-moar 89c43c: OUTPUT«1␤»
geekosaur I am not sure that max should use any cmp in scope
explicit declaration with an adverb seems much more sensible 18:19
colomon andreoss: your my-max is not very smart. ;)
geekosaur "oops this module I imported started exporting a max function"
colomon andreoss: what with it’s “the first argument is always the max” approach
andreoss colomon: how do i turn it into reducer?
oh. i see 18:20
colomon andreoss: if my-max is a sub which takes two arguments, [&my-max] works as an infix operator
andreoss m: sub infix:«my-max»($a, $b) { $a }; say [&my-max] 1, 2, 3, 4, 5; 18:21
camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/gHu10Nvm6P␤Two terms in a row␤at /tmp/gHu10Nvm6P:1␤------> 3x:«my-max»($a, $b) { $a }; say [&my-max]7⏏5 1, 2, 3, 4, 5;␤ expecting any of:␤ infix␤ infix stopper␤ pos…»
colomon then to reduce, you need another set of [ ]
so [[&my-max]]
andreoss what if it's infix already? 18:23
colomon then [infix-already] is reduce 18:24
timotimo actually, isn't CALLER::LEXICAL the easiest case you can imagine for static inlining?
andreoss m: sub infix:«my-max»($a, $b) { $a }; say [my-max] 1, 2, 3, 4, 5;
camelia rakudo-moar 89c43c: OUTPUT«1␤»
andreoss oh, & was unnecessary
andreoss colomon: thanks 18:24
andreoss paste.debian.net/172728/ 18:26
tony-o http::server::async is so borken now 18:31
colomon andreoss: you’re welcome 18:35
afk
dalek pan style="color: #395be5">perl6-examples: f53afbe | paultcochrane++ | / (2 files):
[wsg] sort input test file list
19:18
FROGGS . 19:23
yoleaux 15:39Z <TimToady> FROGGS: it seems to me that Foo::x doesn't scale well to multiple attributes, but I agree Foo{} is weird, so maybe we can think of something better
15:56Z <japhb> FROGGS: Besides the "C++ in progress" bit, what else has changed? I assume OpaquePointer -> Pointer ..... And what was the rant about?
FROGGS japhb: right (Pointer), and the rant was about stupid documentation 19:24
japhb: like the documentation for 'prefix' here: www.xmlsoft.org/html/libxml-tree.html#xmlNs 19:28
FROGGS japhb: or this: www.xmlsoft.org/html/libxml-xpath.h...eSetCreate 19:31
TimToady: I'd like to get it in line with how we access methods of a "parent" role/class... but it feels ununifiable 19:33
FROGGS .oO( Dog.Bark::new( :loud ) ) 19:34
moritz amusing fact: pylint reports duplicated code, and sometimes it reports a duplicated piece of code twice (once for each file it's in) 20:13
FROGGS *g* 20:15
dalek osystem: 4f81142 | (Jonathan Stowe)++ | META.list:
Add Sys::Utmp
21:08
RabidGravy there 21:09
apologies in advance if it core dumps on your system :) 21:13
timotimo why did libcrypt disappear? 21:14
RabidGravy because, er, I accidentally deleted the line 21:15
timotimo ah
i wonder when we'll see recordings from perl6 related things 21:16
dalek osystem: ff8b6c0 | (Jonathan Stowe)++ | META.list:
Put back Crypt::Libcrypt
21:17
RabidGravy going to make a Libshout thing next :) 21:18
rjbs So, I rebuilt my rakudo today to get the awesome new "will lazy"
lizmat++ jnthn++ 21:19
...and now I'm at the next thing that "Moose could do this for me." :)
masak :) 21:20
rjbs m: class YourFace { has $.x will lazy { 1 } ; has $.z will lazy { $.x + 1 } } ; my $yf = YourFace.new;
camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vmAvcIVdmn␤Virtual call $.x may not be used on partially constructed objects␤at /tmp/vmAvcIVdmn:1␤------> 3ill lazy { 1 } ; has $.z will lazy { $.x7⏏5 + 1 } } ; my $yf = YourFace.new;␤ expectin…»
rjbs In Moose, we often have two lazy attributes, where one will, if needed during its default-building, cause the other to become built.
masak that's obviously wrong.
FROGGS m: class YourFace { has $.x will lazy { 1 } ; has $.z will lazy { $!x + 1 } } ; my $yf = YourFace.new; 21:21
masak as in, I agree with your expectation that the above program should work.
camelia rakudo-moar 89c43c: OUTPUT«===SORRY!===␤No such method 'wrap' for invocant of type 'Any'␤»
jnthn I don't think it cna.
FROGGS :S
jnthn *can
masak jnthn: because of possible circularities?
rjbs Well, but note this:
jnthn No, just because it's a block, so how will it ever be able to see self?
jnthn I think we can (maybe already do?) feed the self in as $_... 21:22
rjbs It's complaining about being called on a partially-constructed object when neither block should have ever been called.
jnthn That's a compile-time bit of semantic analysis. 21:23
rjbs Anyway: making it easy to "chain" lazily-defaulted attributes has been a big win in Moose. I believe the utility would translate.
masak jnthn: don't the (non-block) thunks in attribute initializer rhs-es already see self?
rjbs jnthn: Okay, thought it might be.
jnthn masak: Yes, by a good amount of compiler magic to special case it. 21:23
masak *nod*
jnthn In which case maybe we do want to do it with an "is lazy" so we can use the real thunk that can see self...
masak +1
jnthn I still think that's possible, I was just tied for time so worte up the fasted solution that could possibly work. 21:24
I didn't expect it to go into CORE.
*fastest
lizmat good *, #perl6!
and I never thought it did not belong in core
jnthn Maybe I'll try the other apporach once I've more time (probably this weekend, though shold finish my tut slides first)
lizmat: A solution to the problem may, but "we have something that kinda works, put it in!" is the PHP way :P 21:25
masak I repeatedly suggested it should not go in core.
lizmat so we remove it: it's not been in a compiler release 21:25
and rjbs can find another way to do the same thing now 21:26
jnthn Well, leave it for a moment, I'll play around with an alternative.
Or some alternatives.
masak ++jnthn
jnthn And we can see what we like most.
I think the fact the current way doesn't let you chain makes it a no-go.
And I don't want more special cases. :) 21:27
lizmat jnthn: I haven't backlogged sufficiently yet: doesn't chain ? 21:27
masak rjbs: ooc, what does Moose do in the face of circularly dependent lazies?
jnthn lizmat: You can't do $.foo or self.foo in there
lizmat: and there's no easy way to fix that.
lizmat ah, ok
jnthn If you make circularly dependent laziness you'll get the stack overflow you deserve, surely. 21:28
:)
lizmat yeah, that's a no go (and a problem with some of the other "will foo" phasers as well)
masak jnthn: feels statically catchable, tho'
jnthn Maybe by some kinda linter
We're having a hard enough time getting the compiler fast enough without loading it up with static checks for things that are unlikely. 21:29
timotimo if you happen to write your lazy thunks tail-call-optimizable, you'll just infiniloop
rjbs masak: circular dependency will result in the usual deep recursion
masak oh, ok.
rjbs "Deep recursion of your_attr_builder"
masak if it's good enough for Moose... :) 21:30
rjbs I've talked about how we'd solve some of those problems, but this is Good Enough.
Also, have to consider:
has $.x = $.should-be-lazy + 1
So now we're calling the lazy block on a partially constructed object. That can be Bad.
rjbs I have go to! There are quesadillas waiting to get et. BBL. ;) 21:31
jnthn Can anybody give me some good real world examples of moose lazy build stuff? 21:31
Because having done OOP in a bunch of languages...I've not found it a common enough case that it's something I'd hugely miss.
(As a core feature) 21:32
masak jnthn: board game. primary data structure is a list of move events. sometimes we ask for pieces on the board. board is lazily created from events. 21:33
RabidGravy W3C::SOAP uses it heavily
jnthn masak: But...you'd need to invalidate that on getting more events?
masak jnthn: let's assume it's an immutable game state object. more events creates new immutable game states. 21:34
jnthn: anyway, derived costly-ish attributes based on unchanging primary attributes -- that's what comes to mind. 21:35
jnthn *nod*
masak also "client may not always ask for this"
lizmat the example that rjbs originally had was: 21:36
jnthn I guess what feels odd to me is this: I view the method as primary and the state to cache it as secondary.
lizmat my $fh is lazy { open $file } will leave { .?close } or something like that
jnthn If I was trying to factor out something to solve this problem, I'd almost certainly be writing a "is cached-on-instance" style trait. 21:37
lizmat s/my/has/
jnthn Which creates an attribute, adds it to the class, and wraps the method.
Heck, given "is cached" on a method will *always* have the invocant in the argument tuple, it's possible that we should have "is cahed" on methods create a secret attribute to cache the things in. 21:38
So that the per-instance cache goes away when the object does
And then the whole thing is method thingy() is cached { ...lazy init here... }
Which I like a whole lot more than trying to dangle it off an attribute. 21:39
It feels odd to declare the means rather than the purpose, imho.
lizmat jnthn: but wouldn't you want things cached between objects of the same class ? 21:42
especially when parallelizing ?
jnthn lizmat: That's my point: "is cached" on methods *already* must be facotring in the instance, 'cus it's just a normal argument 21:43
lizmat: So the current behavior memory leaks.
lizmat looks at the code again
jnthn I may be mis-remembering the code :)
I do think that per-instance application of "is cached" makes sense though
jnthn If you want otherwise, write a sub... :) 21:44
lizmat well, "is cached" is now a Routine trait, so it works both for subs and methods
right?
jnthn Right, but does it treat methods specially in any way?
lizmat no, it does't atm
jnthn OK, so it will be putting self in the arg tuple to cache on, and then preventing objects ever getting freed. 21:45
lizmat gotcha
now .... waking up, finally :-)
jnthn So I'm suggesting that we store the cached things per instance.
So that a simple "is cached" method is enough to handle the lazy init problem, and also generalizes. 21:46
brrt this is too interesting a discussion
yes
brrt wait 21:46
lizmat I must be dense, but I don't see how an cache / instance is helping the lazy init issue
brrt doesn't neither 21:47
:-)
masak 'night, #perl6 21:48
jnthn lizmat: If you have an immutable, lazily initialized attribute, then its semantically equivalent to a method that runs on its first call and caches the value produced
*it's
lizmat gnight masak 21:49
I see what you mean...
except that the cache ever only has one element
jnthn Additionally, hanging it off the attribute is a bit confusing, since only the $.foo style access triggers, the init, not the $!foo. Which I can see tripping people up.
lizmat true that, but that is a more general WAT that I think will be a rite of passage for P6 users 21:50
jnthn lizmat: That's fine, so does he cache on a sub get-thingy is cached { ...gets the thingy once... }
*the
rjbs Can is-cached things be cleared easily enough via some means?
lizmat rjbs: not at the moment. 21:51
jnthn rjbs: Not yet
rjbs That will be important. If "x" is derived at high cost from mutable "y"...
...then when "y" changs, "x" should be cleared but not reocmputed.
lizmat rjbs: S06:2146
synbot6 Link: design.perl6.org/S06.html#line_2146
rjbs Thank you, click... 21:52
brrt is cached on object instances seems rather problematic anyway
rjbs Hm! I think "no caching at all" may be a deal breaker.
Imagine if the attribute was meant to hold a filehandle, and the compiler was running in a "don't bother caching" mode. It's no good. 21:53
brrt well, spec says we don't have to cache at all 21:54
lizmat rjbs: well, then we have once blocks
method fh { once $!fh = open $file; $!fh }
rjbs brrt: Right. That's why I'm saying that "is cached" may not be appropriate.
lizmat: Yeah, things like that. 21:55
lizmat so maybe "once" blocks are the solution to this issue
rjbs My whole mindset right now is "what stuff does Moose make trivial that Perl 6 makes annoying." 21:55
It's fine if that's /intended/, because Moose is built on top of a toolkit, and Perl 6 gives a better toolkit. 21:56
You could build a better Moose with less work, one imagines.
lizmat actually, once already caches:
rjbs but I'd like to get the places where "trivial in Moose, three lines of real code in perl6" into the light
lizmat m: sub a { once 42 }; say a; say a
camelia rakudo-moar 89c43c: OUTPUT«42␤42␤»
rjbs lizmat: I'm not sure that code demonstrates anything?
m: sub a { 42 }; say a; say a 21:57
camelia rakudo-moar 89c43c: OUTPUT«42␤42␤»
lizmat m: sub a { once { say "once"; 42 }; say a; say a
camelia rakudo-moar 89c43c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HuN_L79t3s␤Missing block␤at /tmp/HuN_L79t3s:1␤------> 3 { once { say "once"; 42 }; say a; say a7⏏5<EOL>␤ expecting any of:␤ postfix␤ statement end␤ statement modifier…»
lizmat m: sub a { once { say "once"; 42 } }; say a; say a
camelia rakudo-moar 89c43c: OUTPUT«once␤42␤42␤»
rjbs That's nice!
jnthn Yes, but note the scope is per closure clone rather than per instnace.
I wonder if we could come up with a per-instance variant of "once"... 21:58
But then, that doesn't solve the invalidation issue either.
lizmat that could work with a hidden attribute ?
jnthn lizmat: yeah
rjbs I want to go and do some less interesting things, I'm afraid. But let me just tell you what this looks like in Moose:
jnthn But...again, if invalidation matters...
lizmat same as "once" works with a hidden state var (just explaining)
rjbs has x => (is => 'ro', default => sub { $self->y ** 2 }, clearer => 'clear_x'); 21:59
Sometimes written:
has x => (is => 'ro', lazy_build => 1); sub build_x ($self) { $self->y ** 2 }
with the clear_x implicit
This makes it basically trivial to use attributes as invalidate-able caches. 22:00
Maybe all I want is a trait so I can say: 22:01
has $.x is lazy-built; method build-x { ... }; 22:02
...which implies that the reader for x is a lazy-caching reader, and that a clear-x is generated.
rjbs Anyway: I realize that my depth of work in p6 is shallow, so it's easy for me to ask for something that's not what I should want. I'm very aware of that... but I also want to make sure that I say my peace about what seems to be missing. ;) 22:03
lizmat :-)
brrt uhm, i've got sanity test failures on g89c43cc 22:14
i'm testing a special branch, so that could be it; but i'm just checking here if that's known
lizmat if it's: t/01-sanity/54-use-lib.t 22:15
don't worry
brrt yeah
that one
lizmat will fix that one now
brrt and nativecall?
04-nativecall/02-simple-args.t, seen that one failing too 22:16
thanks :-) 22:17
dalek kudo/nom: 6b4f9be | lizmat++ | t/01-sanity/54-use-lib.t:
Fix sanity test, brrt++ for spotting
22:18
lizmat the nativecall one is one that is awaiting a fix by either FROGGS or jnthn, I forget
brrt lizmat++ thanks
ok, then i'm not worried
Erendis42d ^v^ 22:19
brrt ooh, lots of perl6 on osdc.no 22:21
brrt afk 22:31
timotimo great 22:32
tony-o: did you look at Pluggable yet with the newest CompUnitRepo stuff? (which is probably what makes things fail?) 22:33
tony-o timotimo: i haven't updated http::server::async or pluggable recently, been working on zef and a test harness with "binary" for perl6 22:34
timotimo mhh, OK 22:35
tony-o i have been having a lot of issues with random errors and successes when using the start { } blocks
timotimo well, i use HTTP::Server::Async for a thing i'm developing on and off
tony-o is it working for you? i don't even get one successful request
timotimo right, my thing is supposed to use Proc::Async::Alot, which is currently unstable as F*
tony-o lol 22:36
i haven't seen any issue with Proc::Async and Overwatch but Overwatch uses it in a pretty basic way
timotimo right 22:37
something's racy
tony-o H:S:A seems to work as long as there isn't asynchronous requests
Racy in HSA or in core?
timotimo no, in core
jnthn tony-o: Probably in core; I've fixed a couple of nasty things recently, but have a bunch more to go. 22:38
tony-o i ran into a problem earlier today where END { } block in a module was called prior to the last statement in the main script.. 22:40
lizmat did you use start blocks ? 22:40
or any asynchrony ?
tony-o no start blocks, i awaited any of the async stuff i did in the END block 22:41
i'll see if i can come up with a more concise example 22:42
jnthn 'night, #perl6 22:44
tony-o night 22:45
timotimo gnite jnthn
lizmat also calls it a day 22:46
gnight #perl6!
tony-o night lizmat 22:47
timotimo oh, i need to leave the internets early today as well 22:59
timotimo none of the json_fast tests caught that both "true" and "false" resulted in Bool::True ... 23:08
tony-o does code in an END block run after the process exits? 23:09
Juerd tony-o: How would it run, if not as part of the process? 23:10
tony-o as part of a sub process that isn't killed when the parent exits 23:11
tony-o i get output after 'prove' thinks the process exited 23:11
even though bash doesn't think so, so i guess it's a problem with prove
timotimo and JSON::Fast's nom-ws is tha allocation king, at 7102971 BOOTCode objects 23:25
andreoss m: my $x = 123; say $x.reverse
camelia rakudo-moar 6b4f9b: OUTPUT«123␤»
andreoss how do i find out from which class method is inherited? 23:26
Erendis42d re 23:29
TimToady m: my $x = 123; say $x.can("reverse")[0].signature 23:31
camelia rakudo-moar 6b4f9b: OUTPUT«(Any: *%_)␤»
TimToady m: my $x = 123; say $x.can("flip")[0].signature
camelia rakudo-moar 6b4f9b: OUTPUT«(Cool: *%_)␤»
TimToady that's the one you want
andreoss .reverse appears undocumented doc.perl6.org/type/Any 23:32
what is it supposed to do? 23:33
TimToady well, it's really a List op, but most of the list ops actually live in Any due to the desire to treat a single element as a degenerate list of one element
"sure, I can reverse a list containing one element!" 23:34
TimToady so if you search for 'reverse' on docs, it takes you straight to a page that says you should use 'flip' on strings :) 23:35
similarly, flip is really a string op, despite living in Cool 23:36
TimToady well, the one that 123 finds, anyway 23:37
m: my $x = '123'; say $x.can("flip")[0].signature
camelia rakudo-moar 6b4f9b: OUTPUT«(Str: Any |)␤»
nebuchadnezzar TimToady: so, one need to check for type instead of $x.can ?
TimToady the auto-coercsions in general are defined by finding a candidate outside the normal one, which coerces to the normal type and then calls the normal method 23:38
m: my $x = (123,).list; say $x.can("reverse")[0].signature 23:39
camelia rakudo-moar 6b4f9b: OUTPUT«(List: *%_)␤»
TimToady the docs could probably be a bit clearer about the distinction
andreoss i've always forgot to use the search on the doc.perl6 since it's needed JS, and i have it turned off 23:40
TimToady everything has advantages and disadvantages :)
andreoss is there a plan for some optional warnings for using List methods on non-List objects? 23:42
TimToady one could do that with an alternative setting, I suppose, that overloaded the Any class with warning methods 23:44
TimToady more sightseeing & 23:46
tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { self.WALK(:name<r>)[0].signature.say; }; }; B.new.s;
camelia rakudo-moar 6b4f9b: OUTPUT«(A: *%_)␤»
tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { self.WALK(:name<r>).perl.say; }; }; B.new.s;
camelia rakudo-moar 6b4f9b: OUTPUT«[method r (A $: *%_) { #`(Method|53612824) ... }]<>␤»
adu TimToady! 23:47
yoleaux 25 Apr 2015 03:45Z <labster> adu: facts are facts
3 May 2015 19:36Z <raydiak> adu: github.com/andydude/p6-c-parser/issues/4
adu damnit, I need to login more
adu has been busy working and saving for a house 23:48
raydiak? 23:49
raydiak: ping
tony-o andreoss: this will give you just the 'A' part
m: class A { method r(){ "hi".say; }; }; class B is A { method s() { self.WALK(:name<r>)[0].package.say; }; }; B.new.s;
camelia rakudo-moar 6b4f9b: OUTPUT«(A)␤»
tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { (self.WALK(:name<r>)[0].package ~~ B).say; }; }; B.new.s; 23:50
camelia rakudo-moar 6b4f9b: OUTPUT«False␤»
tony-o m: class A { method r(){ "hi".say; }; }; class B is A { method s() { (self.WALK(:name<r>)[0].package ~~ A).say; }; }; B.new.s;
camelia rakudo-moar 6b4f9b: OUTPUT«True␤»
adu I can't find any documentation about "__extension__" 23:54