Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-03-31

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

All times shown according to UTC.

Time Nick Message
00:10 AlexDaniel joined #perl6-dev
00:22 Geth ¦ rakudo: MasterDuke17++ created pull request #1052: Enable `make t/spec/<file> HARNESS_TYPE=6` to work
00:22 Geth ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/1052
00:45 Geth ¦ rakudo/nom: 408b4035ea | (Daniel Green)++ | Configure.pl
00:45 Geth ¦ rakudo/nom: Enable `make t/spec/<file> HARNESS_TYPE=6` to work
00:45 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/408b4035ea
00:45 Geth ¦ rakudo/nom: 833c29c0f5 | (Zoffix Znet)++ | Configure.pl
00:45 Geth ¦ rakudo/nom: Merge pull request #1052 from MasterDuke17/allow_harness6_for_single_files
00:45 Geth ¦ rakudo/nom:
00:45 Geth ¦ rakudo/nom: Enable `make t/spec/<file> HARNESS_TYPE=6` to work
00:45 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/833c29c0f5
01:01 MasterDuke Zoffix: fyi re windows v unix path separators, RT #130226 is about the output when using `--ll-exception`
01:01 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=130226
01:16 Zoffix OK
01:22 MasterDuke m: my @a = ^5; my @b = @a[*]; dd @b; my @c = @a[]; dd @c; my @d = @a[0..*]; dd @d
01:22 camelia rakudo-moar 833c29: OUTPUT: «Array @b = [0, 1, 2, 3, 4]␤Array @c = [0, 1, 2, 3, 4]␤Array @d = [0, 1, 2, 3, 4]␤»
01:23 MasterDuke could/would those three ways ^^^ ever give different results?
01:26 MasterDuke m: my @v = ^5; loop (my int $i = 0; $i < 10_000; $i = $i + 1) { @v[] }; say now - INIT now
01:26 camelia rakudo-moar 833c29: OUTPUT: «0.1091065␤»
01:26 MasterDuke m: my @v = ^5; loop (my int $i = 0; $i < 10_000; $i = $i + 1) { @v[*] }; say now - INIT now
01:26 camelia rakudo-moar 833c29: OUTPUT: «0.66615758␤»
01:26 MasterDuke m: my @v = ^5; loop (my int $i = 0; $i < 10_000; $i = $i + 1) { @v[0..*] }; say now - INIT now
01:26 camelia rakudo-moar 833c29: OUTPUT: «1.1111908␤»
01:48 ilbot3 joined #perl6-dev
01:48 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
03:02 ggoebel joined #perl6-dev
03:10 Geth ¦ rakudo: MasterDuke17++ created pull request #1053: Make `my @a = ^10; my @b = @a[*]` 30-40x faster
03:10 Geth ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/1053
03:51 Geth ¦ rakudo: MasterDuke17++ created pull request #1054: Make `my @a = ^10; my @b = @a[0..*]` 50-80x faster
03:51 Geth ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/1054
03:52 MasterDuke those two PRs were inspired by RT #125344
03:52 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=125344
04:40 geekosaur joined #perl6-dev
05:07 geekosaur joined #perl6-dev
05:48 RabidGravy joined #perl6-dev
06:07 [TuxCM] joined #perl6-dev
06:40 [TuxCM] This is Rakudo version 2017.03-71-g833c29c0f built on MoarVM version 2017.03-84-g07448141
06:40 [TuxCM] csv-ip5xs        3.033
06:40 [TuxCM] test            12.305
06:40 [TuxCM] test-t           4.840 - 4.856
06:40 [TuxCM] csv-parser      12.563
06:41 samcv is it faster
06:41 samcv it better be
06:42 samcv well it was 13% faster when i tested it compared to march's release
06:44 samcv is that in seconds or minutes or what
06:49 samcv secs i guess. bbl
08:26 timotimo huggable: speed
08:26 huggable timotimo, http://tux.nl/Talks/CSV6/speed4.html
08:26 timotimo seems like it's barely faster :\
08:48 vendethiel joined #perl6-dev
10:26 Zoffix buggable: speed
10:26 buggable Zoffix, ▂▂▂▁▂▁▁▃▂▂▂▂▂▁▁█▂▂▃▁▁▁▁▁▁▁▁▁▁▁▁▁▂▁▁▁▂▂▁▁▁▁▁▁▅▂▁▁▁▁ data for 2017-03-07–2017-03-31; range: 4.829s–7.664s
10:26 Zoffix Well, seems like we need a better bench :)
12:41 Zoffix ⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐
12:41 Zoffix ⭐⭐⭐
12:41 Zoffix ⭐⭐⭐ Reminder: the deadline to submit your suggestions and corrections to
12:41 Zoffix ⭐⭐⭐           IO Action Plan is TOMORROW, April 1st. You can find the Plan at
12:41 Zoffix ⭐⭐⭐ https://github.com/rakudo/rakudo/blob/​nom/docs/2017-IO-Grant--Action-Plan.md
12:41 Zoffix ⭐⭐⭐
12:41 Zoffix ⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐????⭐⭐⭐
12:42 timotimo Zoffix: i haven't had the energy to give the plan the attention it deserves :<
12:42 Zoffix There were surprisingly few comments on the Plan. I just hope it's not gonna happen that the second I start implementing it, people will start protesting :/
13:06 [Coke] Zoffix: I plan on reviewing tomorrow, fwiw.
13:06 Zoffix What does nqp::unbox_s() do? I see some code using it to unbox Strs into, say, nqp::iseq_s(), but is there any point to doing that?
13:06 Zoffix [Coke]++ thanks
13:07 timotimo yes, there is
13:07 timotimo look at the Str class, it has a str attribute with "is box_target"
13:07 jnthn Hm, but wouldn't we emit the unbox anyway?
13:07 timotimo hm, probably
13:07 jnthn I know that back in the Parrot days there was a notable performance difference
13:08 jnthn Because of various code-gen differences
13:08 jnthn But on MoarVM/JVM and probably thus JS there's likely no need to manually unbox, unless you're storing the result of unboxing in a temporary variable to re-use it
13:08 jnthn Can always check the bytecode produced to be really sure
13:09 jnthn (pre-compile and then moar --dump)
13:11 Zoffix "Unhandled exception: Bytecode stream corrupt (missing magic string)"
13:11 * Zoffix shrugs
13:12 Zoffix timotimo: well, I don't get it. So what that there's that attribute?
13:13 Zoffix m: use nqp; say nqp::iseq_s("x", nqp::unbox_s("x"))
13:13 camelia rakudo-moar 833c29: OUTPUT: «1␤»
13:17 Zoffix --target=mast has the same number of MAST::Op decont for both versions; is that it?
13:17 jnthn I guess it'd be number of unbox_s you'd want to count
13:17 jnthn Though could just diff the 2
13:17 Zoffix unbox_s is there only if used
13:18 jnthn Oh
13:18 jnthn 'cus it's on a literal probably, so we just generate better code in the first place without it :)
13:18 jnthn Try it with my $x = 'x'; and then an nqp::unbox($x) or so
13:19 Zoffix Nothing found with this command: perl6 --target=mast -e 'use nqp; my ($x, $y) = "x", "x"; say nqp::iseq_s($x, $y)' | grep unbox_s
13:22 Zoffix But there are two unbox_s with this one: perl6 --target=mast -e 'use nqp; my ($x, $y) = "x", "x"; say nqp::iseq_s(nqp::unbox_s($x), nqp::unbox_s($y))' | grep unbox_s
13:27 Ven joined #perl6-dev
13:33 Ven_ joined #perl6-dev
13:41 Woodi Zoffix: so none methods in IO::Handle checks for null ?? but overriding currently relevant methods is invitation to future errors, eg. someone add method but forget to add it override part. maybe throw/check could be added somewhere lower so errors can use it ?
13:46 Zoffix Woodi: sounds like a type of problem that is solvable with proper tests rather than a performance penalty, is it not? A .getc repeatedly done on a million-character will need to do a million of such checks.
13:46 Zoffix .lines has to do it per line
13:47 Zoffix I guess it already *does* do it lower, but the error is non-descript, since it has no idea what called the lower-level routine
13:47 Zoffix m: IO::Handle.new.getc
13:47 camelia rakudo-moar 833c29: OUTPUT: «IO::Handle is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method new at src/RESTRICTED.setting line 32␤  in block <unit> at <tmp> line 1␤␤»
13:47 Zoffix ugh
13:47 Zoffix I need an unrestricted bot...
13:48 Zoffix $ perl6 -e 'IO::Handle.new.getc'
13:48 Zoffix read string requires an object with REPR MVMOSHandle (got Scalar with REPR P6opaque)
13:49 Zoffix The problem with mixing in stuff is: (a) it's slowish, is it not? And (b) you can't unmix it
13:49 Woodi re stat: some weeks ago there was article "on" HN that linux do tons of stat per second if some shell env variable for timezone is not set. and 4 stat syscalls for .rwx ?? stat() return  struct stat  with all info at once...
13:49 Zoffix So right now you can actually a re-open the same handle, but with mixing in stuff approach you won't be able to.
13:49 Woodi and mixin into object is at runtime ?
13:50 Zoffix Woodi: I know it does, but we don't use it. .rwx makes 4 separate nqp calls that use 1 item from stat call
13:50 timotimo you can store the original object inside the object itself
13:50 Zoffix Woodi: yeah
13:52 Zoffix m: class Handle { method lines { say "LINES!" }; method close { self.^mixin: role Closed { method lines { say "NO LINES FOR U!" } } } }; my $h = Handle.new; $h.lines; $h.close; $h.lines
13:52 camelia rakudo-moar 833c29: OUTPUT: «LINES!␤NO LINES FOR U!␤»
13:52 Zoffix This is the idea basically. I don't know the sanity of it....
13:53 Zoffix s/NO LINES FOR U/fail "Cannot call .lines on a closed filehandle"/
13:54 Woodi Zoffix: making .xxx-es macro that do stuff at compile time would be nice :)
13:54 * Zoffix doesn't follow
13:55 Zoffix Woodi: what .xxx-es?
13:55 awwaiid joined #perl6-dev
13:55 Zoffix .rwx and stuff? That's result in pretty broken code, considering the data will be valid only when, say, a module was first precompiled :o
13:56 Woodi .rwx = .stat + .r + .w + .x  currently ? one way is to add all .xyz nqp calls but maybe some code generation could help :)
13:57 Zoffix .rwx = .e + .r + .w + .x curently
13:58 Woodi Zoffix: btw. writing things today becouse 1 April it would be tempting to write some strange things ;)
13:59 Woodi postponing deadline to 2.04 could help to clarify eventual strange ideas :)
14:01 Zoffix Or I could just ignore any "strange" ideas.
14:02 Zoffix m: say [>] [2, 1]; say [>] [1, 2]; say [>] [1, 1]
14:02 camelia rakudo-moar 833c29: OUTPUT: «True␤False␤False␤»
14:02 Zoffix m: say [>] $[2, 1]; say [>] $[1, 2]; say [>] $[1, 1]
14:02 camelia rakudo-moar 833c29: OUTPUT: «True␤True␤True␤»
14:03 timotimo it's not april 1st yet where i live
14:07 Woodi Zoffix: .resolve current behaviour is bad ? at least description is not clear
14:09 Woodi yay ! slurp as slurp \o/
14:09 * Zoffix doesn't understand the question
14:10 * Woodi wasn't questioning anything...
14:12 Zoffix OK. There was a question mark :/
14:15 Woodi ah, right. but it was *-2. IMO proposition for .resolve is not clear for me. why current behavior is bad ?
14:16 Woodi and isn't Cat hufmanized too good ? :)
14:17 Zoffix Woodi: because $foo.resolve doesn't give you a fully-resolved path 100% of the time and you have no way to tell when it doesn't
14:19 llfourn joined #perl6-dev
14:20 AlexDaniel joined #perl6-dev
14:29 Woodi Zoffix: "Make :close behaviour the default in IO::Handle" title looks scarry. but proposition is to only change methods that slurp-all by default ?
14:35 Zoffix Woodi: all the listed methods: IO::Handle and IO::Pipe routines .slurp-rest, .lines, .words, .comb, and .split
14:40 [Coke] unicodable6: help
14:40 unicodable6 [Coke], Just type any unicode character or part of a character name. Alternatively, you can also provide a code snippet. # See wiki for more examples: https://github.com/perl6/whateverable/wiki/Unicodable
14:58 Woodi Zoffix: removing .rwx methods from IO::Handle: check man lstat() - it works on open filehandle. using IO::Path instead is not the same.  also no idea what .modified is doing but looks like ActiveRecord functionality :)
14:59 buggable joined #perl6-dev
15:00 Zoffix Woodi: please write all your comments into appropriate spots instead of this chat
15:01 buggable joined #perl6-dev
15:02 buggable joined #perl6-dev
15:04 buggable joined #perl6-dev
15:09 Zoffix looks like the upper range for timings in buggable was buggy... Instead of using $max I was using $min + wrong stuff
15:18 buggable joined #perl6-dev
15:18 Zoffix buggable: speed
15:18 buggable Zoffix, ▂▂▂▁▂▁▁▃▂▂▂▂▂▁▁█▂▂▃▁▁▁▁▁▁▁▁▁▁▁▁▁▂▁▁▁▂▂▁▁▁▁▁▁▅▂▁▁▁▁ data for 2017-03-07–2017-03-31; range: 4.829s–7.664s; 5% faster
15:18 Zoffix buggable: speed 2
15:18 buggable Zoffix, ▁▁ data for 2017-03-31–2017-03-31; range: 4.840s–4.856s; ~0% difference
15:18 Zoffix buggable: speed 5
15:18 buggable Zoffix, ▅▂▁▁▁ data for 2017-03-29–2017-03-31; range: 4.831s–5.099s; 5% faster
15:18 Zoffix buggable: speed 100
15:18 buggable Zoffix, ▂▂▂▂▂▂▂▁▂▂▂▁▂▂▂▂▁▃▁▃▁▁▂▁▁▁▁▁▂▁▂▁▁▂▂▁▂▁▁▁▁▂▂▂▂▂▂▂▂▂▂▂▂▂▁▃▃▂▂▂▂▁▂█▂▂▃▂▁▁▁▁▁▂▁▁▁▁▂▂▂▁▂▁▂▂▁▁▁▁▁▁▆▂▁▁▁▁ data for 2017-02-12–2017-03-31; range: 4.788s–7.664s; 5% faster
15:19 Zoffix buggable: speed 25
15:19 buggable Zoffix, ▂▁▁▁▁▂▂▂▂▂▂▂▂▁▁▂▂▁▁█▂▁▁▁▁ data for 2017-03-20–2017-03-31; range: 4.831s–6.637s; 3% faster
15:19 Zoffix $number after speed => use $number last readings (default is 50)
15:37 Geth ¦ rakudo/nom: c360ac276b | (Zoffix Znet)++ | src/core/IO/Path.pm
15:37 Geth ¦ rakudo/nom: [io grant] Fix smartmatch of Cool ~~ IO::Path
15:37 Geth ¦ rakudo/nom:
15:37 Geth ¦ rakudo/nom: Currently the multi slips the Cool into IO::Path.new, which
15:37 Geth ¦ rakudo/nom: causes exceptions when smartmatching against Iterable Cools,
15:37 Geth ¦ rakudo/nom: whenever they have more than 1 item in them.
15:37 Geth ¦ rakudo/nom:
15:37 Geth ¦ rakudo/nom: Fix by using the value of .IO method as the new path to check
15:37 Geth ¦ rakudo/nom: against. Cool provides it. Also toss IO::Path:D candidate, since
15:37 Geth ¦ rakudo/nom: IO::Path is Cool and is handled by the Cool:D candidate
15:37 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c360ac276b
15:39 Geth ¦ rakudo/nom: 0c7e4a0b60 | (Zoffix Znet)++ | 3 files
15:39 Geth ¦ rakudo/nom: [io grant] Do not capture args in .IO method
15:39 Geth ¦ rakudo/nom:
15:39 Geth ¦ rakudo/nom: We don't use them anyway, and avoiding the Capture makes the method
15:39 Geth ¦ rakudo/nom: ~ 7% faster.
15:39 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0c7e4a0b60
15:42 Geth ¦ rakudo/nom: a117dfc15d | (Zoffix Znet)++ | docs/2017-IO-Grant--Action-Plan.md
15:42 Geth ¦ rakudo/nom: Fix typo s/IO::Path.path/IO::Handle.path/
15:42 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a117dfc15d
15:42 Zoffix Woodi: it was a typo. It's not IO::Path.path but IO::Handle.path and it's exactly the same. Because that's exactly what all those methods currently call under the hood.
15:46 Zoffix huh
15:46 Zoffix m: dd qp{foo}
15:46 camelia rakudo-moar 833c29: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    foo used at line 1␤    qp used at line 1␤␤»
15:46 Zoffix Oh, I guess S32-io/path.t is not run as part of spectest?
15:47 Zoffix `qp{/foo/bar} creates a IO::Path object`
15:47 Zoffix Somewhat indulgent, considering '/foo/bar'.IO does the same and is just 1 char longer to type
15:50 timotimo how about a qwop quoter
15:50 Zoffix Whatsitdo?
15:59 timotimo dunno, it makes you walk funny
16:05 Geth ¦ roast: 8d6ca7a8c9 | (Zoffix Znet)++ | S32-io/io-path.t
16:05 Geth ¦ roast: [io grant] Cover IO::Path.ACCEPTS
16:05 Geth ¦ roast: review: https://github.com/perl6/roast/commit/8d6ca7a8c9
16:10 Zoffix ZOFVM: Files=1230, Tests=132985, 116 wallclock secs (21.78 usr  3.26 sys + 2436.86 cusr 130.50 csys = 2592.40 CPU)
16:14 robertle joined #perl6-dev
16:15 Zoffix ZOF6VM: Files=1230, Tests=132985,  240 wallclock secs
16:16 * Zoffix is happy to see same test count for both harnesses :D
16:16 Zoffix dogbert17++
16:16 Zoffix m: say 240/116
16:16 camelia rakudo-moar a117df: OUTPUT: «2.068966␤»
16:17 Zoffix And 6harness is only 2x as slow as 5harness. Pretty good!
16:40 perlpilot joined #perl6-dev
18:38 lizmat m: role A { method !a { } }; class B does A { method b() { self!a } }; for ^100000 { B.b }; say now - INIT now   # private method in role
18:38 camelia rakudo-moar a117df: OUTPUT: «0.4760571␤»
18:39 lizmat m: role A { method a { } }; class B does A { method b() { self.a } }; for ^100000 { B.b }; say now - INIT now   # same, but not private
18:39 camelia rakudo-moar a117df: OUTPUT: «0.3883969␤»
18:39 lizmat m: say 0.4760571 / 0.3883969
18:39 camelia rakudo-moar a117df: OUTPUT: «1.22569748␤»
18:40 lizmat if a private method lives in a role, the dispatch does not get optimized
18:41 lizmat m: class B { method !a() {}; method b() { self!a } }; for ^100000 { B.b }; say now - INIT now  # just in the class
18:41 camelia rakudo-moar a117df: OUTPUT: «0.23204060␤»
18:41 lizmat m: class B { method a() {}; method b() { self.a } }; for ^100000 { B.b }; say now - INIT now   # non-private
18:41 camelia rakudo-moar a117df: OUTPUT: «0.2315761␤»
18:42 lizmat so, if the private method does live in the class itself, there is not noticeable difference
18:42 lizmat where should I look to get this optimized properly ?
18:42 lizmat (before I start unprivatizing a lot of Baggy role private methods)
18:45 Zoffix lizmat: dunno if it's actually used but there's dispatch:<!> method in Mu: https://github.com/rakudo/rakudo/blob/nom/src/core/Mu.pm#L711-L721
18:45 samcv good *
18:46 Zoffix \o
18:46 lizmat Zoffix: but that's the problem: it shouldn't be called at all
18:46 Zoffix Ah
18:46 lizmat the fact that the dispatch is taking place at runtime over and over again, is what slows it down
18:46 lizmat but *only* if the private method is obtained from a role
18:47 samcv just fed the puppy. so cute
18:47 lizmat samcv  o/
18:47 samcv she's grown so much
18:48 AlexDani` joined #perl6-dev
18:48 Zoffix m: BEGIN Mu.^mixin: role { method dispatch:<!> (|) { say "meow" } }; role A { method !a { } }; class B does A { method b() { self!a } };
18:48 camelia rakudo-moar a117df: ( no output )
18:49 Zoffix m: BEGIN Mu.^mixin: role { method dispatch:<!> (|) { say "meow" } }; role A { method !a { } }; class B does A { method b() { self!a } }.new.b
18:49 camelia rakudo-moar a117df: ( no output )
18:50 * Zoffix shrugs
18:50 Zoffix both private-in-role and private-in-class ASTs have - QAST::Op(callmethod dispatch:<!>) <wanted> a in them...
18:51 lizmat Zoffix: am as confused as you are  :-(
18:51 Zoffix 4 times in fact :S
18:52 Zoffix ¯\_(ツ)_/¯ no idea :)
19:19 Geth ¦ rakudo/nom: ae3ff5c9e4 | (Elizabeth Mattijsen)++ | src/core/Baggy.pm
19:19 Geth ¦ rakudo/nom: Streamline Baggy.new
19:19 Geth ¦ rakudo/nom:
19:19 Geth ¦ rakudo/nom: - using nqp ops
19:19 Geth ¦ rakudo/nom: - about 25% faster
19:19 Geth ¦ rakudo/nom: - also affects bag() / mix() subs
19:19 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ae3ff5c9e4
19:57 jnthn Is the call to the private method in the class or in the role?
19:58 jnthn If the call is from the class it should be possible to optimize the same way (though don't know why it wouldn't be happening already, in this csae)
19:59 jnthn If the call is in the role then it's generic, so the same optimization isn't applicable
20:28 lizmat hmmm... I just had a flapper on t/spec/S17-promise/nonblocking-await.t  :  You planned 19 tests but ran 9.
20:29 lizmat jnthn: in my example earlier, the call is in the class
20:29 lizmat and that's 20+% slower because it goes through Mu.dispatch:<!>
20:30 lizmat also: why wouldn't the opt work if the call is in the role ?
20:30 lizmat once it is in the class, that shouldn't make a difference, should it ?
20:32 jnthn Hm, if it's not optimizing the call in the class that sounds like something we should be able to do
20:33 jnthn If the call is in the role - because there's only one copy of the code, but many signatures
20:33 jnthn That is to say, we don't actually copy the code
20:33 jnthn We compile roles like C#/Java generics, not like C++ templates, if that makes any sense.
20:34 jnthn And to clarify a bit more, many signatures means many code objects
20:34 jnthn The way we compile signature binding code in methods in roles is actually different from how we compile it in classes for the same reason
20:35 jnthn This is also why we emit slightly different code for type-variable lookups even if they are technically just lexical lookups: it's so spesh knows that it can turn them into constants when it specializes on invocant type
20:36 lizmat jnthn: I'm not seeing the signature part: we don't have MMD on private methods, right ?
20:36 jnthn No, but the invocant is generically typed (::?CLASS)
20:36 jnthn And there may be further type vars in effect
20:36 lizmat ah
20:36 lizmat hmmm...
20:37 jnthn The reason things are really quite pessimal, though, is that the slow path for private method dispatch is...pretty bad
20:37 jnthn And possibly not something spesh nails as well as it should
20:37 jnthn I don't know without looking at the log
20:38 lizmat but you're saying, that if we have a call on a private method in a role
20:38 lizmat it won't be fixable anyway ?
20:38 lizmat because I know of cases like that as well
20:38 jnthn Like all role genericity, it's fixable but only via a dynamic optimization, not a static one
20:38 jnthn That is, you can't do much about it in Perl6::Optimizer (which we do for the class case)
20:38 jnthn But spesh is in a decent place to
20:39 lizmat right, but spesh currently doesn't
20:39 jnthn I'm suspecting not, given the size of the performance difference.
20:39 jnthn I mean, if everything were inlined it should just be a hash lookup
20:39 lizmat hmmm... profile is orange so it does get speshed apparently, just never jitted
20:39 jnthn Yeah, but that doesn't mean spesh is able to speed up that particular aspect.
20:40 jnthn (The spesh2 todo list decidedly features making it able to explain what it did/didn't do at a more detailed level)
20:42 lizmat ack
20:42 lizmat brb
20:56 lizmat back
21:05 Geth ¦ rakudo/nom: e7e97c7be3 | (Elizabeth Mattijsen)++ | src/core/Baggy.pm
21:05 Geth ¦ rakudo/nom: Streamline Baggy!SANITY
21:05 Geth ¦ rakudo/nom:
21:05 Geth ¦ rakudo/nom: - make the common case, as in all values are > 0, faster
21:05 Geth ¦ rakudo/nom: - rewrite using nqp ops
21:05 Geth ¦ rakudo/nom: - actually throw for negative values (the Failure was eaten before)
21:05 Geth ¦ rakudo/nom: - makes Hash.Bag about 15% faster
21:05 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e7e97c7be3
21:32 MasterDuke asking when hopefully more people are around: are @a[], @a[*], and @a[0..*] supposed to produce identical output and cause identical side-effects?
21:34 lizmat @a[] should return self
21:37 lizmat the others should return a list / seq
21:40 jnthn Yes, this. The zen slice is for forcing interpolation, primarily.
21:41 lizmat jnthn: on that note, and in the hyper/race design
21:41 MasterDuke ok. looks like most of the tests in roast are just `is`, not `is-deeply`, maybe explains why my change passed
21:41 lizmat shouldn't we just move all of the Any-iterable methods to Seq ?
21:42 lizmat so we can mirror those for Seqqy ?
21:42 lizmat the duality feels better that way, to me at least
21:43 jnthn I think a category theorist would disagree with hyper/race being dual... :)
21:44 jnthn I think they are all available on Any as part of the "any item acts as a list of one", though
21:45 jnthn Really the default implementations would belong in Iterable
21:45 jnthn And just coercers left behind in Any
21:46 jnthn (Iterable because we want things like .unique to work on List as well as Seq)
21:47 lizmat jnthn: was more thinking Iterable vs Hyper/Race
21:48 lizmat since Seq's have positional bind failover, why not consider everything a Seq
21:48 jnthn Well, hyper/race are Iterable too
21:49 jnthn Sequential iterating them or sinking them are the two ways you get the parallel part to dig into its work
21:49 lizmat it still feels like we're missing an opportunity for simplification somehow
21:50 jnthn fwiw, after some time to think on it I'm kinda leaning towards `for` (unless written `hyper for` or `race for`) always being sequential, rather than being infected by the thing it will iterate over
21:50 lizmat m: say 42 ~~ Iterable
21:50 camelia rakudo-moar e7e97c: OUTPUT: «False␤»
21:50 lizmat m: say 42.iterator
21:50 camelia rakudo-moar e7e97c: OUTPUT: «<anon|163756496>.new␤»
21:51 jnthn I guess that's how we get the one-element case to just fall out of polymorphism :)
21:52 jnthn And given that, I'm not entirely sure whether moving the implementations of the sequential versions out of Any actually nets us a simplification
21:52 lizmat yeah, but my point is really: if everything can generate an iterator, isn't everything Iterable ?
21:52 jnthn Only in a structurally typed language, which Perl 6 isn't :)
21:52 lizmat well, if we want to run anything like .grep or .unique on a List, we get an iterator for it
21:53 jnthn We can .Str everything but that doesn't make everything a Str
21:53 samcv hi jnthn
21:53 jnthn Well, .Stringy woulda been a better example
21:53 jnthn Because that's actually a role, and Str ain't, so it's not really the same
21:53 jnthn o/ samcv
21:54 jnthn The roles more indicate how something should be considered primarily
21:55 jnthn Rather than what it might be turned in to
21:56 jnthn But yes, I understand the discomfort from the sequential implementations living in Any while the parallel ones would go elsewhere
21:56 lizmat well, discomfort is a big word
21:57 jnthn I guess it boils down to, we're willing to consider anything a sequential iterable of one, but hyper/race are things you have to opt in to
21:57 lizmat it feels to me like something's out of whack, but I can't really put my finger on it
21:57 lizmat hmmmm
21:58 lizmat I can foresee a situation in the future where we would have a "please rakudo, figure out yourself if it makes sense to do things in parallel"
21:58 lizmat use less 'wallclock'
21:58 lizmat use less 'cpu'
21:59 lizmat so I don't see the opt in part as a premature optimization, really  :-)
21:59 lizmat premature, because the developer needs to decide
21:59 lizmat and the developer may very well make the wrong decision
22:00 lizmat I mean, if the result of a chain is a hash, why wouldn't it race automatically ?
22:00 jnthn Well, just because they say .hyper or .race doesn't mean we aren't allowed to decide to do it sequential if we believe that we're going to come out faster
22:00 jnthn Unless they explicitly force our hand by being explicit about degree/batch
22:00 lizmat but vice versa would never happen ?
22:01 jnthn Not with the Perl 6 we have today
22:01 jnthn In order to auto-parallelize you need to know it's safe
22:01 lizmat agree, but in the other 90 years to com ?
22:02 jnthn In a hypothetical future Perl 6 where we implement, say, an effect system alongside the type system, or one of the various other ways of conveying safetly, perhaps it would be possible
22:02 jnthn *safety
22:04 jnthn Or whatever other mechanisms that are inveted in the 90 years to come that feel suitably Perl-ish :)
22:07 jnthn Whoever is smart enough to figure that out will presumably also be able to figure out how to re-organize iterable chains so they can be hyper-ized after-the-fact
22:11 * jnthn wanders off to relax for a bit before sleep :)
22:16 MasterDuke m: use Test; my @a = ^3; is-deeply @a[*].WHAT, List; is-deeply @a[].WHAT, Array
22:16 camelia rakudo-moar e7e97c: OUTPUT: «ok 1 - ␤ok 2 - ␤»
22:16 MasterDuke should i add those ^^^ to roast?
22:21 lizmat eh, is-deeply on types ?
22:21 lizmat "is" is equipped to compare types, afaik
22:22 lizmat m: use Test; is 42.WHAT, Int
22:22 camelia rakudo-moar e7e97c: OUTPUT: «ok 1 - ␤»
22:22 lizmat m: use Test; is 42, Int
22:22 camelia rakudo-moar e7e97c: OUTPUT: «not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: (Int)␤#      got: '42'␤»
22:22 lizmat m: use Test; is "Int", Int
22:22 camelia rakudo-moar e7e97c: OUTPUT: «not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: (Int)␤#      got: 'Int'␤»
22:22 lizmat m: use Test; is "Str", Str
22:22 camelia rakudo-moar e7e97c: OUTPUT: «not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: (Str)␤#      got: 'Str'␤»
22:25 lizmat jnthn: good night
22:26 * lizmat steps away from the keyboard as well
23:53 Zoffix m: use Test; isa-ok "meow", Str
23:53 camelia rakudo-moar e7e97c: OUTPUT: «ok 1 - The object is-a 'Str'␤»
23:56 Zoffix m: use Test; does-ok 42, Numeric
23:56 camelia rakudo-moar e7e97c: OUTPUT: «ok 1 - The object does role 'Numeric'␤»

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