»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
SmokeMachine jnthn: thanks! 00:01
timotimo now we just need to introduce meta-meta-methods 00:10
jnthn Already have them :P 00:12
Though we don't have a .^^foo syntax :P
timotimo yeah, that's what's missing 00:13
SmokeMachine I think that works well to use meta methods to interact with the database... 00:34
ryn1x Seems like when I use perl6-debug-m with a script that has a MAIN() sub it always start off with a Exception Thrown Died... does this happen for anyone else? 00:57
Same with debigging with NativeCall subroutines... I need to hit enter 4 times to move past 3 Exception Thown Died messages... 01:01
ryn1x but the script runs fine other than that... not sure where the exceptions are coming from... they only show up in the debugger... 01:02
SmokeMachine Had someone tried Red? 01:52
buggable New CPAN upload: Graphics-TinyTIFF-0.0.4.tar.gz by RYNIX modules.perl6.org/dist/Graphics::Ti...cpan:RYNIX 02:04
ryn1x m: say ( [1..100].hyper.map({$_+1}) == [1..100].race.map({$_+1}) ) 02:24
camelia True
lookatme_q m: say ( [1..100].hyper.map({$_+1}) eqv [1..100].race.map({$_+1}) ) 02:25
camelia False
lookatme_q m: say ( [1..100].hyper.map({$_+1}) [==] [1..100].race.map({$_+1}) ) 02:26
camelia True
lookatme_q m: say ( [1..100].hyper.map({$_+1}) >>==<< [1..100].race.map({$_+1}) )
camelia (True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True True …
ryn1x Is "output order" different than the order of the elements in the array? I thought race would return out of order? 02:27
or does that mean the values of each element in the array may not be calculated in order? 02:28
lookatme_q It not preserve the order
It's
ryn1x But it is preserving the order in the above examples just by luck? 02:29
lookatme_q you mean the == version ? 02:30
I think it is compare the elements number
You should use eqv
ryn1x is you example with >>==<< saying true for each element that has the same value in each list? 02:31
lookatme_q yeah, that's strange 02:33
ryn1x m: say [1..100].hyper.map({$_+1}).WHAT; say [1..100].race.map({$_+1}).WHAT; 02:34
camelia (HyperSeq)
(RaceSeq)
ryn1x ^ is that y eqv is false...
but the elements and their order from each seem to match...
I am wondering if race just means you can't count on the value of another element in the array because they are calculated in parallel (out of order), but that does not mean the elements of the list are returned out of order? 02:36
lookatme_q no, the documents is clear about the order : docs.perl6.org/routine/race 02:38
ryn1x m: say (1, 9, 6).hyper.map(* + 5);
camelia (6 14 11)
ryn1x m: say (1, 9, 6).race.map(* + 5);
camelia (6 14 11)
ryn1x 6guts.wordpress.com/2017/03/16/con...semantics/ 02:39
^ yeah so is that article
just weird I have not seen an out of order result yet
lookatme_q Maybe because the code is so simple ? 02:41
m: say ((^100).race.map({ say $_ + 1 }).list); 02:47
camelia 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
lookatme_q m: say ((^100).race.map({ for ^($_ % 4) { sleep 0.01; }; say $_ + 1 }).list); 02:47
camelia 1
2
65
66
3
67
4
5
6
68
69
70
7
71
8
9
10
72
73
74
11
75
12
13
14
76
77
78
15
79
16
17
18
80
81
82
19
83
20
21
22
84
85
86
23
87
24
25
26
88
89
90
lookatme_q m: say ((^100).hyper.map({ for ^($_ % 4) { sleep 0.01; }; say $_ + 1 }).list);
camelia 1
2
65
66
3
67
4
5
6
68
69
70
7
71
8
9
10
72
73
74
11
75
12
13
14
76
77
78
15
79
16
17
18
80
81
82
19
83
20
21
22
84
85
86
23
87
24
25
26
88
89
90
lookatme_q m: say ((^100).hyper.map({ for ^($_ % 4) { sleep 0.01; }; $_ + 1 }).list); 02:48
camelia (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 8…
lookatme_q m: say ((^100).race.map({ for ^($_ % 4) { sleep 0.01; }; $_ + 1 }).list);
camelia (65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 …
lookatme_q ryn1x, ^ example maybe helpful 02:49
ryn1x \o/
I'm guessing the internals have changed since the examples in the docs and blog posts have been written and, like you said, simple examples just come out in order most of the time now 02:50
lookatme_q yeah, that's right! 02:54
SmokeMachine .tell pmurias I’m getting 404 for 6pad
yoleaux SmokeMachine: I'll pass your message to pmurias.
timotimo the default batch size for race and hyper are probably too big to actually make a difference here, and with something as quick as $_ + 1 it will barely get to consider a second worker necessary, since the one worker will probably have finished processing the batch before the splitter has created the second batch 04:04
AlexDaniel El_Che: 2018.12 is out 06:38
jmerelo AlexDaniel: yay! 06:41
AlexDaniel++
AlexDaniel: Maybe later on I'll make a pull request that links the commits... I'd like to know the authors is all. 06:43
AlexDaniel: for the time being, great job.
jmerelo .seen jnthn 07:11
yoleaux I saw jnthn 00:12Z in #perl6: <jnthn> Though we don't have a .^^foo syntax :P
jmerelo .tell jnthn how's tomorrow Advent article going? 07:11
yoleaux jmerelo: I'll pass your message to jnthn.
jmerelo AlexDaniel: and how's the artitle of the day after tomorrow going?
AlexDaniel` Will work on it shortly! 07:19
jmerelo AlexDaniel`: Great :-) 07:47
ufobat_ yeah i've got my perl6 on windows 08:58
schmjueg p6: say 3; 09:34
camelia 3
ufobat_ ah on windows perl6 doesn't work in the git-shell, perl6.bat would work. thats because the git-shell is a bash. maybe an alias is going to help me 10:21
cono do I understand this correct, that this: perl6 -e 'say (^100).race(:10batch, :4degree).map({$*THREAD.id.say; $_ ** 2}).list' | sort -u should show me at least couple of different thread.ids and first line shouldn't be ordered? 10:52
masak nit-picky but curious question: do you feel that :10batch reads better in your code than :batch(10)? or is it simply a "this is shorter, therefore better" kind of thing? ;) 10:54
cono one liner
in my code I usually prefer older style w/ => 10:55
masak understood
cono but also like :$degree, this is kind kilelr feature for me
masak oh, no argument there
jnthn cono: There probably just ain't enough work in the for it to be bothered spawning a ton of threads. 11:01
yoleaux 07:11Z <jmerelo> jnthn: how's tomorrow Advent article going?
jnthn Also, when the work is so uniformly sized and small, disordering isn't enormously likely. 11:02
cono jnthn: i've tried biiig numbers, same result ) 11:05
holyghost ok, I'm on vacation for a few days, merry christmass all ! 11:17
jnthn cono: The problem isn't the size of the range, it's that if the work in the block is so tiny, then the time taking to iterate the range, batch the values up, and send them off for processing takes as long as the processing itself, so by the time the next batch is ready, the last one is already processed by the worker. 11:22
cono ah, got it. so sleep inside the block should give me something? 11:25
jnthn yeah, `sleep rand` for example gives plenty of IDs :) 11:35
buggable New CPAN upload: Algorithm-LDA-0.0.7.tar.gz by TITSUKI modules.perl6.org/dist/Algorithm::L...an:TITSUKI 11:54
cono jnthn: gives me same :( perl6 -e 'say (^10).race(:10batch, :4degree).map({sleep(rand); $*THREAD.id.say; $_ ** 2}).list' | sort -u 12:38
cono also I'm assuming that this code should run around 1 sec: perl6 -e 'say (^10).race(:10batch, :4degree).map({sleep(1); $*THREAD.id.say; $_ ** 2}).list' | sort -u 12:39
but it takes 10 sec
lizmat sleep blocks the thread
cono lizmat: yeah, and if I ask 4degree, that means that another thread should start look onto next item? 12:44
lizmat :4 degree means that at *most* 4 threads will be working at this at a time 12:45
cono so if 1 blocked, why second one not picking the work? 12:46
lizmat because there's only enough work for 1 thread with :10batch ?
lizmat ^10 has 10 elements? 12:46
cono omg, stupid me :) 12:51
thanks for pointing this out
lizmat cono: np, keep up the good work! 12:52
SmokeMachine Hi! have someone tried Red? It has a few tests, but Im thinking of publishing it... what do you guys think? 14:19
tobs` m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: |%data 14:46
camelia A.new(a => [[1, 2, 3],])
tobs` Can someone help me get the /flat/ contents of %data<a> into the A object? 14:47
masak m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: a => |%data<a> 14:53
camelia A.new(a => [1, 2, 3])
tobs` m: class A { has $.a }; my %data = a => $[1,2,3]; dd A.new: |%data # would require the tiniest diff, I suppose, but the "wrong" sigil feels weird
camelia A.new(a => $[1, 2, 3])
tobs` m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: |%data.map({ .key => |.value }) 14:54
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
tobs` masak: does this generalize somehow? 14:55
masak m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: |%data.map({ .key => slip(.value) }).hash
camelia A.new(a => [slip(1, 2, 3),])
masak hm, guess I went one too far with that one ;)
for the record, I find this kind of dealing with all the list-like data structures in Perl 6 to be very difficult to form an "intuition" for 14:56
usually what I have to do is fumble around in the dark for exactly the right set of incantations 14:57
tadzik I only read that line and it sounds like programming
masak whereas in (say) JavaScript I can usually also reason my way to the right solution, by (e.g.) cancelling [] braces agains ... spreads
against*
tadzik is going through the 3rd vCard Perl module this week
having read further, I agree completely 14:58
tobs` I know that record
tobs` sings along
masak I won't pretend programming in general isn't often like that :)
but I mean this part of Perl 6 in *particular* is that
tadzik indee
masak I'm usually a nice person and I don't like to ruffle feathers, but I think this bit of Perl 6 data structures is basically a failed experiment
tadzik I recently wrote code that just loops through a list with a for because I was tired of figuring out how to make it flaten in the context I wanted or something
masak I'd rather it be dead simple and easy to reason about than super-powerful and hard to use 14:59
moritz agrees 15:01
masak not calling for a big teardown of what's there or anything. I just reserve the right to be a Christmas Grinch over this 15:02
jnthn m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: |%data.Map 15:05
camelia A.new(a => [1, 2, 3])
tobs` jnthn: thanks but why? :-) 15:06
jnthn tobs`: Coercing to a Map drops the itemization that Hash enforces 15:07
masak needs to look up what a Map is again :)
jnthn m: class A { has @.a }; my %data is Map = a => [1,2,3]; dd A.new: |%data
camelia A.new(a => [1, 2, 3])
jnthn Or just make it a Map in the first place
tobs` ah, I see! That's also why the slip object got into the array in one of masak's attempts 15:08
tobs` m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: |%data.map({ .key => slip(.value) }).hash 15:09
camelia A.new(a => [slip(1, 2, 3),])
tobs` m: class A { has @.a }; my %data = a => $[1,2,3]; dd A.new: |%data.map({ .key => slip(.value) }).Map
camelia A.new(a => [1, 2, 3])
tobs` (of course, slip is not needed now but I think I understand it, jnthn++) 15:10
tobs` m: my $s = 0; { say $start, " vs. ", ENTER $start; do { $start++ }; say $start, " vs. ", ENTER $start } 15:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$start' is not declared
at <tmp>:1
------> 3my $s = 0; { say 7⏏5$start, " vs. ", ENTER $start; do { $sta
tobs` m: my $start = 0; { say $start, " vs. ", ENTER $start; do { $start++ }; say $start, " vs. ", ENTER $start }
camelia 0 vs. 0
1 vs. 1
tobs` m: my $start = 0; { say $start, " vs. ", ENTER $start; $start++; say $start, " vs. ", ENTER $start }
camelia 0 vs. 0
1 vs. 1
tobs` hmm, I thought I knew the question I wanted to ask but the second line makes me reconsider 15:48
and re-read
tobs` m: my $start = 0; { $start++; say $start == ENTER $start } 15:54
camelia True
tobs` My question is: why is this not false? I expect `ENTER $start` to be the value of $start when the block is entered, i.e. 0. 15:55
tobs` m: my $start = 0; for 1..3 { $start += $_; say $start, "vs.", ENTER $ = $start } 16:01
camelia 1vs.0
3vs.1
6vs.3
jnthn ENTER evaluates to the container $start, not the value in it (thus why the $ = works, though another way is `ENTER $start<>` 16:07
tobs` quite tricky those containers. thanks, jnthn 16:11
ryn1x I am getting intermittent errors when calling a native sub from a module. If I call the sub once or twice it works, but three or more times and it fails... The sub returns a pointer and I wonder if something is going on with pre-compilation? 16:14
The error is something like: This type cannot unbox to a native string: P6opaque, Int in sub TinyTIFFReader_open at /long/path/.precomp/hash-looking-dirs 16:16
The code: github.com/ryn1x/Graphics-TinyTIFF....pm6#L6-L8 16:19
Has anyone experienced somthing similar?
Found the error. Just had to talk it out ha! 16:23
My signature has `str is rw`. Just had to remove the is rw.
I put `is rw` because the c++ code showed a pointer, but I missed it was a char* at some point which should just be a str in perl. 16:25
buggable New CPAN upload: Graphics-TinyTIFF-0.0.5.tar.gz by RYNIX modules.perl6.org/dist/Graphics::Ti...cpan:RYNIX 16:54
ryn1x_ m: use NativeCall; my @a = CArray[num32].new(1e0 .. 100e0); say @a[0]; 17:20
camelia NativeCall::Types::CArray[num32].new
ryn1x_ use NativeCall; my @b = CArray[num32].new(1e0 .. 100e0); say $b[0] 17:21
ryn1x_ m: use NativeCall; my @b = CArray[num32].new(1e0 .. 100e0); say $b[0] 17:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$b' is not declared. Did you mean '@b'?
at <tmp>:1
------> 3 = CArray[num32].new(1e0 .. 100e0); say 7⏏5$b[0]
ryn1x_ m: use NativeCall; my $b = CArray[num32].new(1e0 .. 100e0); say $b[0];
camelia 1
jnthn "Post scheduled for Dec 22, 2018 1:00 AM!
Yay :)
jnthn .tell jmerelo Post is scheduled, with multiple hours to spare, even :) 17:22
yoleaux jnthn: I'll pass your message to jmerelo.
ryn1x_ So assigning a CArray to a positional incorrect? It should be assigned to a scalar? 17:23
El_Che weekly: Rakudo Linux packages released. 21:03
notable6 El_Che, Noted!
lizmat El_Che++ 21:04
timotimo nice
con How can I use posix Lgamma in perl6? 21:16
timotimo you should be able to use NativeCall for that relatively easily 21:17
con thanks I'll look that up
moritz m: use NativeCall; sub lgamma(num --> num) is native(Str) {}; say lgamma(3e0) 21:33
camelia Potential difficulties:
In 'lgamma' routine declaration - Not an accepted NativeCall type for parameter [1] : num
--> For Numerical type, use the appropriate int32/int64/num64...
at <tmp>:1
------> 3use NativeCall; sub lgamm…
moritz m: use NativeCall; sub lgamma(num64 --> num64) is native(Str) {}; say lgamma(3e0)
camelia 0.6931471805599453
moritz con: ^^ something like that
buggable New CPAN upload: Graphics-TinyTIFF-0.0.6.tar.gz by RYNIX modules.perl6.org/dist/Graphics::Ti...cpan:RYNIX 22:14
Xliff Wow! Compile times in 2018.12 have increased, dramatically! 22:52
vrurg Xliff: I hope you don't mean "it compiles longer now"? ;) 23:00
lizmat Xliff: which compile time are you referring to: the setting, or more general? 23:14
Xliff lizmat/vrurg: Compile times in general. 23:19
Can you put an SVG in a gist?
github.com/Xliff/p6-GtkPlus/blob/m...1-0301.svg 23:21
Unfortunately, tooltips don't show on that version. You'll need to download it and hover to see them. 23:23
The straight verticals reprents average parse. As you can see, it's significantly higher than all of the others. 23:24
jnthn Parse, or the whole compile?
Xliff parse
jnthn As in, from stagestats?
Xliff Yes 23:25
jnthn Wow. That's interesting.
Especially given I don't recall seeing any particular change in CORE.setting's stage parse (unless it happened in the last couple of days, when I probably didn't do a fresh build)
Xliff The latest result set is from this morning's release of 2018.12 23:26
You can see the raw data in that directory.
vrurg Xliff: do I need anything besides build.sh to try collecting the stats on my system? 23:36
AlexDaniel Xliff: holy shit that graph 23:37
nice
Xliff: what is stats/LastBuildResults-201812-20181221 ?
can you put a SHA there instead?
because right after the release cur-candidates branch was merged