Geth rakudo: LLFourn++ created pull request #1056:
Pass the argument to Code.ACCEPTS raw (RT #131106)
03:52
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131106
Geth roast: LLFourn++ created pull request #260:
Tests for RT #131106
04:02
roast: LLFourn++ created pull request #261:
Tests for RT #131106
04:15
[Tux] This is Rakudo version 2017.03-141-gad01ed767 built on MoarVM version 2017.03-88-g21fc7a22 06:23
csv-ip5xs 3.113
test 12.517
test-t 4.949 - 4.955
csv-parser 13.036
lizmat Files=1184, Tests=56200, 199 wallclock secs (11.98 usr 4.54 sys + 1183.56 cusr 112.35 csys = 1312.43 CPU) 08:03
Geth rakudo/nom: c0eb9bd10f | LLFourn++ | src/core/Code.pm
Pass the argument to Code.ACCEPTS raw (RT #131106)

before this:
my $foo = "foo"; my \t = (* =:= $foo); say $foo ~~ t; # False say t.($foo); # True
08:15
rakudo/nom: 5704e5fea4 | lizmat++ | src/core/Code.pm
Merge pull request #1056 from LLFourn/RT131106

Pass the argument to Code.ACCEPTS raw (RT #131106)
roast: c0870cab72 | (Lloyd Fournier)++ | S02-types/whatever.t
Tests for RT #131106 (#261)
09:18
rakudo/nom: 4683e838b6 | (Elizabeth Mattijsen)++ | src/core/Map.pm
Make coercion of Map to Set(|Hash) about 8x faster

  - give Map its own .Set/.SetHash
  - iterates directly over the hash
  - rewritten using nqp ops
10:36
Zoffix m: my int $x = int.Range.max; dd $x 12:27
camelia 9223372036854775807
Zoffix m: my uint $x = uint.Range.max; dd $x
camelia -1
Zoffix s: uint.Range, 'max', \()
MasterDuke Zoffix: that's one of the things i'm (slowly) working on 12:29
Zoffix MasterDuke: ah, so the number *is* right, it just can't fit it? 12:30
MasterDuke yeah
Zoffix OK
MasterDuke m: dd uint.Range.max;
camelia 18446744073709551615
MasterDuke m: dd 2**64-1 12:31
camelia 18446744073709551615
MasterDuke that's the correct max
Zoffix m: my uint $x = 18446744073709551614; dd $x
camelia -2
Zoffix :S
ok, so it's just an int. 12:32
well, fits just an int 12:33
MasterDuke it's complicated, but yeah. the bits are kind of being interpreted as an int, instead of uint 12:34
Zoffix: are you interested in fixing it? if so i can fill you in on what i+timotimo have done/tried so far 12:37
Zoffix MasterDuke: nah, I'm merely using a large int to fake infinity 12:39
MasterDuke k
Zoffix m: use nqp; my int $x = int.Range.max; dd nqp::isbig_I(nqp::decont($x)) 12:54
camelia 1
Zoffix wonders what isbig_I is all about
or rather what's its relation to `int` is... I thought it was a way to tell when a stuff can't fit into `int` so you have to do with it with `Int` 12:55
lizmat Zoffix: I think the isbig_I gets triggered on the 32bit boundary atm
Zoffix Ah. Indeed. Thanks. 12:56
Geth rakudo/nom: f532f815a7 | (Elizabeth Mattijsen)++ | src/core/Iterable.pm
Make Iterable.flat about 20% faster

  - for a Seq based on a 100 element Array
12:59
Zoffix We don't have an nqp::if-type sort of op, do we? To replicate this without a variable: nqp::if( nqp::istype(($_ := something), Something), $_, 42 ) 13:04
lizmat .tell jnthn looking at github.com/rakudo/rakudo/blob/nom/...ble.pm#L82 , I'm not sure how Iterable.lazy actually works. Feels to me at least the comments are incorrect 13:06
yoleaux2 lizmat: I'll pass your message to jnthn.
lizmat Zoffix: that's how I usually do it: if there's another way, I'd like to know :)
.tell jnthn I also don't grok why Iterable.lazy is not initialized with the iterator to start with 13:14
yoleaux2 lizmat: I'll pass your message to jnthn.
Zoffix That's it. nqp broke me 13:25
Zoffix switches to 2-space tabs
lizmat does nqp with 2 space, and HLL with 4 space 13:26
Zoffix I've no idea how to eaily switch tab width in atom :/ 13:27
*easilyt 13:28
All 265 tests for new and extended IO::Path.extension pass \o/ 13:44
It's 16 times slower /o\
:)
Oh wait, 9.22x slower
timotimo whoops
Zoffix Luckily most of it is the UInt constraint. Just switching that to Int makes it only 2.14x slower 13:45
Zoffix starts optimizing stuff
m: my subset UInt2 of Int where {not .defined or $_ >= 0}; for ^100_000 { $ = 42 ~~ UInt2 }; say now - INIT now; 13:54
camelia 0.56012696
Zoffix m: my subset UInt3 of Int where nqp::unless(nqp::isfalse(nqp::defined($_)), nqp::isge_I(nqp::decont($_), 0)); for ^100_000 { $ = 42 ~~ UInt3 }; say now - INIT now; 13:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find nqp::defined, did you forget 'use nqp;' ?
at <tmp>:1
------> 3qp::unless(nqp::isfalse(nqp::defined($_)7ā5), nqp::isge_I(nqp::decont($_), 0)); for
Zoffix m: use nqp; my subset UInt3 of Int where nqp::unless(nqp::isfalse(nqp::defined($_)), nqp::isge_I(nqp::decont($_), 0)); for ^100_000 { $ = 42 ~~ UInt3 }; say now - INIT now;
camelia 0.786176
Zoffix Kinda weird that nqp version is slower, eh?
30% slower on my 32-bit box
pmurias int is 32-bit on 32-bit boxes? 14:02
yoleaux2 5 Apr 2017 17:18Z <[Coke]> pmurias: back when we were getting pugs and niecza up to date with roast, we had a bunch of scripts to help onboard more test files either via fudging or identifying files that were close (so we could easily get some wins). let me know if you want me to take a whack at anything.
Zoffix pmurias: no, 64
pmurias is int being at least 64bits something that's "specced"? 14:04
Zoffix no idea
timotimo int is native 64bit int, cint is 32bit on 32bit machines 14:08
Zoffix m: my cint $ 14:09
camelia 5===SORRY!5===
Type 'cint' is not declared. Did you mean any of these?
int
Int
uint
UInt

at <tmp>:1
------> 3my cint7ā5 $
Malformed my
at <tmp>:1
------> 3my7ā5 cint $
timotimo only in NativeCall 14:10
.o( is it actually cint, though? )
oh it's "long" inside NativeCall
Zoffix Interesting. If I run my 265 tests before the bench, new method is ~3.5% slower, but if I don't run them, its ~3.5% faster 14:17
Pretty consistently too
something gets speshed or whatever vOv 14:18
[Coke] Zoffix: that's a plus, then. 14:26
Zoffix What is? 14:28
[Coke] ... that it goes faster. 14:29
Zoffix But the indication is that it gets ~6% slower after you use it a few thousand times :/ 14:30
[Coke] I thought it was that "you are doing more work, and the particular work you're doing is slower, but everything that was before that is faster than it would have been otherwises" 14:31
s:last/s//
ah well 14:32
Geth rakudo/nom: 189615c09f | (Elizabeth Mattijsen)++ | 5 files
Make sure .Set/.SetHash are always nodal
14:33
rakudo/nom: f849df323c | (Elizabeth Mattijsen)++ | src/core/Iterable.pm
Make Iterable.Set(|Hash) about 4x faster

  - create .Set(|Hash) method in role Iterable
  - which shortcuts to Setty.fill_IterationSet
  - timing based on a 100 element array
14:37
rakudo/nom: 80062b066b | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make Iterable (|) Iterable about 9x faster

  - by adding an optimized candidate
  - which shortcuts to Setty.fill_IterationSet
  - timing based on a 100 element array
14:39
Zoffix lizmat: do you have any tips for how to take `int` sized Ints, so you could use `int` nqp ops, but yet avoid LTA errors about not unboxing to int? 14:44
m: sub (int $x) {}(999999999999999999999999999999999)
camelia ( no output )
Zoffix uhhh
m: sub (int $x) {}(999999999999999999999999999999999999999999999) 14:45
camelia ( no output )
Zoffix interesting. On my box I get "Cannot unbox 150 bit wide bigint into native integer"
m: sub (int $x) { dd $x }(999999999999999999999999999999999999999999999)
camelia 802379605485813759
lizmat m: sub (int $x) {dd $x}(999999999999999999999999999999999999999999999)
camelia 802379605485813759
lizmat it silently truncates
Zoffix star: sub (int $x) {dd $x}(999999999999999999999999999999999999999999999)
camelia Cannot unbox 150 bit wide bigint into native integer
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat which is intentional, afaik
ah?
Zoffix bisect: sub (int $x) {dd $x}(999999999999999999999999999999999999999999999) 14:46
bisectable6 Zoffix, Bisecting by exit code (old=2015.12 new=b62d1a7). Old exit code: 1
Zoffix, bisect log: gist.github.com/35d47aae3d439fca42...b19b318330
Zoffix, (2017-03-27) github.com/rakudo/rakudo/commit/66...ac225ab260
Zoffix Well, either way. It's no good. LTA error on one and and wrong behaviour on ther other.
It don't make any sense for .extension(:parts) to be larger than `int`, but due to these truncations/LTA errors, I have to slow everything down by quite a bit :/ 14:47
MasterDuke huh, i'll see if i can figure out what happened
Zoffix kinda wish we had an op for.. um... nqp::limit_i($x). Gives you int.Range.max if it's > it and int.Range.min if it's < it and self if it's in Range. 14:49
I guess the nqp::p6* are added right in rakudo's repo? 15:01
Zoffix gonna take a look into that
nqp::p6limitIntto_i(); nqp::p6limitNumto_i() 15:02
nqp::p6int_I(); nqp::p6int_N(); 15:05
(make an Int fit into int); (name a Num fit into int);
ugh, tho the Num one still has the NaNs to deal with that can't really be limited sanely
holy crap. lunch time already :/ 15:09
.ask jnthn I'd like to add nqp::p6int_I(); that truncates an Int to fit into `int`. There are many places where super large values don't make sense, but to give PDG errors we stick to Int nqp ops, and lose some perf. With nqp::p6int_I() we'll truncate all super large Ints into int and use the int p6 ops on them. Do you see problems with adding such a thing? In .extension() using int instead of Int gives a 15:13
yoleaux2 Zoffix: I'll pass your message to jnthn.
Zoffix ~30% perf boost
.tell jnthn ~30% perf boost
yoleaux2 Zoffix: I'll pass your message to jnthn.
Zoffix Right now I added it as a Rakudo::Internals method but all the benefits get lost due to overhead of the method call :/ 15:15
.tell jnthn or rather... in my bench: using Ints is 2x slower than old method; using ints is 1.66x slower; whatever the diff there is is the benefit of ints that I want to capture. 15:17
yoleaux2 Zoffix: I'll pass your message to jnthn.
[Coke] Zoffix: if you inline it instead of making it a method call, does that avoid the speed hit 15:22
?
I know macros were meant to fill that niche, but we also have a history of doing what's fast in core and not necessarily writing idiomatic perl 6 there. 15:23
Zoffix [Coke]: yeah, it avoids it, but it's a 4-line chunk nqp code. Inlining it all over the place makes an already-noisy nqp code noiser: gist.github.com/zoffixznet/6cb9496...db7735aac6 15:24
And repeats the constant all over the place 15:25
[Coke] Could be a fallback of last resort. (maybe along with a comment with a unique string that includes 'changing this, change everything else'. very bad, I know, but like I said, last resort. 15:27
Zoffix Or just add an op. 15:28
[Coke] +1 15:37
Geth rakudo/nom: e8cb9a2f52 | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make infix:<(&)> a multi and add basic candidates
15:40
lizmat Zoffix: fwiw, I think the problem with adding nqp ops is that spesh / JIT need to be told about them as well, otherwise they won't get optimised 15:41
and thus don't have the performance benefit that you're looking for
(at least that was the gist I remember the last time I suggested adding an nqp op :-)
Zoffix Ahhh 15:43
m: my $x = "foo.txt".IO; $x.parts<basename> = "foo.tar"; dd $x; dd $x.extension 15:45
camelia IO::Path $x = "foo.txt".IO(:SPEC(IO::Spec::Unix),:CWD("/home/camelia"))
"tar"
Zoffix frowns
.extension vs .new-extension( :parts(1..1) ) is 11x slower 15:53
.extension vs .new-extension( :1parts ) is 1.86x slower 15:54
.extension vs .new-extension is 3% slower
Functionally, all three are equivalent :/
Zoffix knocks it on the head 15:57
Optimization is a young person's game :)
Zoffix sticks to rightiness
perlpilot that particular optimization seems more of a spesh thing than something a human needs modify 15:58
Zoffix perlpilot: the int thing? Definitely not.
Well, not definitely, but automatically truncating an Int the second it enters an int seems very wrong. 15:59
.oO( tint type )
perlpilot I dunno, that's kind of what I expect from low-level types. 16:00
Zoffix Isn't overflowing is the typical behaviour? IIRC some crypto applications depend on that even 16:01
perlpilot actually ... I haven't had to deal with such things in so long, my "instincts" are probably off :) 16:02
Perl++
lizmat m: multi a(Int $) { "Int" }; multi a(int $) { "int" }; dd a 9999999999999999999999999999999 # can be handled by MMD
camelia "Int"
lizmat m: multi a(Int $) { "Int" }; multi a(int $) { "int" }; dd a 42 16:03
camelia "int"
Zoffix m: multi a(Int $) { "Int" }; multi a(int $) { "int" }; my $x = 42; dd a $x # not really 16:04
camelia "Int"
lizmat m: multi a(Int $) { "Int" }; multi a(int $) { "int" }; my int $x = 42; dd a $x
camelia "int"
lizmat needs to be a native
Zoffix But you're back at square #1 with that; my int $x will explode the minute you stick something larger than int into it 16:05
lizmat true
Geth rakudo/nom: 89b5d65ca5 | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make Setty (&) Setty about 40x faster

  - add a candidate for it
  - that is highly optimized and written in nqp
  - prevents potentially expensive .WHICH calculation
  - so many real live situations could be faster still
16:21
timotimo hm. from inside a module's code, what's a sensible way to get at the version field inside the META6.json file?
i thought we had something similar to %*RESOURCES for that 16:22
lizmat %?RESOURCES ?
nine would know if that's at all implemented already
timotimo that one, yeah
lizmat actually, it appears implemented as %*RESOURCES atm 16:23
timotimo oh, huh?
i thought that'd only give you the "resources" part of the meta6.info file
lizmat ack RESOURCES src/core
ah, hmmm... 16:24
timotimo oh, oyu mean %?RESOURCES is implemented as accessing %*RESOURCES
well, $*RESOURCES really
lizmat ah, yes
I'm not sure what the state is of that
timotimo but that accesses the compiler's idea of what that is
lizmat but isn't the associated Distribution object also available?
timotimo not sure how to reliably get that 16:25
lizmat neither :-(
timotimo i mean, there's $*REPO, but that's just my installation repo for ~/.perl6
perhaps by knowing the module name i can just ask repo to give me "me" 16:26
lizmat that was definitely speculated about at one time :-) 16:27
timotimo i seemed to recall something along those lines 16:31
in this case, i can - since i know what "me" is - ask for it literally
well, i found a path to the version 16:45
so that'? good
$*REPO.resolve(CompUnit::DependencySpecification.new(:short-name("MyModule"))).distribution.read-dist.().<ver>.perl.say 16:46
lizmat feels like a $*REPO.Distribution("MyModule") would be a nice shortcut 16:47
Geth rakudo/nom: 5072377262 | (Zoffix Znet)++ | src/core/Rakudo/Internals.pm
Implement Rakudo::Internals.RANGE-AS-ints

Converts a Range to min/max values that can fit into an `int` Treats values smaller than int.Range.min as int.Range.min Treats values larger than int.Range.max as int.Range.max Throws $exception for non-Numeric ranges or ranges with any NaN endpoints If $exception is a Str, calls `die $exception`
timotimo am i getting tired? because i legit just called it 'multi MATCH("version")' ... 16:53
Geth rakudo/nom: 03ef4be252 | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make Mixy (&) Mixy about 60x faster

  - add a candidate for it
  - that is highly optimized and written in nqp
  - prevents potentially expensive .WHICH calculation
  - so many real live situations could be faster still
17:03
rakudo/nom: b1e7a01f87 | (Zoffix Znet)++ | 3 files
[io grant] Implement IO::Path.extension 2.0

  - Add `:parts` parameter to control number of extension parts to find
  - Add a means to replace an extension, with an optional parameter
  - Add an optional `:joiner` parameter, specifying the string to
   use when joining the replacement extension to the rest of the
   filename
  - Remove Rakudo::Internals.MAKE-EXT. It no longer does what
   IO::Path.extension does and isn't used anywhere else in the sauce
17:11
roast: b23e53eb79 | (Zoffix Znet)++ | S32-io/io-path-extension.t
[io grant] Test IO::Path.extension

  - Add 271 tests for the previously untested method
  - Test the new functionality added by the IO grant
Rakudo impl: github.com/rakudo/rakudo/commit/b1e7a01f87
17:12
Zoffix glances at #perl6 17:16
The wat of visual diff in $^i vs $i is overriden by usefulness of being able to use an $^i param in inner blocks 17:17
And $:i params
Their utility is limited as it is, restricting them further for sake of aesthetics is LTA IMO
And pretty sure I documented it somewhere arleady 17:18
lizmat m: my $i; { $^i + $i } # ok
camelia WARNINGS for <tmp>:
Useless use of "+" in expression "$^i + $i" in sink context (line 1)
Too few positionals passed; expected 1 argument but got 0
in block <unit> at <tmp> line 1
lizmat m: my $i; { $^i + $i }(42) # ok
camelia ( no output )
TimToady that is very much designed to be a DIHWIDT kind of thing
lizmat m: my $i; { $i + $^i }(42) #
camelia 5===SORRY!5=== Error while compiling <tmp>
$i has already been used as a non-placeholder in the surrounding block,
so you will confuse the reader if you suddenly declare $^i here
at <tmp>:1
------> 3my $i; { $i + $^i7ā5 }(42) #
Zoffix haha :D 17:19
TimToady it's the "suddenly" that I like the best
Zoffix Yeah, $^ is docced "If you have self-declared a parameter using $^a once, you may refer to it using only $a thereafter."
Zoffix looks at $:
Also is " the same things that apply to variables declared using the ^ twigil" 17:20
TimToady it's really easy to abuse the ordering as well :)
convenient that "first", "second", "third" are the correct order, but don't try "fourth" :) 17:21
lizmat guess that'll be a WAT I'll have to live with :-) 17:23
dinner&
samcv good * 17:24
Zoffix \o
timotimo what am i doing wrong if %?RESOURCES is just Nil?
Zoffix timotimo: try adding/removing "S" at the end; both in variable and in the metafile 17:25
timotimo mhm
Zoffix like the key, in the metafile. "resourse" vs "resources"
timotimo right
Zoffix "resources": ["foo", "bar"]. This one works: github.com/ugexe/zef/blob/master/M...on#L50-L55 17:26
And grepping the sauces, it's %?RESOURCES<scripts/win32unzip.ps1> in the sauce 17:27
timotimo thanks 17:28
oh 17:30
can it be %?RESOURCE just doesn't work inside bin scripts?
Zoffix maybe
I vaguelly recall ugexe mentioned something along those lines
And you make a module's routine that returns %?RESOURCE for use in the script 17:31
timotimo right, i'm just about to do that
this was annoying to figure out :(
Zoffix t/spec/S11-modules/nested.t flopping 17:42
hah... I accidentally created a nom branch on docs :S 17:43
switched to "nom" on github, by habit
clearly we should replace all "master" branches with "nom" on all Perl 6 repos :) 17:44
MasterDuke you know, i'm surprised i've never done that before 17:45
timotimo i think i've done that same thing at least once, too 17:48
Zoffix ZOFVM: Files=1234, Tests=133447, 118 wallclock secs (22.95 usr 3.50 sys + 2448.46 cusr 153.82 csys = 2628.73 CPU) 17:50
Zoffix & # for rest of day 17:54
ugexe yeah %?RESOURCES only works inside modules 18:04
yoleaux2 5 Apr 2017 19:28Z <Zoffix> ugexe: FYI: irclog.perlgeek.de/perl6-dev/2017-...i_14380970
ugexe you can just put your bin script in a module though github.com/ugexe/zef/blob/master/bin/zef (this also means your bin script gets precompiled) 18:05
Zoffix m: dd [ <author extended interactive online release smoke>.words.sort eqv <smoke extended interactive release author online>.words.sort ] 18:22
camelia [Bool::True]
Zoffix Set.Str is not specced to be ordered is it:? 18:23
Man, I changed it to .keys.sort but a test is still failing on hack because apparently it ends up in the wrong order there :S
This line: github.com/zoffixznet/perl6-Test-W...hen.pm6#L8 18:25
Positional arguments to Test::When can only be author extended interactive online release smoke 18:26
m: my $valid-env-keywords = set <smoke interactive extended release author online>; die "Positional arguments to Test::When can only be " ~ $valid-env-keywords.keys.sort
camelia Positional arguments to Test::When can only be author extended interactive online release smoke
in block <unit> at <tmp> line 1
Zoffix Oh 18:27
brain fart. I made it sort, but didn't adjust the test to test for sorted version >_<
Zoffix re-disappears
jdv79 bye 18:56
Geth rakudo/nom: e9a30756c8 | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make Baggy (&) Baggy about 80x faster

  - add a candidate for it
  - that is highly optimized and written in nqp
  - prevents potentially expensive .WHICH calculation
  - so many real live situations could be faster still
19:22
rakudo/nom: 48619f8364 | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Handle Baggy (|) Mixy, Mixy (|) Baggy in dispatch

Rather than incorrectly checking in the Baggy (|) Baggy candidate.
19:32
rakudo/nom: 6377d9252a | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Fix 2 thinko's in Map (|) Map
19:44
rakudo/nom: 605e9e963c | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make Map (&) Map about 7x faster

  - add a candidate for it
  - that is highly optimized and written in nqp
  - prevents potentially expensive .WHICH calculation
  - so many real live situations could be faster still
20:17
rakudo/nom: 0fc375160f | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
Make Iterable (&) Iterable about 2x faster

  - add a candidate for it
  - prevents potentially expensive .WHICH calculation
  - so many real live situations could be faster still
21:36
rakudo/nom: bbfb28d490 | (Elizabeth Mattijsen)++ | src/core/Rakudo/Iterator.pm
Introducing R.It.AllButLastNValues

Iterator that produces all values of an iterator *except* the last N ones. The work horse for Seq.tail(*-N).
22:37
nqp: 252d21fe77 | (Samantha McVey)++ | 3 files
Untodo two tests, and remove a debug message
23:52