00:01 tgt_ left 00:03 xenoterracide left 00:07 virtualsue left 00:27 zwut00 joined 00:28 zwut00 left 00:35 berekuk_ left 00:41 go|dfish left, clsn joined 00:45 go|dfish joined 00:52 ty joined, ty is now known as Guest69589 01:01 jnap left 01:03 fridim__ joined 01:08 hoverboard left 01:25 stevan_ joined 02:02 jnap joined 02:03 xenoterracide joined 02:06 jnap left 02:09 hoverboard joined 02:21 bowtie joined 02:29 stevan_ left 02:30 stevan_ joined 02:32 FROGGS_ joined 02:36 FROGGS left 02:45 jnap joined 02:46 klapperl_ joined 02:49 klapperl left, jnap left 03:07 FROGGS_ left 03:31 fridim__ left 03:34 jnap joined 03:37 rhe joined 03:38 rhe left 03:51 xenoterracide left 04:02 __thou left 04:03 araujo left 04:08 jnap left 04:12 xenoterracide joined 04:17 xinming_ left, xinming joined 04:47 xinming_ joined 04:50 xinming left 05:05 BenGoldberg left 05:08 wooden joined, wooden left, wooden joined 05:44 xinming_ left 05:45 xinming joined 05:47 wooden left
lue r: sub foo($a) { say $a.perl }; foo; foo(one(1,2,3)); # I would expect this to fail, because Junction !~~ Any . Is this just a WAT on my part? 05:51
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Calling 'foo' requires arguments␤ Expected: :(Any $a)␤at /tmp/tmpfile:1␤------> [32msub foo($a) { say $a.perl }; [33m⏏[31mfoo; foo(on…»
lue r: sub foo($a?) { say $a.perl }; foo; foo(one(1,2,3)); # I would expect this to fail, because Junction !~~ Any . Is this just a WAT on my part? 05:53
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«Any␤1␤2␤3␤»
lue Unlike normal declaration (my $a = Junction vs. my Any $a = Junction), this will work with sub foo(Any $a?) 05:59
Does seem to be a WAT on my part in any case. 06:00
TimToady r: sub foo($a?) { say $a }; foo; say foo(one(1,2,3)).perl; 06:03
yoleaux 28 Feb 2014 23:18Z <lue> TimToady: if I read the last section of S08 correctly (and correctly understand that \foo operates on a Parcel basis), does that mean \foo is considerable as a replacement for ¢foo ?
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«(Any)␤1␤2␤3␤one(Bool::True, Bool::True, Bool::True)␤»
TimToady it's just autothreading like it's supposed to
lue gets the idea the Junctions both are and aren't suitable to be specified as a type, as opposed to a more generic construct, which is strangely appropriate :P 06:04
TimToady: is there a way to say that you want to treat the junction as one object, instead of something to be autothreaded? The only thing I've found is "Junction $a", which sorta ruins the point of the example I was trying to construct. 06:06
TimToady well, you'd have to construct an object with a Junction attribute in order to treat one as an object 06:08
Junction is outside Any because it's a concept, not an object
06:10 hoverboard left
Timbus r: sub foo($a?) { say $a.perl }; foo; foo(\one(1,2,3)); 06:10
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«Any␤Capture.new( list => (one(1, 2, 3),).list, hash => EnumMap.new())␤»
lue OK then. Guess that means my example will have to contend with a boring Mu type to demonstrate that parameters types are Any by default :/ 06:11
06:35 Guest14435 joined
Guest14435 perl6: say [+] 1,2,3,4 06:37
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279, niecza v24-109-g48a8de3: OUTPUT«10␤» 06:38
Guest14435 perl6: say [*] 1,2,3,4 06:39
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279, niecza v24-109-g48a8de3: OUTPUT«24␤»
Guest14435 niecza: say (1,2,3,4) 􏿽xC2􏿽xC2􏿽xBB+«(6,7,8,9) 06:42
camelia niecza v24-109-g48a8de3: OUTPUT«[31m===[0mSORRY![31m===[0m␤␤Two terms in a row at /tmp/y_2Qdm_F26 line 1:␤------> [32msay (1,2,3,4) [33m⏏[31m»+«(6,7,8,9)[0m␤␤Parse failed␤␤»
06:46 Guest14435 left 06:48 vincent22 joined
vincent22 perl6: (1,2,3) »+« (4,5,6) 06:50
camelia ( no output )
vincent22 per6: (1,3,4) «+» (5,6,7) 06:51
TimToady you need a "say"
vincent22 perl6: say (1,2,3) »+« (4,5,6)
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279, niecza v24-109-g48a8de3: OUTPUT«5 7 9␤»
vincent22 per6: say (1,3,4) «+» (5,6,7)
TimToady: thank you! 06:52
per6: say (1,3,4) «+» (5,6,7) 06:53
TimToady yu need an 'l'
I need an 'o' :)
vincent22 perl6: say (1,2,3,4) »+« (4,5,6,1) 06:56
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279, niecza v24-109-g48a8de3: OUTPUT«5 7 9 5␤»
vincent22 perl6: say (1,2,3,4,5,6,7,8,9) »+« (4,5,6,1)
camelia rakudo-jvm c62279: OUTPUT«Lists on both side of non-dwimmy hyperop of infix:<+> are not of the same length␤left: 9 elements, right: 4 elements␤ in sub hyper at gen/jvm/CORE.setting:16736␤ in sub hyper at gen/jvm/CORE.setting:16727␤ in block at gen/jvm/CORE.setting:16716…»
..rakudo-parrot c62279: OUTPUT«Lists on both side of non-dwimmy hyperop of infix:<+> are not of the same length␤left: 9 elements, right: 4 elements␤ in sub hyper at gen/parrot/CORE.setting:16987␤ in sub hyper at gen/parrot/CORE.setting:16975␤ in block at gen/parrot/CORE.se…»
..rakudo-moar c62279: OUTPUT«Lists on both side of non-dwimmy hyperop of infix:<+> are not of the same length␤left: 9 elements, right: 4 elements␤ in sub hyper at src/gen/m-CORE.setting:16733␤ in sub hyper at src/gen/m-CORE.setting:16724␤ in block at src/gen/m-CORE.setting…»
..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Ran off end of non-dwimmy right␤ at /home/p6eval/niecza/lib/CORE.setting line 1536 (die @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3347 (ANON @ 34) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3353 (_hyper_posi…» 06:57
07:00 vincent22 left 07:33 darutoko joined 07:51 pragma- joined
pragma- whoever drew that Camelia thing should be taken out back and shot. 07:51
that is all.
07:51 pragma- left 08:03 darutoko- joined 08:05 darutoko left, darutoko joined 08:07 darutoko- left 08:09 berekuk joined 08:19 berekuk left 08:24 bjz joined 08:27 bjz_ left 08:35 bjz left, bjz_ joined 08:43 xinming left 08:49 dmol joined 09:03 pippo joined 09:09 colomon left 09:10 colomon joined, rindolf joined 09:21 molaf joined 09:24 zaydon joined 09:25 zaydon left, xinming joined
timotimo that doesn't sound like fun 09:27
09:39 molaf left 09:42 bjz_ left 09:45 bjz joined
masak unless you shoot them with squeaky mice. 09:51
09:52 spider-mario joined
moritz \o 09:54
pippo j: say 3,3,1...4; 09:55
camelia rakudo-jvm c62279: OUTPUT«Unable to deduce sequence␤ in method sink at gen/jvm/CORE.setting:12252␤ in block at gen/jvm/CORE.setting:16285␤ in block at gen/jvm/CORE.setting:7503␤ in block at gen/jvm/CORE.setting:7505␤ in method reify at gen/jvm/CORE.setting:7531␤ …»
pippo m: say 3,3,1...4;
camelia rakudo-moar c62279: OUTPUT«===SORRY!===␤Unable to deduce sequence␤»
09:55 tgt joined
pippo m: say (3,3,1...4) <<+>> 1; 09:57
camelia rakudo-moar c62279: OUTPUT«===SORRY!===␤Unable to deduce sequence␤»
pippo m: say 1; 09:58
camelia rakudo-moar c62279: OUTPUT«1␤»
10:11 Rotwang joined 10:12 pippo left 10:13 pippo joined, pippo left, pippo joined 10:17 xenoterracide left, xenoterracide_ joined 10:19 pippo left 10:20 pippo joined 10:21 Alula joined 10:23 pippo left 10:25 pippo joined 10:31 xenoterracide_ left
timotimo how is 3,3,1...4 supposed to work? o_O 10:36
10:38 denis_boyun joined
moritz not at all 10:41
10:46 berekuk joined
colomon I tried running emmentaler on Moar overnight, it looks like it crashed (after quite a few tests) with the message "Invalid opcode executed (corrupt bytecode stream?) opcode 3584" 10:48
masak o.O 10:49
colomon hmmm, wonder if the crash is deterministic. 11:00
./smoker projects.json
===SORRY!===
Missing or wrong version of dependency 'lib/File/Find.pm'
:\
11:01 berekuk left 11:05 berekuk joined 11:15 kurahaupo_mobile joined 11:23 berekuk left 11:25 xinming_ joined 11:28 xinming left 11:32 pdcawley left 11:42 pdcawley joined 11:52 berekuk joined
colomon so, pandabrew/bin/pandabrew rebootstrap fixed the "Missing or wrong…" problem above. 11:55
jnthn 3584 is not a valid opcode number, I'm fairly sure of that :)
colomon as nearly as I can figure, this means emmentaler somehow broke the p6 module library
ooo, it is repeatable, and the File::Find thing is partially explained. 12:00
==> Successfully installed File::Find
Invalid opcode executed (corrupt bytecode stream?) opcode 3584
jnthn colomon: Hmm. Can you reduce it to a smaller test case? 12:08
colomon hmmm
timotimo jnthn: what does today's tuit supply look like? :) 12:12
jnthn timotimo: Empty, 'fraid... 12:14
timotimo 'tis okay
jnthn I got done with my course writing workload, but have somebody here to visit for the weekend.
timotimo mi e seems somewhat shallow as well
jnthn So figure I should show them around rather than sit hacking all day :) 12:15
Just ran a spectest to enjoy seeing less S05 fail on r-m though :)
TimToady++
colomon jnthn: shorter way of duplicating the bug: try installing File::Find using panda (on MoarVM) 12:19
12:22 mj41 joined
jnthn colomon: I gotta head out soon, but try gist.github.com/jnthn/9289075 which could tell us the previus op, which may give a hint. 12:26
12:29 kaare_ left
timotimo set a breakpoint to that line and find out when it happens, then time-traveling-debug it? 12:31
could set a breakpoint to whatever the previous opcode is, count how often it gets hit, then "c" over that breakpoint the known number of times - 1 and then turn on recording?
jnthn Sometimes printf is just less work :P 12:32
timotimo :)
colomon hurm, how do I get rakudo to rebuild with that change installed? 12:33
timotimo make m-clean
make -j4 m-install
but you don't need to rebuild
jnthn You don't
Just build a latest Moar and make install it to the same place and run
No need to rebuild nqp or Rakudo for most Moar changes
colomon ah, I did make but not make install 12:34
timotimo that's right (and makes me happy)
12:34 xinming_ left 12:36 xinming joined
colomon ==> Successfully installed File::Find 12:37
12:37 FROGGS joined
colomon Invalid opcode executed (corrupt bytecode stream?) opcode 3584, prev 139 12:37
timotimo invoke_o? 12:43
12:44 Rotwang left
timotimo colomon: can you make panda output the command it invokes? 12:47
and then invoke "moar --dump" with whatever .moarvm file it tries to run?
12:48 treehug88 joined
jnthn Hm, I wonder what it's invoking... 12:48
Gotta head out now, anyways... 12:49
12:50 tgt left
colomon is completely lost in the panda source 12:51
oooo, maybe.... 12:53
"rm_rf" 12:56
so… unlink?
oh, hold on 12:57
12:57 rindolf left
colomon I'll bet it's actually find (from File::Find) 12:57
12:58 Rotwang joined
timotimo if you're in gdb, you can print a traceback with a helper function of moarvm 12:59
colomon not in gdb
I'm just adding "say" all over the panda / shell::command code
timotimo hah :) 13:00
colomon okay, hypothetically it could be map, sort, or reverse, but I'm betting it is find. 13:02
this is the line: for find(dir => $path).map({ .Str }).sort.reverse
and it never gets to the first iteration of the for loop
13:04 xinming_ joined 13:06 xinming left
colomon this sounds kind of weird, but my impression is what is happening is the new File::Find panda compiles (incorrectly?) somehow overrides the File::Find which panda is already using. 13:16
don't really know how to prove that, and I've got $work to do and a five-year-old badgering me to play Lego Star Wars. 13:17
timotimo :D
13:18 rindolf joined 13:23 Rotwang left 13:50 hellwolf joined, hellwolf left
FROGGS dalek is still not here :/ 14:05
14:07 pippo left, pippo joined
FROGGS this is the point where I need to think about open issues left todo in the "eleven" branches 14:12
I guess doing wrapper for installed scripts for windows would be nice to have 14:13
s/doing/doing the/
14:14 xragnar_ joined, xragnar is now known as Guest98635, Guest98635 left, xragnar_ is now known as xragnar 14:29 mtk0 left 14:31 hoverboard joined 14:32 mtk joined 14:43 raydiak__ is now known as raydiak 14:45 kivutar joined 14:56 fridim__ joined
Mouq Shouldn't this be <&test()> or something? github.com/perl6/roast/blob/master...kets.t#L46 15:06
p6: my $pass = 0; my sub test (Int $a = 1) {$pass += $a}; '3.14' ~~ /3 <&test()>/; say $pass 15:07
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at /tmp/tmpfile:1␤------> [32m = 1) {$pass += $a}; '3.14' ~~ /3 <…»
..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Nominal type check failed in binding '$a' in 'test'; got Cursor, needed Int␤ at /tmp/tmpfile line 0 (test @ 1) ␤ at /tmp/tmpfile line 1 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3119 (Regex.ACCEPTS @ 10) …»
Mouq p6: my $pass = 0; my sub test (Cursor $c, Int $a = 1) {$pass += $a; $c}; '3.14' ~~ /3 <&test()>/; say $pass
camelia niecza v24-109-g48a8de3: OUTPUT«1␤»
..rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at /tmp/tmpfile:1␤------> [32m) {$pass += $a; $c}; '3.14' ~~ /3 <…»
Mouq p6: my $pass = 0; my sub test (Cursor $c, Int $a = 1) {$pass += $a; $c}; '3.14' ~~ /3 <&test>/; say $pass 15:08
camelia niecza v24-109-g48a8de3: OUTPUT«1␤»
..rakudo-moar c62279: OUTPUT«P6opaque: no such attribute '$!pos'␤ in method ACCEPTS at src/gen/m-CORE.setting:12593␤ in method ACCEPTS at src/gen/m-CORE.setting:784␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-parrot c62279: OUTPUT«maximum recursion depth exceeded␤current instr.: 'print_exception' pc 139569 (src/gen/p-CORE.setting.pir:59493) (gen/parrot/CORE.setting:10965)␤called from Sub 'Bool' pc 451655 (src/gen/p-CORE.setting.pir:187711) (gen/parrot/CORE.setting:12300)␤cal…»
..rakudo-jvm c62279: OUTPUT«java.lang.RuntimeException: No such attribute '$!pos' for this object␤ in method ACCEPTS at gen/jvm/CORE.setting:12595␤ in method ACCEPTS at gen/jvm/CORE.setting:784␤ in block at /tmp/tmpfile:1␤␤»
Mouq o.O
Well, good job niecza. I'm pretty sure those are faulty tests
15:10 segomos joined
Mouq (Though I'm not certain enough to change them. Someone who feels more confident that they are definitely wrong may) 15:10
r: my $name = 'alpha'; say 'abcdef' ~~ /<::($name)>/ 15:11
camelia rakudo-jvm c62279: OUTPUT«===SORRY!===␤Cannot stringify this␤»
..rakudo-moar c62279: OUTPUT«===SORRY!===␤cannot stringify this␤»
..rakudo-parrot c62279: OUTPUT«No such method 'QAST::Var<-3372209812372949685>' for invocant of type 'Cursor'␤ in regex at /tmp/tmpfile:1␤ in method ACCEPTS at gen/parrot/CORE.setting:12616␤ in method ACCEPTS at gen/parrot/CORE.setting:780␤ in block at /tmp/tmpfile:1␤␤»
15:24 kurahaupo_mobile left 15:25 benabik left, benabik joined
FROGGS The first character after the identifier determines the treatment of the rest of the text before the closing angle. The underlying semantics is that of a function or method call, so if the first character is a left parenthesis, it really is a call to either a method or function: 15:30
<foo('bar')>
Mouq: ^^
but I'd propose to use the & sigil when a sub is meant... calling are sub or method with the same statement feels a bit weird 15:31
hmmm, but it is supposed to take locally delared regexes into account... 15:36
15:36 araujo joined 15:39 pragma- joined 15:42 fridim__ left
Mouq FROGGS: Yeah, I don't know how that works 15:47
r: my regex foo { abcd }; /<foo>/
camelia ( no output )
Mouq r: my regex foo { abcd }; /<&foo>/ 15:48
camelia ( no output )
Mouq r: my regex foo { abcd }; 'abcd' ~~ /<foo>/
camelia ( no output )
Mouq r: my regex foo { abcd }; 'abcd' ~~ /<&foo>/ 15:49
camelia ( no output )
15:56 LLamaRider joined 16:01 araujo left 16:02 araujo joined, araujo left, araujo joined
masak cool tip: put an action class inside a method, and use closure semantics to refer to variables in the method outside of the action class. 16:10
jnthn pro tip: the methods are *not* cloned, they live in the method table ot he class. So never, ever do this if you plan to write multi-threaded code :P 16:11
*of the
(put another way: you ain't getting closure semantics there.)
masak hrm. 16:14
r: class C { method foo { my $x = 0; my class D { method bar { $x++ } }; D.new.bar; say $x } }; C.new.foo for ^2 16:15
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«1␤1␤»
masak jnthn: I fail to see the bit in the above that would blow up with multi-threading.
could you spell it out for me?
(but no, realistically, I don't ever expect to multi-thread this parsing code) 16:16
jnthn masak: Sure. Thread A enters foo. The class block is captured, and so the methods also are. You call D.new.bar. While it's running, thread B enters. It captures the class and methods. Now your action methods will all be seeing thread B's $x. 16:17
There's only one method table. The code objects in it can't point to two outers.
masak the second invocation of foo overwrites the OUTER of the lexpad of the first? 16:18
is there any way to demo that with camelia? maybe with reentrancy instead of multi-threadiness? 16:19
jnthn Well, you can create it with our too I suspect.
16:20 stevan_ left 16:21 arnsholt joined
arnsholt o/ 16:21
jnthn perl6: sub foo($n) { my $y = $n; class A { method m() { say $y } }; foo($n - 1) if $n; A.m }; foo(1) 16:22
camelia niecza v24-109-g48a8de3: OUTPUT«(Any)␤(Any)␤»
..rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«0␤0␤»
jnthn masak: There's a reentrancy based appraoch
o/ arnsholt
masak perl6: sub foo($n) { my $y = $n; my class A { method m() { say $y } }; foo($n - 1) if $n; A.m }; foo(1) 16:25
camelia niecza v24-109-g48a8de3: OUTPUT«(Any)␤(Any)␤»
..rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«0␤0␤»
jnthn The "my" there is just talking about where the symbol A gets installed. 16:26
masak jnthn++
yes, I see it now.
for reentrancy, at least ;)
jnthn You don't get this in JavaScript 'cus you are building a new method table every time in the constructor. ;-)
Of course, that just gives you other issues. :)
masak r: sub foo($n) { my $y = $n; my class A { method m() { say "inside $y" } }; foo($n - 1) if $n; A.m; say "outside $y" }; foo(1)
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«inside 0␤outside 0␤inside 0␤outside 1␤»
masak jnthn: indeed. 16:27
moritz today I used Perl 6 to educate a die-hard OO programmer about closures
masak \o/
arnsholt Cool!
jnthn Today I used Perl 6 to educate a die-hard closures programmer about OO :D
arnsholt Did he see the light, in the end?
moritz gist.github.com/moritz/9292385 is the example I used 16:29
turns out the combination of dir() and IO::Path makes it *very* convenient to write file-recursing code
masak 's a nice example. moritz++ 16:30
moritz it worked on the very first try, without having to worry about concatenating paths, exluding . and .. etc.
masak it's nice because $counter "threads into" the execution of &walk, coroutine-style.
16:33 rindolf left 16:39 dmol left 16:41 pecastro joined 16:46 stevan_ joined
LLamaRider \o/ MoarVM with Panda works great, even my crummy P6 module works well on it 16:47
tadzik++
16:48 mtk left
tadzik :) 16:48
glad to hear that
16:53 xinming_ left
LLamaRider moritz: nice speedup upgrade would be to recurse all subdirs in parallel (if you don't care about the counter that is) 16:53
moritz LLamaRider: that was totally not the purpose :-) 16:54
16:57 treehug88 left
LLamaRider moritz: I just randomly thought of what else would be nice to add in there :) Looks cool in any case. 16:58
16:59 pecastro left
moritz so, what primitives would one use? a supply into which several async blocks feed? 16:59
timotimo you can just put a whole bunch of start { } blocks and awaits 17:00
start each sub directory, await the result of them all
moritz but I want to call the callback as soon as a result is available 17:01
timotimo oh
good point i guess
the supply doesn't do any synchronisation, so you'd probably want to use a channel instead 17:02
LLamaRider you can just not wait for them to return, just let each subdir do its own thing and print from the callback. If you don't care about getting the list back, that's most efficient.
moritz timotimo: but the channel blocks on read, no?
LLamaRider: but I use an unsafe operation ($counter++) in the callback
LLamaRider: so I need some form of synchronization
timotimo since the channel would cause the stuff to get serialised
17:03 pecastro joined
moritz first I should rewrite it as non-recursive 17:03
because then I use an arrays as queue 17:05
timotimo ah
17:05 xinming joined
timotimo so that's what you mean, yeah 17:05
now i get it :)
17:06 skids joined
timotimo well, supplies call the subscribed methods immediately after .more-ing a value 17:07
so that may indeed be a good target for a callback; though it could run multiple at the same time if you have multiple threads traversing the directories 17:08
jnthn If you have many threads producing results that a single consumer should nom, then a Channel is the right thing. 17:09
timotimo yay, i said a right! :)
jnthn Or even one thread producing and another consuming concurrently.
timotimo if the callback is very cheap, it may not even be worth it 17:10
moritz I don't want to parellize the callback, but the directory reading
timotimo rakudo is kind of still far away from getting I/O bottlenecked when traversing directory trees :) 17:11
17:14 zakharyas joined
LLamaRider Hm, was just invited to give a Perl talk to a bunch of undergrads in the Computer Science club at my uni. They have a series of talks on languages they've used in internships and such. Thinking if I present something it should be Perl 6. 17:16
Any recommendations for punch-packed materials that would grab the short attention spans of hipster undergrads? :> 17:17
moritz \o/ it seems to work 17:20
timotimo moritz: soon on moar, too :3 17:23
17:23 mtk joined
moritz gist.github.com/moritz/9293475 that's the parallel version 17:24
and it seems to run quite fast, though when it's done it seems to hang forever 17:25
maybe when it awaits all those promises 17:26
LLamaRider moritz++ thanks for indulging me :> Which backend are you using?
arnsholt Does Panda working on Moar mean that NativeCall on Moar is close to the to the top of the list of blockers for a Moar star?
timotimo it's quite cool that you can for $dirs.list outside and $dirs.send inside
moritz LLamaRider: I developed the serial version on moar, but parallel stuff only works on the JVM atm
timotimo moritz: i think you want to close the $files
otherwise the $reader won't finish, will it? 17:27
moritz oh
and I have to close $dirs too
but when? 17:28
OH NOEZ 17:29
timotimo after @file-readers perhaps? 17:30
oh, hm.
yeah, that's not really that easy :P 17:31
17:31 bowtie left
moritz I fear the whole thing must be written differently 17:32
timotimo there's not really a way to signalize it's all finished, aye. 17:33
jnthn Channels do have a "completed" mechanism.
If you are doing it that way.
dinner &
timotimo yes, but the code the way it is right now isn't really easily changable for a single point to signalize the channel is finished 17:34
LLamaRider question: isn't having to end blocks with " 1; }; " a code smell ? 17:35
I'm used to doing this in P5's eval{} blocks, but always thought it's a potential sign of bad design. 17:36
moritz LLamaRider: it probably is; I'm simply not yet used to the new sink context rules 17:38
17:38 mtk left
moritz oh, I think I know what I can do 17:40
17:40 rindolf joined
moritz I can .poll the $dirs channel 17:40
17:40 zakharyas left 17:41 mhasch joined
moritz and if .poll doesn't return anything, I can check if all the @file-readers are done, and if yes, call $dirs.close 17:44
mhasch hi #perl6! Quick question:
How do I tell the Configure.pl script in rakudo-star where my icu-config is located ?
17:45 __thou joined
moritz mhasch: you extend PATH to make icu-config available in it 17:45
17:45 kurahaupo_mobile joined 17:47 mtk joined 17:49 kurahaupo_mobile left
moritz gist.github.com/moritz/9293475 # this one seems to work 17:50
186s in serial, 130s in parallel 17:51
17:51 kurahaupo_mobile joined, pippo left
moritz for a full rakudo git repo, including a checkout of roast, nqp, moar and parrot 17:52
18805 files
17:53 kurahaupo__ joined
moritz .poll often doesn't return any elements; doing something more sensible than 'next;' in there would be beneficial 17:54
moritz feels he's doing something RONG
17:55 kurahaupo__ left 17:56 kurahaupo_mobile left, kurahaupo_mobile joined 17:58 kivutar left 17:59 Guest69589 left
moritz I have a list of promises, and want to wait until at least one of them is done 18:00
how do I do that?
winner seems to be the way to do it
but I can't seem to make heads nor tails out of it
vendethiel wants to change that name
(I don't think it really make sense) 18:01
moritz winner * { ... } what does that do? 18:02
vendethiel > nk 18:06
> so any(@files X~ '.' X~ @extensions) Xeqv @best | @good
does | flatten ?
let's find out! 18:13
r: say 1 == (1, 2) | (3, 4)
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«any(False, False)␤»
vendethiel not that way!
moritz r: say ((1, 2)| (3, 4)).perl 18:14
vendethiel r: say 1 == [|] (1, 2) (3, 4)
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«any($(1, 2), $(3, 4))␤»
rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> [32msay 1 == [|] (1, 2) [33m⏏[31m(3, 4)[0m␤ expecting any of:␤ postfix␤ …»
vendethiel r: say 1 == [|] (1, 2), (3, 4)
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«any(True, False, False, False)␤»
18:14 kurahaupo__ joined
vendethiel r: say so 1 == [|] (1, 2), (3, 4) 18:14
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«True␤»
vendethiel isn't it kinda inefficient, though :(
moritz seems it does flatten
vendethiel not really
well, not as I meant it, it doesn't generate junctions inside the lists 18:15
18:16 kurahaupo_mobile left, kurahaupo_mobile joined 18:18 kurahaupo__ left 18:22 rindolf left 18:23 fridim__ joined, dmol joined
colomon vendethiel: did you want to get something like (1 | 2) | (3 | 4) out? 18:25
vendethiel colomon: yep. [|] did the job though :) 18:26
mhasch *sigh* miniparrot segfaults the first time it is called in a rakudo-star-2014.01 bootstrap. Are ther known issues I should be aware of? 18:28
18:32 rindolf joined
arnsholt masak: I think you linked a page with an algorithm to efficiently select from a set according to a non-uniform distribution at some point. Do you happen to remember what page? 18:32
colomon arnsholt: isn't that what Bag.pick does?
arnsholt Hmm, probably 18:33
18:33 hoverboard left
colomon I mean, I'm not sure it's the best algo, but it's somewhat functional 18:33
arnsholt Hmm, not the algorithm I'm looking for 18:34
colomon m: my $bag = ('red' => 1000000, 'blue' => 3).Bag; say $bag.pick(20)
camelia rakudo-moar c62279: OUTPUT«red red red red red red red red red red red red red red red red red red red red␤»
arnsholt I'm looking for the algorithm, though, not the Perl 6 implementation 18:35
If what I'm thinking of happens, I'll probably end up doing it in Python 18:37
18:38 telex left 18:40 telex joined
Mouq r: multi a (Int $, |everything) { [+] everything.list }; multi a (Num $, |everything) { [*] everything.list }; say a(1,2,3,4,0); say a(1e1,2,3,4,0) 18:42
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«9␤0␤»
Mouq n: multi a (Int $, |everything) { [+] everything.list }; multi a (Num $, |everything) { [*] everything.list }; say a(1,2,3,4,0); say a(1e1,2,3,4,0)
camelia niecza v24-109-g48a8de3: OUTPUT«9␤0␤»
Mouq Hm. I had the impression |everything would get the first argument too 18:43
TimToady no, it's just a snapshot of the current remaining binding 18:45
maybe you want callsame 18:46
if we have the method form
r: sub foo(|) { &infix:[*].callsame }; say foo 3,4 18:48
Mouq TimToady: The set operators use the type of the first element to deterimine if they should act in a Setty or Baggy way. I was wondering if there was a way to check the type of the first argument of (**@p) while still putting everything in @p
camelia rakudo-moar c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Undeclared name:␤ &infix:<Whatever<139646339443584>> used at line 1␤␤»
..rakudo-jvm c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Undeclared name:␤ &infix:<Whatever<1362387953>> used at line 1␤␤»
..rakudo-parrot c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Undeclared name:␤ &infix:<Whatever<6306859678214230833>> used at line 1␤␤»
TimToady r: sub foo(|) { &infix:<*>.callsame }; say foo 3,4
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«No such method 'callsame' for invocant of type 'Sub+{<anon>}+{Precedence}'␤ in sub foo at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
TimToady nope
nor do we understand &prefix:<[*]> yet, I think 18:49
Mouq We definitely don't understand &prefix:<[*]> yet
TimToady just woke up after sleeping 11 hours, obviously it was my antibiotics that were giving me insomnia
why do I feel like I've been taken out and shot? 18:50
r: multi a (|everything, Int $) { [+] everything.list }; multi a (|everything, Num $) { [*] everything.list }; say a(1,2,3,4,0); say a(1e1,2,3,4,0) 18:52
camelia rakudo-parrot c62279, rakudo-jvm c62279, rakudo-moar c62279: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile␤Cannot put required parameter after variadic parameters␤at /tmp/tmpfile:1␤------> [32mmulti a (|everything, Int $[33m⏏[31m) { [+] everyth…»
TimToady that's supposed to be possible
18:52 xinming_ joined
TimToady since | is supposed to snapshot the curent binding 18:52
S06:1238 18:53
synopsebot Link: perlcabal.org/syn/S06.html#line_1238
18:54 xinming left
Mouq n: multi a (|everything, Int $) { [+] everything.list }; multi a (|everything, Num $) { [*] everything.list }; say a(1,2,3,4,0); say a(1e1,2,3,4,0) 18:54
camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Cannot call &a; none of these signatures match:␤ Int, *@_, *%_␤ Num, *@_, *%_␤ at /tmp/2gBzLGWHtR line 1 (mainline @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/niecza/lib…»
TimToady | is not, in that sense, a variadic parameter, because from the standpoint of the binding, it's supposed to consume 0 args, not all of them. 18:55
From an implementation standpoint, of course, this is problematic, because you don't want to clone the rest of the capture for |
| needs to be fast when it's the final thing
Mouq n: multi a (|everything, |also_everything) { say everything; say also_everything }; a(1,2,3,:abcd) 18:56
camelia niecza v24-109-g48a8de3: OUTPUT«\(1, 2, 3, |{"abcd" => Bool::True})␤\()␤»
Mouq r: multi a (|everything, |also_everything) { say everything; say also_everything }; a(1,2,3,:abcd)
camelia rakudo-parrot c62279: OUTPUT«1 2 3 "abcd" => Bool::True␤1 2 3 "abcd" => Bool::True␤»
..rakudo-jvm c62279: OUTPUT«This representation can not unbox to a native str␤ in block at gen/jvm/CORE.setting:6741␤ in method gist at gen/jvm/CORE.setting:6737␤ in method gist at gen/jvm/CORE.setting:1039␤ in sub say at gen/jvm/CORE.setting:13126␤ in sub a at /tmp/tm…»
..rakudo-moar c62279: OUTPUT«This representation (VMIter) cannot unbox to a native string␤ in block at src/gen/m-CORE.setting:6741␤ in method gist at src/gen/m-CORE.setting:6737␤ in method gist at src/gen/m-CORE.setting:1039␤ in sub say at src/gen/m-CORE.setting:13124␤ …»
Mouq :O parrot++
18:57 pippo joined
FROGGS arnsholt: yes, I think NativeCall and at least one precomp bug are the blockers of r-m* 18:59
TimToady is the binder treating the capture as mutable when it binds args? that is, is | assuming that it can eat all the remaining args?
Mouq has no clue how the binder works 19:00
TimToady too
TimToady should, given his role of designer 19:01
TimToady actually decided to start to delve into the guts last year some time, not just a week ago :) 19:02
19:02 pippo left
TimToady languages designers often spec things that are impossible to implement efficiently :) 19:02
FROGGS TimToady: well, you know both sides :o) 19:03
mhasch impossible is a strong word
19:04 pippo joined
TimToady I was told 14 years ago that I was to stay away from the implementation because they already knew how I implement things, and wanted to do it differently :) 19:04
moritz some of the requirements of p6 are also strong words :-)
TimToady I've been thinking it was time to relax my mostly self-imposed exile there :)
colomon +1
;)
moritz TimToady: when I have a list of promises, how can I wait for the first to finish? 19:05
TimToady it wasn't really so much that they didn't want me to introduce Joe Code to their implementation, but also I didn't want to show favoritism to one effort
await @promises[0]
moritz I meant "first" in the temporal sense, not in the array-index sense 19:06
TimToady ah
you want, like, the "winner" :)
moritz TimToady: that's what I thought too, but I couldn't figure out the correct 'winner' invocation 19:07
19:07 d^_^b joined, d^_^b left, d^_^b joined
TimToady that's why I respecced it to take a list in the opening clause, rather than relying on the cases to enumerate them 19:08
so winner @promises {...} is supposedd to do what you want
moritz what's the '...'?
FROGGS IIRC "winner" is like "given" 19:10