»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
timotimo m: use NativeCall; sub test(size_t $foo) is native(Str) {*} 00:00
rudi_s timotimo: Nice. - Any idea what's wrong?
camelia ( no output )
00:00 spider-mario left
timotimo i'd need to see more code, i think 00:00
rudi_s timotimo: Ah, old version of Perl6. Works fine in 2016.1, broken in 2015.11. 00:01
timotimo ah, yes
size_t and friends are new-ish
never be on a version before 2015.12, is what i'd say
00:02 vendethiel left
rudi_s Slow Debian sid ... yeah, good idea. 00:02
timotimo sorry about that :(
Juerd: i wonder if [+] @switches would be faster or slower 00:03
rudi_s No worries, building it locally works fine.
Juerd timotimo: I don't. I wonder more about the bonus challenge, which takes ages even for the first range of switches :)
Besides that, I prefer .sum to [+] :P 00:04
timotimo only thing i can think of is maybe packing the light switches into a big integer or a bunch of 64bit ints? then you can do bitwise arithmetic on them
just xor the current light state with the range you calculated
i'm not sure if that's the right kind of result there 00:05
Juerd Sure, but that code won't be nearly as pretty :)
timotimo approach* not result
Juerd I've updated the post to use @switches.sum instead of +@switches.grep: *.so
timotimo well, was it faster?
Juerd I fail to care enough to even test that :)
timotimo :o 00:06
Juerd I participate in these code challenges to showcase that Perl 6 is an elegant language
00:06 vendethiel joined
Juerd Performance for me is a matter of "is it usable", not a number... :) 00:06
timotimo did you see the haskell example? the way it puts the example input in is ... kind of horrible to look at 00:07
Juerd There is more than one Haskell solution and I can't read Haskell :)
timotimo oh
the first one that shows up on my end ... by the person whose name is only hex digits 00:08
Juerd Oh, I don't like hard coding at all, but if you're going to do that, why bother with a single string.
timotimo hum? 00:09
Juerd Don't put "foo\nbar\nbaz" in your code and then split on \n. If you're going to skip reading from stdin, then skip parsing too. 00:10
timotimo ah 00:11
Juerd Speaking of performance, having non-typed @switches is a lot faster than having Bools :( 00:12
timotimo right. could see that happen :|
Juerd Even for the simple challenge input, that shaves .1 s from an original .6
00:12 wamba left
Juerd An array of int goes to .9 00:13
timotimo the only way a typed array is going to be faster is with native types like int
Juerd So that's the slowest of the three options
timotimo yeah. currently we have trouble inlining operators and operations regarding native ints
geekosaur wow. at the very least I'd have brought in the heredoc package >.> 00:15
(found that haskell solution, it's like the 4th one listed here)
timotimo yeah, i was sure haskell would have something much better than whatever that was
github.com/timo/SDL2_raw-p6/blob/m...e_noise.p6 - did you check this out yet? 00:16
00:17 pierrot joined 00:19 sufrostico joined 00:20 sufrosti1o joined
timotimo by going to nqp::bindpos_i instead of the $pixdata[...] = ... code, i get to about 50fps 00:20
00:21 masak_grrr is now known as masak 00:24 pierrot left
rudi_s I have a list of lists, e.g. @x = (1,2), (3,4), (5,6) and I'd like to flatten that to @x = 1,2,3,4,5,6; I thought @x.flat would do that, but it returns the list unchanged. What am I doing wrong? 00:27
00:27 sufrostico left 00:28 sufrosti1o left
timotimo when you put a list of lists into an array, it will itemize everything in it, because an array is "a list of scalar containers" 00:28
m: my @a = (1, 2), (3, 4), (5, 6); say @a.perl
camelia rakudo-moar 620f4e: OUTPUT«[(1, 2), (3, 4), (5, 6)]␤»
timotimo it doesn't show that in .perl, though
huh.
00:28 vendethiel left
timotimo m: my @a = flat (1, 2), (3, 4), (5, 6); say @a.perl 00:28
camelia rakudo-moar 620f4e: OUTPUT«[1, 2, 3, 4, 5, 6]␤»
timotimo when you use flat before assigning into the array, it'll work as expected, because at thta point it hasn't packed the sublists into scalar containers yet 00:29
m: my @a = (1, 2), (3, 4), (5, 6); say @a>>.flat.perl
camelia rakudo-moar 620f4e: OUTPUT«[((1,).Seq, (2,).Seq), ((3,).Seq, (4,).Seq), ((5,).Seq, (6,).Seq)]␤»
timotimo m: my @a = (1, 2), (3, 4), (5, 6); say @(@a>>.flat).perl
camelia rakudo-moar 620f4e: OUTPUT«[((1,).Seq, (2,).Seq), ((3,).Seq, (4,).Seq), ((5,).Seq, (6,).Seq)]␤»
timotimo m: my @a = (1, 2), (3, 4), (5, 6); my @b = @a>>.flat; say @b.perl
00:29 SCHAAP137 left
camelia rakudo-moar 620f4e: OUTPUT«[((1,).Seq, (2,).Seq), ((3,).Seq, (4,).Seq), ((5,).Seq, (6,).Seq)]␤» 00:29
timotimo hmm.
m: my @a = (1, 2), (3, 4), (5, 6); my @b = @a>>.flat; say @b.flat.perl
camelia rakudo-moar 620f4e: OUTPUT«($((1,).Seq, (2,).Seq), $((3,).Seq, (4,).Seq), $((5,).Seq, (6,).Seq)).Seq␤»
timotimo well, i don't know how to do this well :)
m: my @a = (1, 2), (3, 4), (5, 6); my @b = @a>>.Slip; say @b.perl 00:30
camelia rakudo-moar 620f4e: OUTPUT«[slip(1, 2), slip(3, 4), slip(5, 6)]␤»
rudi_s ;-) - I got really confused when I try >>.flat and saw all those Seqs.
timotimo yeah, they'd go away when you assign to a @foo, for example
but since they are in the sublists still, that doesn't happen there
00:30 cdg left
rudi_s Yeah. Hm. So no easy way to flatten an array? 00:31
timotimo oh, there is
sortiz m: my @a = (1, 2), (3, 4), (5, 6); say @a[*;*]; # A trick 00:32
camelia rakudo-moar 620f4e: OUTPUT«(1 2 3 4 5 6)␤»
timotimo oh, that's cute
rudi_s How does that work?
timotimo ah, here we go; this is what i meant, but it didn't work the last time: 00:33
my @a = (1, 2), (3, 4), (5, 6); my @b = @a.map(*.Slip); say @b.perl
00:33 mr-foobar left
timotimo m: my @a = (1, 2), (3, 4), (5, 6); my @b = @a.map(*.Slip); say @b.perl 00:33
camelia rakudo-moar 620f4e: OUTPUT«[1, 2, 3, 4, 5, 6]␤»
geekosaur treats it as a matrix and lists out the contents
...in a flat way since [*;*] iterates the whole thing
sortiz m: my @a = (1, 2), (3, 4), (5, 6); say @a.List.flat; # Other way 00:34
camelia rakudo-moar 620f4e: OUTPUT«(1 2 3 4 5 6)␤»
rudi_s Thanks - a little too much for my current perl knowledge.
sortiz: That looks good. Thanks.
timotimo m: my @a = (1, 2), (3, 4), (5, 6); say @a.List.flat.perl;
camelia rakudo-moar 620f4e: OUTPUT«(1, 2, 3, 4, 5, 6).Seq␤»
timotimo oh, that's even easier
rudi_s Too easy ..
sortiz The real problem is that Array.flat don't attempt to flat, it should be named Array.Seq ;) 00:35
00:40 Herby_ joined
Herby_ Evening, everyone! 00:42
sortiz \o Herby_ 00:43
Herby_ o/
sortiz rudi_s, But beware with Array.List, it doesn't work if Array is-lazy. 00:46
00:46 kid51 joined
rudi_s sortiz: Hm. Are can slurpy parameters be non lazy? (I'm using it in a function with a sulpy array parameter). 00:46
00:46 vendethiel joined
timotimo we don't have lazy arrays, sortiz 00:47
rudi_s *be lazy 00:48
sortiz m: my @a = [1..*]; 00:49
camelia ( no output )
timotimo hum. am i totally wrong?
sortiz m: my @a = [1..*]; say @a.List
camelia rakudo-moar 620f4e: OUTPUT«Cannot List a lazy list␤ in block <unit> at /tmp/LditQUsUOV line 1␤␤»
timotimo m: my @a = [1..*]; say @a.WHAT
camelia rakudo-moar 620f4e: OUTPUT«(Array)␤»
timotimo huh, i *am* totally wrong!
that's good :)
ugexe m: my @a = 1,2,3,4,5; @a[2]:delete; say @a[0..*] 00:50
camelia rakudo-moar 620f4e: OUTPUT«(1 2)␤»
ugexe m: my @a = 1,2,3,4,5; @a[2]:delete; say @a[lazy 0..4]
camelia rakudo-moar 620f4e: OUTPUT«(1 2)␤»
ugexe m: my @a = 1,2,3,4,5; @a[2]:delete; say @a[0..4] 00:51
camelia rakudo-moar 620f4e: OUTPUT«(1 2 (Any) 4 5)␤»
gfldex m: class Brray is Array {}; my @b is Brray = Brray.new; say @b.WHAT; sub f(*@a){ say @a.WHAT }; f(@b); 00:52
camelia rakudo-moar 620f4e: OUTPUT«(Brray)␤(Array)␤»
sortiz m: my @a = [1,2,3, 4 ..*, (1..*)];
camelia ( no output )
sortiz m: my @a = [1,2,3, 4 ..*, (1..*)]; dd @a; 00:53
camelia rakudo-moar 620f4e: OUTPUT«Array @a = [1, 2, 3, 4..Inf, 1..Inf]␤»
gfldex m: class Brray is Array { method here(){ say 'here' }}; my @b is Brray = Brray.new; say @b.WHAT; sub f(*@a){ say @a.WHAT; @a.here }; f(@b); 00:54
camelia rakudo-moar 620f4e: OUTPUT«(Brray)␤(Array)␤Method 'here' not found for invocant of class 'Array'␤ in sub f at /tmp/cAIBBf4p0p line 1␤ in block <unit> at /tmp/cAIBBf4p0p line 1␤␤»
gfldex do I understand camelia right, that she believes that slurpies should "typecast"? 00:55
timotimo "typecast"?
slurpies will cause a single array argument to be un- and re-packed
gfldex it does coerce Brray to Array but i'm not sure if coerce is what really happens 00:56
00:59 zpmorgag joined 01:02 BenGoldberg joined
sortiz gfldex, A slurpy argument eats as many positional args you pass to one Array: 01:03
m: sub f(*@a){ dd @a }; f([1,2,3,4],<a b c d>,[5,6,7]);
camelia rakudo-moar 620f4e: OUTPUT«[1, 2, 3, 4, "a", "b", "c", "d", 5, 6, 7]␤»
gfldex m: sub f(**@a){ dd @a }; f([1,2,3,4],<a b c d>,[5,6,7]); 01:04
camelia rakudo-moar 620f4e: OUTPUT«[[1, 2, 3, 4], ("a", "b", "c", "d"), [5, 6, 7]]␤»
01:04 adu left
gfldex and it flattens on top of that 01:04
so it doesnt coerce
01:05 roguelazer left
sortiz Yes, and use double ** for not flattening. 01:05
01:05 roguelazer joined 01:07 snarkyboojum joined
gfldex m: class Brray is Array { method here(){ say 'here' }}; my @b is Brray = Brray.new; say @b.WHAT; sub f(@a){ say @a.WHAT; @a.here }; f(@b); 01:07
camelia rakudo-moar 620f4e: OUTPUT«(Brray)␤(Brray)␤here␤»
01:08 vendethiel left
timotimo there's also +@foo for the "single-argument rule" semantics we have in most core methods and subs 01:08
gfldex timotimo: and you are waiting for me to doc that, don't you? :-> 01:09
sortiz :-P
01:10 raiph left
timotimo i'm not deep enough into the proper list semantics, sorry. i've been paying much less attention to stuff in the last ~half-year ;( 01:10
01:16 dh7320 left 01:17 dh7320 joined 01:19 raiph joined
timotimo Use of uninitialized value of type SDL_INIT in string context 01:20
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in any optimize_call at gen/moar/m-Perl6-Optimizer.nqp line 1503
^- btw, this is amusing, but probably pretty terrible :)
sortiz Seems awful, yes. 01:23
01:23 zpmorgag left
sortiz m: sub f(**@a) { dd @a }; f([1..*]) 01:25
camelia rakudo-moar 620f4e: OUTPUT«Cannot .elems a lazy list␤ in sub f at /tmp/RzZSHAPoHZ line 1␤ in block <unit> at /tmp/RzZSHAPoHZ line 1␤␤Actually thrown at:␤ in sub f at /tmp/RzZSHAPoHZ line 1␤ in block <unit> at /tmp/RzZSHAPoHZ line 1␤␤»
sortiz m: sub f(*@a) { dd @a }; f([1..*])
camelia rakudo-moar 620f4e: OUTPUT«(1, 2, 3, 4, 5, 6, 7, 8, 9, 10...Inf)␤»
sortiz m: sub f(**@a) { @a.gist.say }; f([1..*]) 01:26
camelia rakudo-moar 620f4e: OUTPUT«[[...]]␤»
sortiz rudi_s, Was this your question? ^^^ Laziness survive both forms of slurpies 01:28
m: sub f(*@a) { @a.is-lazy.say }; f([1..*]); 01:30
camelia rakudo-moar 620f4e: OUTPUT«True␤»
01:31 dh7320 left
sortiz m: sub f(**@a) { @a[0].is-lazy.say }; f([1..*]); 01:31
camelia rakudo-moar 620f4e: OUTPUT«True␤»
rudi_s sortiz: It does, thanks. Then .List is potentially problematic for my function. But it's not a library so I just have to remember not to call it with a lazy list. 01:33
01:34 telex left 01:36 risou is now known as risou_awy, risou_awy is now known as risou 01:38 skids joined, Guest47022 is now known as nemo, kaa joined 01:44 Actualeyes joined 01:50 vendethiel joined 01:54 telex joined
sortiz .seen hoelzro 01:57
yoleaux I saw hoelzro 22 Feb 2016 19:51Z in #perl6: * hoelzro has memories of family thinking "that Java thing is a virus"
01:59 davido joined
sortiz .tell hoelzro I Have a working implementation of the idea that I mentioned to you in github.com/rakudo/rakudo/pull/718 02:02
yoleaux sortiz: I'll pass your message to hoelzro.
02:02 Ben_Goldberg joined 02:05 BenGoldberg left 02:09 BenGoldberg joined, Ben_Goldberg left 02:10 BenGoldberg left 02:11 BenGoldberg joined, vendethiel left 02:12 davido left
llfourn any way to specify a custom test harness for a module? 02:18
so that panda etc don't just blindly prove everything in t
timotimo m: say Any
camelia rakudo-moar 620f4e: OUTPUT«(Any)␤»
02:32 TreyHarris left 02:35 jameslenz left 02:36 kid51 left 02:39 zpmorgag joined 02:40 labster left 02:42 Ben_Goldberg joined
sortiz llfourn, panda etc prove everything in t that ends with .t, so I would try with .ct for customized. And start the custom harness in t/mytests.t 02:42
llfourn sortiz: mmm yeah that's what I was thinking 02:43
02:43 adu joined
llfourn thanks 02:43
sortiz yw
02:44 AlexDaniel left, BenGoldberg left 02:48 BenGoldberg_ joined 02:49 _dolmen_ joined, kaa left 02:50 Ben_Goldberg left 02:56 raiph left 02:58 ka joined 03:05 raiph joined 03:06 roguelazer left 03:29 ka left, ka joined 03:33 tharkun left, tharkun joined 03:50 roguelazer joined 03:52 noganex_ joined 03:53 roguelazer left 03:54 roguelazer joined 03:56 yqt left, noganex left 04:03 snarkyboojum left 04:06 AlexDaniel joined, sevvie left 04:08 _dolmen_ left 04:14 vendethiel joined 04:23 adu left 04:25 adu joined, adu left 04:26 labster joined 04:28 Herby_ left 04:37 ka left, ka joined 04:38 vendethiel left, Ben_Goldberg joined 04:40 BenGoldberg_ left 04:49 ka left 04:52 perturbation left 04:55 perturbation joined 04:58 adu joined 05:06 lustlife joined 05:09 lustlife left
AlexDaniel Juerd: hah, I like your solution :) 05:10
Juerd: what about ignoring $num ? 05:11
05:13 jeek joined
AlexDaniel Juerd: yea, it works 05:16
Juerd: get; my Bool @switches; :)
05:19 lustlife joined 05:34 Ben_Goldberg left 06:02 Cabanossi left, telex left 06:04 Cabanossi joined, telex joined 06:08 skids left, autarch left, vendethiel joined 06:21 raiph left 06:27 hippie1 left
AlexDaniel m: my @a = <a b c>; @a.splice: 1, 0, 2..5; say @a 06:35
camelia rakudo-moar 620f4e: OUTPUT«[a 2 3 4 5 b c]␤»
AlexDaniel why?
m: my @a = <a b c>; @a.splice: 1, 0, (2..5,); say @a
camelia rakudo-moar 620f4e: OUTPUT«[a 2..5 b c]␤»
06:35 atweiden left
AlexDaniel I expected this ↑ 06:35
06:36 cpage_ joined 06:51 adu left 06:59 molaf joined 07:03 noganex_ left
AlexDaniel Juerd: I wrote a solution that is significantly faster 07:23
Juerd: but it is still not enough to parse this 3mb file
perhaps if I slap binary search on top of that it will suddenly become much faster… but somehow I doubt it
07:27 sno left 07:30 vendethiel- joined 07:32 vendethiel left
AlexDaniel m: my @a; say @a.end 07:35
camelia rakudo-moar 620f4e: OUTPUT«-1␤»
07:35 CIAvash joined 07:37 _mg_ joined 07:41 RabidGravy joined 07:43 firstdayonthejob joined
AlexDaniel why -1 and not Nil or something else? 07:44
07:45 domidumont joined 07:46 ka joined 07:47 FROGGS joined 07:49 domidumont left 07:51 domidumont joined, rindolf joined
[Tux] test 22.300 07:51
test-t 11.934
csv-parser 49.556
07:52 noganex joined 07:54 fireartist joined 07:56 araujo left 08:01 sno joined, wamba joined 08:03 tmch joined 08:06 zakharyas joined 08:07 darutoko joined 08:16 ka left, ka joined
dalek line-Perl5/threading_fixes: ebd7261 | (Stefan Seifert)++ | p5helper.c:
Make sure we call PERL_SET_CONTEXT before accessing P5 in any way

Important for handling multiple P5 interpreters.
08:17
08:18 neilb joined 08:21 araujo joined 08:24 abraxxa joined 08:29 salva joined
RabidGravy HARR! 08:33
lizmat bless you! 08:36
08:38 AlexDaniel left 08:39 firstdayonthejob left 08:40 ely-se joined 08:52 vendethiel- left
renormalist On moarvm.com/features.html it says "On x64, much hot code can also be JIT-compiled into machine code". With x64, does it mean x86_64? 08:58
08:58 nakiro joined, cpage_ left 09:00 ka left
lizmat renormalist: I would think so 09:02
ilmari yes. x64, x86_64 and amd64 are all names for the same cpu architecture 09:03
ely-se with x86_64, do you mean x86-64? 09:05
09:05 azawawi joined
azawawi atom.io/packages/atom-perl6-editor-tools # More animated screencasts 09:05
and hi #perl6 :)
sortiz \o #perl6 09:06
09:06 st_iron joined, cpage_ joined
renormalist ok, thanks 09:06
09:12 st_iron left, vendethiel joined
renormalist Is the Pugs source code only hosted on google code archive? code.google.com/archive/p/pugs/source 09:14
09:16 vytas left 09:17 neilb left
ilmari github.com/audreyt/Pugs.hs 09:17
renormalist just pressed the Export button on Pugs page :-) 09:18
ilmari ah, no, github.com/perl6/Pugs.hs
the link in github.com/perl6/mu/blob/master/README should be updated
renormalist ilmari: ah, I didn't find that
thanks 09:19
09:19 vytas joined
renormalist (now I have more than enough Pugs around :-)) 09:19
09:20 atta left 09:21 neilb joined
renormalist Maybe someone already knows the answer: was Pugs using Haskell's Parsec parser lib or was it doing its own thing? 09:21
peteretep parsec 09:24
09:24 ely-se left
peteretep hackage.haskell.org/package/Pugs 09:24
peteretep wonders what Audrey is up to 09:25
09:25 atta joined
peteretep Looks like she's gone all political 09:26
09:28 zakharyas left 09:29 TEttinger left 09:30 zakharyas joined, TEttinger joined
lizmat clickbaits p6weekly.wordpress.com/2016/02/22/2016-8-yacr/ before being away for a few hours& 09:32
09:32 atta left 09:33 atta joined, azawawi left 09:34 dakkar joined 09:35 ka joined 09:36 vendethiel left
FROGGS lizmat++ 09:36
stmuk_ "you wouldn't believe what happened in perl 6 this week" 09:52
nine m: my %h = a => [1, 2, 3], b => [3, 4], c => [5]; for %h.pairs.sort({$^a.key cmp $^b.key}).map(*.kv) -> ($name, @postings) { say $name; say @postings; } 10:00
camelia rakudo-moar 620f4e: OUTPUT«a␤[1 2 3]␤b␤[3 4]␤c␤[5]␤»
nine There must be a shorter way than this ^^^
dalek rl6-most-wanted: 8641ca2 | (Brian Gomes Bascoy)++ | most-wanted/modules.md:
Update modules.md
10:03
rl6-most-wanted: a02d30f | azawawi++ | most-wanted/modules.md:
Merge pull request #17 from pera/patch-1

Update modules.md
10:07 solarbunny joined
sortiz m: my %h = z => [1, 2, 3], x => [3, 4], y => [5]; say %h{$_}:kv for %h.keys.sort; 10:08
camelia rakudo-moar 620f4e: OUTPUT«(x [3 4])␤(y [5])␤(z [1 2 3])␤»
nine sortiz: That's close to the original Perl 5 code and exactly what I wanted to replace with something more elegant :) 10:10
10:11 vendethiel joined
sortiz m: my %h = z => [1, 2, 3], x => [3, 4], y => [5]; say |(%h{$_}:kv) for %h.keys.sort; # With a touch of elegance ;) 10:11
camelia rakudo-moar 620f4e: OUTPUT«x[3 4]␤y[5]␤z[1 2 3]␤»
nine m: my %h = a => [1, 2, 3], b => [3, 4], c => [5]; for %h.pairs.map(*.kv) -> ($name, @postings) { say $name; say @postings; } 10:12
camelia rakudo-moar 620f4e: OUTPUT«a␤[1 2 3]␤c␤[5]␤b␤[3 4]␤»
nine Works, too, but only because of Pair's stringification
jnthn nine: %h.pairs.sort({$^a.key cmp $^b.key}) can be %h.sort(*.key) 10:16
nine jnthn: Aaaah...it decides by arity :) Thanks! 10:19
jnthn Yeah, and .sort will iterate the hash, which by default gets you pairs, so no need to do that explicitly either 10:21
nine Invalid GC status observed; aborting 10:28
Happens just by wrapping a block in await start { } 10:31
10:32 vendethiel left 10:38 cpage_ left 10:40 labster left 10:43 labster joined
DrForr MadcapJake: Latest Prancer push fixes the issues you noticed with the exception of text/plain, I might get to that tonight. 10:43
10:54 labster left 10:56 labster joined, labster left 10:59 mr-foobar joined 11:07 rindolf left 11:08 ely-se joined 11:09 TEttinger left 11:12 rindolf joined 11:14 cgfbee joined 11:20 sortiz left 11:21 ely-se left 11:24 pmurias joined, ka left 11:26 ka joined
pmurias jnthn: re performance grant, based on nqp-js experience working on the profiler seems like a promissing thing, I'm using the chrome's builtin profiler for nqp-js code and it's finding some really suprising things 11:26
jnthn pmurias: Yeah, the current Moar one has turned up plenty also :) 11:27
Though you need to have got the problem down to something quite small for it to be usable.
pmurias for example a large time of parsing json was spent doing nqp::callercode ;) 11:28
jnthn o.O
Doubt we'd find that on Moar...pretty sure that's a couple of pointer follows :)
But sure there's other such things 11:29
pmurias it was something really specific to the v8 jit
jnthn ah :)
But yeah, agree that having better profiling tools will let us turn up more issues. 11:30
pmurias the v8 tools even sometimes show a cute little yellow warning sign that the v8 jit refuses to optimize a given sub ;)
s/v8 tools/chrome's profiler/ 11:31
dalek p: d555ce0 | (Pawel Murias)++ | src/vm/js/ (3 files):
[js] Implement nqp::curcode() in a simpler way.
11:32
p: 791d643 | (Pawel Murias)++ | src/vm/js/nqp-runtime/reprs.js:
[js] optimize P6opaque.allocate
11:34 donaldh joined 11:39 zpmorgag left 11:42 haircode joined 11:45 kaare_ joined 11:49 raiph joined
nine Threading allows for all sorts of exciting new error messages ;) Internal error: unhandled dyncall argument type 11:53
11:56 haircode left
lizmat nine: while working on PackUnpack, I found that if I run it like "perl6 -Ilib _e 'use PackUnpack'" and there is a compile error, I get the dsame error message twice 11:57
*-e
FROGGS nine: is that error reproducable?
lizmat is that to be expected, or is it odd?
11:58 haircode joined
nine lizmat: sounds rather odd 12:00
12:00 ka left
lizmat ok, I will look deeper into it then 12:00
nine FROGGS: no :/ I do get a reproducable "Scalars leaked: -1" message at the end of the program. But I don't even know if that's Perl 6 or Perl 5. 12:01
jnthn Perl 5
I'd think
Seems a very unlikely message from a Perl 6 perspective.
nine: github.com/Perl/perl5/blob/9d876b6...rl.c#L1219 12:02
lizmat nine: that most definitely is a P5 message: I know it well from the early ithreads days :-) 12:06
nine Then that's work for me I guess :) 12:08
FROGGS: I just got the dyncall thing a second time 12:09
ilmari how do you leak -1 scalar? 12:11
free one you didn't allocate?
nine ilmari: threading
I thought it would be fun giving the "run separate Perl 5 interpreters in multiple Perl 6 threads" idea a try ;) 12:12
ilmari nine: I meant conceptually... 12:13
jnthn Leaking -1 scalars isn't normal...but it is on threads!
ilmari freeing the same scalar twice?
lizmat wouldn't that be a double free ? 12:14
12:14 sufrostico joined 12:15 _mg_ left
moritz maybe the number of scalars overflowed :-) 12:15
FROGGS hmmm 12:16
nine It always seems to be -1
FROGGS nine: if it persists I could try to look at that... though I'm not an expert when it comes to threading
12:18 ka joined 12:25 ka left 12:30 pmurias left, pmurias joined 12:31 _mg_ joined, pmurias left 12:32 ka joined 12:35 pmurias joined 12:37 skids joined 12:41 skids left 12:43 donaldh left 12:52 nowan left 12:55 nowan joined 13:00 rindolf left 13:01 Skarsnik joined, sufrostico left 13:02 gensym left 13:05 ka left 13:07 ka joined
|Tux| Do signatures support either/or types? «method foo (IO $handle, Str|Callable $x) { … }» 13:09
of course I can make two methods with different signatures 13:10
13:10 virtualsue joined
psch m: sub f ($a where Str|Callable) { say $a.WHAT }; f -> { }; f "foo"; f 42 13:10
camelia rakudo-moar 620f4e: OUTPUT«(Block)␤(Str)␤Constraint type check failed for parameter '$a'␤ in sub f at /tmp/Lq8IJylcAC line 1␤ in block <unit> at /tmp/Lq8IJylcAC line 1␤␤»
jnthn No, you'd need to do it in a where
psch right, technically not a type but a constraint
|Tux| that'll do
dalek kudo/nom: 96a1954 | lizmat++ | src/core/Buf.pm:
int arrays now can Buf.push|append|unshift|prepend

They couldn't before:
   This representation (VMArray) does not support attribute storage
It's still a bit slower than using Int arrays, but I guess another round of speshing/optimizing/jitting will take care of that in the future
13:11
rudi_s m: "hi\r\nho\nhu".split("\n").perl 13:15
camelia ( no output )
rudi_s m: say "hi\r\nho\nhu".split("\n").perl
camelia rakudo-moar 620f4e: OUTPUT«("hi\r\nho", "hu")␤»
rudi_s Is this expected and if so how can I fix it? I want to split on "\n", but "\r\n" is treated as single character. 13:16
I want to split on all "\n" no matter what else is before/after it.
timotimo m: say "hi\r\nho\nhu".lines
camelia rakudo-moar 620f4e: OUTPUT«(hi ho hu)␤»
timotimo m: say "hi\r\nho\nhu".lines.perl
camelia rakudo-moar 620f4e: OUTPUT«("hi", "ho", "hu").Seq␤»
rudi_s I can understand that it happens for lines (well, not really, but well). But I still want a way to split on the character "\n". 13:18
timotimo m: say ord("\n") 13:19
camelia rakudo-moar 620f4e: OUTPUT«10␤»
timotimo m: say "hi\r\nho\nhu".split(/ \x0a /).perl
camelia rakudo-moar 620f4e: OUTPUT«("hi\r\nho", "hu")␤»
timotimo m: say "hi\r\x0aho\nhu".split(/ \x0a /).perl 13:20
camelia rakudo-moar 620f4e: OUTPUT«("hi\r\nho", "hu")␤»
timotimo the magic of newlines ...
lizmat timotimo : \r\n is a synthetic
13:20 n0xff joined
timotimo we're treating \r\n as one thing, as unicode prescribes it 13:20
so it's hard to split it open. because we go to extra lengths to prevent splitting things that are one grapheme
because that's what makes other programming languages suck at unicode
rudi_s Well, it makes perl6 suck at handling byte-oriented data. - Any idea how I can fix that? I get output from a program which I must split on just "\n". 13:22
psch rudi_s: if you want to deal with your Str as bytes Buf it
timotimo yeah 13:23
psch rudi_s: you need to specify an encoding then, and handle it as a byte array too
rudi_s How do I split on Buf? 13:24
lizmat m: dd "a\r\nb\nc\rd".split(("\n","\r\n","\r"),:k) # perhaps this can be of use, rudi_s ?
camelia rakudo-moar 620f4e: OUTPUT«("a", 1, "b", 0, "c", 2, "d")␤»
timotimo ah, good catch liz 13:25
lizmat it would allow you to differentiate between \r \r\n and \n
rudi_s Well, then I'd have to manually combine it later.
How do I split a Buf?
lizmat rudi_s: we don't atm, afaik 13:26
psch m: my $buf = "hi\r\nhu\nho".encode('ascii'); say $buf.grep(* != "\x0a")
camelia rakudo-moar 620f4e: OUTPUT«(104 105 13 10 104 117 10 104 111)␤»
psch uh
13:26 donaldh joined
psch yeah, stupid comparison there :) 13:26
m: my $buf = "hi\r\nhu\nho".encode('ascii'); say $buf.grep(* != 10)
camelia rakudo-moar 620f4e: OUTPUT«(104 105 13 104 117 104 111)␤»
rudi_s lizmat: Awesome ... 13:27
psch well, that's not splitting
rudi_s: .split is inherintly a Str operation, and Buf/Blob are byte arrays
13:27 autarch joined
rudi_s psch: Well, there should still be a way to split a Buf on a byte. 13:28
pmurias isn't a Buf already a byte array? 13:32
what's the point of spliting it? 13:33
13:33 autarch left, autarch joined, nightfrog left
RabidGravy there's a sub in H::UA that searches for a byte sequence in a buf, which is then used for doing a subbuf 13:34
but that's what 'split on a Buf' implies 13:35
13:35 Actualeyes left
rudi_s pmurias: Did you see my example above? That's all I want to do. 13:36
psch well, afaiu this generalizes to "separate a List into multiple List delimited by $x"
rudi_s Yes.
psch which i think could be convenient enough as a builtin, but i maybe it's not vOv
renormalist I'm getting: NativeCall: Consider adding the api version of the library you want to use, sub foo is native(readline, v1) with each perl6 prompt.
psch s:2nd/ i //
renormalist Anyone knows how I can avoid that? 13:37
psch in any case, probably needs prototyping :)
13:37 dbrunton joined
renormalist Probably from Readline - can I uninstall a panda lib? 13:37
13:37 ka left
nine rudi_s: how about $buf.decode('latin-1').split("\n")? latin-1 should give you basically one byte per character 13:37
psch fwiw, i can't think of anything idiomatic off the top of my head
the general case that is, nine's idea seems fitting enough here... 13:38
jnthn nine: Uh...but if you decode it to a Str then NFG applies and \r\n becomes a grapheme :)
We probably should have a Buf.split, which takes a Blob to split on
And it'd Blob.split too 13:39
13:40 colomon left, ka joined, jameslenz joined
nine renormalist: perl6 -e 'my $cu = $*REPO.resolve(CompUnit::DependencySpecification.new(:short-name<Readline>)); $cu.repo.uninstall($cu.distribution);' 13:41
DrForr renormalist: Thanks, I'll fix that in a few.
RabidGravy github.com/sergot/http-useragent/b...nt.pm6#L92
renormalist nine: hm, I get: Method 'resolve' not found for invocant of class 'CompUnit::Repository::Installation' 13:43
nine renormalist: then your rakudo version doesn't support uninstall yet
renormalist nine: hm, I'm on Rakudo* 2016.01 made with perl5.22.1 - can I do something about it? 13:44
13:44 mr-foobar left
renormalist nine: like rebuild with some option? 13:44
nine renormalist: upgrade to 2016.02
pmurias nine: would decoding utf8 as latin1 work correctly? 13:45
renormalist tries...
13:45 mr-foobar joined
nine pmurias: well it wouldn't help anyway as jnthn++ pointed out. But pretty much everything can be interpreted as latin-1. 13:45
jnthn pmurias: For some interesting definition of "correctly". Every valid utf-8 sequence will decode as latin-1 for the same reason everything decodes as latin-1 :) 13:46
pmurias just using a loop on the buf seems cleaner than decoding to latin1, spliting on "\n" encoding back to a buf and recoding as utf8 13:47
renormalist nine: can you point me to upgrade instructions, 2016.02 doesn't seem to be official by just tweaking URLs with s/01/02/g
RabidGravy is the CompUnit::Repository.installed() not implemented yet?
jnthn pmurias: And that won't help anyway, because \r\n in latin-1 is still 1 grapheme after decoding :) 13:48
nine renormalist: Sorry, I've only ever installed rakudo straight from git. 13:49
renormalist nine: oh, do I mix up rakudo with rakudo star?
nine renormalist: probably
RabidGravy: installed()?
renormalist nine: mkay, don't worry, I will play around a bit, thanks so far.
RabidGravy "Returns the Distribution objects for all installed distributions" says the comment in Compunit::Repository::Installable 13:51
13:51 Psyche^ joined
RabidGravy which would be way handy 13:51
nine RabidGravy: oh...seems like I forgot to implement that 13:52
RabidGravy :) 13:53
I couldn't work out how to get the information otherwise
13:53 Actualeyes joined 13:55 Psyche^_ left 13:56 pierrot joined
rudi_s Hm. I can't even check if the string contains that char: say "\r\n".contains("\n") ... 13:59
13:59 dakkar_ joined
rudi_s That's really problematic for my use case. 13:59
FROGGS say "\r\n".NFCD
m: say "\r\n".NFCD
camelia rakudo-moar 96a195: OUTPUT«Method 'NFCD' not found for invocant of class 'Str'␤ in block <unit> at /tmp/AEhyyCoEMV line 1␤␤»
FROGGS m: say "\r\n".NFC
camelia rakudo-moar 96a195: OUTPUT«NFC:0x<000d 000a>␤»
FROGGS m: say "\r\n".NFC.grep: "\n"
camelia rakudo-moar 96a195: OUTPUT«()␤»
FROGGS m: say "\r\n".NFKD.grep: "\n" 14:00
camelia rakudo-moar 96a195: OUTPUT«()␤»
FROGGS m: say "\r\n".NFKD
camelia rakudo-moar 96a195: OUTPUT«NFKD:0x<000d 000a>␤»
FROGGS m: say "\r\n".NFKD.grep: "\n".ord
camelia rakudo-moar 96a195: OUTPUT«(10)␤»
FROGGS m: say so "\r\n".NFKD.grep: "\n".ord
camelia rakudo-moar 96a195: OUTPUT«True␤»
jnthn rudi_s: That's because \r\n is a different character to \n
FROGGS rudi_s: ^^
psch m: "\r\n".chars.say 14:01
camelia rakudo-moar 96a195: OUTPUT«1␤»
14:01 dakkar left 14:02 ely-se joined
perlpilot rudi_s: imho, if you mean to talk about line feed characters and carriage return characters, it's best to stay away from \n and \r and instead use hex or octal or some other representation that doesn't have some extra symbolic meaning attached to it. 14:02
rudi_s jnthn: FROGGS: Well, yes. I understand that. 14:03
perlpilot: Doesn't help me if I get input from outside of my program.
psch wonders what didn't work about .lines
oh. the \r was supposed to stick around, wasn't it 14:04
timotimo yeah, that's what
rudi_s Yeah.
jnthn So I'd do it at byte level, which will just be a little inconvenient at the moment due to the lack of a Blob.split method 14:05
timotimo but the split :k thing should help
14:05 skids joined
jnthn Or what timo said 14:05
14:05 virtualsue left
perlpilot rudi_s: or you could implement Blob.split for the next guy (which is probably you again :) 14:06
rudi_s Are there more Str surprises I should be aware of? Basically I want that input and output stays the same even when it passes through Str. 14:07
stmuk_ I'm trying to use a channel to plot SDL based on a number of promises calc'ing a mandelbrot .. and it seems slower than not using concurrency .. is there anything obviously wrong with
github.com/stmuk/contalk/blob/master/mbrot4.p6
moritz stmuk_: how many calculation do you do per promise? 14:08
stmuk_ not sure yet 14:09
moritz you might need to a few thousand or ten thousand to make up for the concurrency overhead 14:10
stmuk_ I was getting better results by limiting the number of threads very low
I only have dual core machines as well
actually probably less than 100 calcs :/ 14:13
14:13 cdg joined
psch rudi_s: afaiu passing through Str has to slightly change the data because unicode is weird 14:14
rudi_s: as in, perl6 does some unicode-y things more sensible (or even correctly?) than many other implementations, which screws with the other implementations expectations... there is probably a blog post by jnthn++ that explains it better and in more detail... 14:15
jnthn Str promises Unicode canonical equivalence, not original bytes equivalence.
stmuk_ actually increasing the size of the image should give me very much calcs/promise
RabidGravy nine, installed() something like gist.github.com/jonathanstowe/be95...f713cff2b5 ? 14:16
rudi_s psch: jnthn: Thanks. Will have to think how can use that properly for my use case. 14:17
*how I can
jnthn: "not original bytes equivalence" is problematic for Paths, but last time you convinced me that Perl6 handles that correctly. Was that an incorrect assumption? 14:18
FROGGS rudi_s: if you need to stick to the "original bytes and their ordering" stick to the bytes level 14:19
jnthn rudi_s: We use a differnet encoding for those, that uses NFG synthetics to represent things so they can round-trip. But it will also frustrate proper string processing.
rudi_s jnthn: Ah, so it's all in the special encoding/decoding. Good. 14:20
jnthn rudi_s: So, you really only want to use that for interchange with the OS. 14:21
rudi_s Ok.
14:21 dbrunton left
jnthn You *can* read a file with it, but you'll get really "interesting" effects if you try and do string equality and the two files happen to have been in different Unicode normal forms. 14:21
14:23 jameslenz left
rudi_s Won't try that then. 14:23
14:25 jameslenz joined 14:27 colomon joined
[Coke] yawn. 14:34
s
nine RabidGravy: I think it's meant to be per repo, not for the whole repo chain
RabidGravy well even easier then :) 14:35
nine yeah, something like: method installed() { self.prefix.child('dist').dir.map({ Distribution.new(|from-json $_.slurp) }) 14:36
14:40 dakkar__ joined
renormalist sorry if I ask noob questions: does today's perl6 (2016.01) already do autoparallelism/autothreading behind the scenes, like on vector operators, or junctions? 14:44
14:44 dakkar_ left
stmuk_ I need moar cores 14:46
flussence map/reduce-like operations are threaded if you ask them to be 14:47
perlpilot renormalist: the short answer is "no"
14:47 virtualsue joined
renormalist perlpilot: I come from the FAQ which show "abuse" of "autothreading" to print values of a junction, that's why I ask. 14:48
doc.perl6.org/language/faq#How_can_...unction%3F
14:48 virtualsue left
renormalist perlpilot: you probably have a longer answer ending with "yes" - point me to it, please. :-) 14:49
14:49 virtualsue joined
perlpilot renormalist: actually, the longer answer probably still ends with "no" depending on what you mean by "threading" and "auto" :) 14:50
renormalist: mostly we have syntactic hints that things are to be parallelized, so there is no "auto" without you telling the compiler
renormalist: and for junctions we have "conceptual threading", but I don't think we actually use separate threads yet. 14:51
renormalist perlpilot: ok, what I mean with "auto~" is that magic "all my cpus are utilized well by the perl6 compiler without me taking care of it in the program". 14:53
perlpilot: I'm currently just reading and playing around, so a "no" is fine, I'm just curious. 14:55
14:56 mr-foobar left 14:57 ely-se left
ugexe I thought the duplicate compile errors were fairly well known. in any case lots of people have reported this # nine 14:58
14:58 cpage_ joined
perlpilot renormalist: maybe start by looking at jnthn.net/papers/2015-spw-concurrency.pdf and other stuff at www.jnthn.net/articles.shtml 14:59
15:00 mr-foobar joined
renormalist perlpilot: great, thanks, started reading it... 15:00
15:01 TreyHarris joined 15:02 rindolf joined, autarch left, cpage_ left, autarch joined 15:04 autarch left 15:05 autarch joined 15:06 TreyHarris left 15:07 wamba1 joined, wamba left
skids gist.github.com/skids/aca87c6b6fb065a3c244 close to performant solution to www.reddit.com/r/dailyprogrammer/c...ith_light/ 15:08
15:08 prammer joined
lizmat nine: on the compile error issue: it would appear there's two processes doing the compile 15:08
create a lib/foo.pm with "foo" in it
add $*PID to X::Undeclared::Symbols message 15:09
do perl6 --ll-exception -lib -e 'use foo'
the first one seen has the higher process number, but looks like it just compiling (happens in the grammar) 15:10
nine: could it be that it's precompiling, which fails, then tries to run it as source, and fails again ? 15:11
ugexe i thought what was happening is it tries to use the precompiled version (that was installed), which fails, and then tries to load the source and precompile that
lizmat adding a "no precompilation" to the foo module, makes it only show the error once 15:12
15:13 Guest5741 left 15:14 luiz_lha joined 15:15 luiz_lha is now known as Guest72897
ugexe github.com/rakudo/rakudo/blob/nom/...#L336-L338 15:16
nine lizmat: oh yes, that sounds like a valid explanation 15:17
ugexe rt.perl.org/Ticket/Display.html?id=127176
RabidGravy so I'd totally forgotten about complex types with simple content, need to look at more schema 15:18
nine I think this github.com/rakudo/rakudo/blob/nom/...ory.pm#L30 swallows the fail from github.com/rakudo/rakudo/blob/nom/...ry.pm#L156 15:19
lizmat: Easiest fix should be replacing the fail in github.com/rakudo/rakudo/blob/nom/...ry.pm#L156 by a die 15:22
15:25 donaldh left
ugexe `module XXX { our $FOO is export = BAR(); sub BAR { die; }; }; import XXX;` # -e dies as expected. putting module XXX into its own file and using it dies from NQP 15:25
15:26 donaldh joined 15:27 vendethiel joined 15:34 jameslenz left 15:35 jameslenz joined
lizmat nine: will try 15:35
15:38 sufrostico joined, virtualsue left 15:40 gensym joined 15:41 TreyHarris joined, fireartist left
lizmat nine: it looks like @result is always empty on an unsuccessful precompile 15:45
nine lizmat: maybe because such error messages actually go to .err, not .out? 15:48
lizmat yep, think so: so they're already visible, so we don't need to do anything, except exit 15:49
15:49 vendethiel left 15:50 ka left
hoelzro o/ #perl6 15:51
yoleaux 02:02Z <sortiz> hoelzro: I Have a working implementation of the idea that I mentioned to you in github.com/rakudo/rakudo/pull/718
hoelzro .tell sortiz thanks, I'll take a look when I have some time!
yoleaux hoelzro: I'll pass your message to sortiz.
hoelzro (hopefully Wednesday night)
nine lizmat: than it's actually ok the way it is. We just need to make it more fatal. 15:52
lizmat yeah, testing a patch now
nine: can we have multiple threads doing precompiling of different (independent) files at the same time ? 15:55
15:57 colomon left
nine lizmat: they would probably fight about the PrecompilationStore lock file 15:58
lizmat ah, well, serialized by it, for sure ? 15:59
nine yes
I hope 16:00
lizmat thing is, visually, the best result is to just "exit $proc.status" 16:01
nine On second thought: I think it would more like end in catastrophe. This code is not thread safe.
But that would make module loading errors non-catchable?
lizmat ok, so we'll make that a point of interest :-) being able to do what *is* possible in parallel, would be nice
16:02 autarch left
lizmat nine: the error is already on screen by that time 16:02
16:02 spintronic joined
nine Unless STDOUT got redirected. 16:02
s/STDOUT/STDERR 16:03
rudi_s :m sub foo(*@x) { say @x.perl }; foo((1,2), (3,4)); 16:04
m: sub foo(*@x) { say @x.perl }; foo((1,2), (3,4));
camelia rakudo-moar 96a195: OUTPUT«[1, 2, 3, 4]␤»
rudi_s I'm confused about the result. Why are the lists flattened? 16:05
psch m: sub foo(**@x) { say @x.perl }; foo((1,2), (3,4));
camelia rakudo-moar 96a195: OUTPUT«[(1, 2), (3, 4)]␤»
16:05 sena_kun joined
rudi_s What's the difference between **@x and *@x? 16:05
(Doc link is fine.)
16:05 Actualeyes left, pmqs left
moritz *@x flattens 16:05
**@x preserves structure
psch doc.perl6.org/type/Signature#Slurpy...Parameters
oh
there's no docs for **@ or +@ it seems 16:06
ah, there is for **@ at least
well, +@ might be under a different heading...
16:06 mr-foobar left 16:08 Actualeyes joined
rudi_s Thank you. 16:09
16:12 sena_kun left
dalek kudo-star-daily: 8e1fddf | coke++ | log/ (9 files):
today (automated commit)
16:12
kudo-star-daily: 71ba402 | coke++ | log/ (9 files):
today (automated commit)
16:18 _mg_ left 16:19 spintronic left, spintronic joined 16:20 espadrine_ joined, espadrine_ is now known as espadrine, lostinfog joined 16:21 spintronic left
lizmat dinner& 16:21
16:21 spintronic joined 16:22 edenc left, edenc joined
renormalist perlpilot: re 2015-spw-concurrency slides from jnthn - is that available perl6 functionality of today? 16:22
jnthn: ^ you are allowed to answer, too :-) 16:23
RabidGravy you got a link to those slides? 16:26
16:26 rurban joined 16:27 zpmorgan joined
RabidGravy renormalist, yes 16:29
renormalist cool 16:30
stmuk_ Liz's YAPC::EU 2016 covers much of the same ground and had a change or two I believe
and I think supplies (?) changed after that
RabidGravy the supplies piece seems about as it is at the moment 16:31
didn't read in detail so there may be one or two small changes
renormalist is quite excited from the last 2 days reading into perl6 stuff
[Coke] <burns>excellent</burns> 16:32
stmuk_ I meant 6guts.wordpress.com/2015/12/05/get...christmas/
16:37 rurban1 joined 16:38 virtualsue joined 16:39 rurban left 16:49 spintronic left, spintronic joined 16:54 ka joined 16:56 abraxxa left 16:57 zakharyas left 16:58 ka left 16:59 colomon joined 17:00 ka joined 17:02 cpage_ joined 17:03 kst`` is now known as kst, sufrostico left 17:05 neilb left 17:08 _mg_ joined
pmurias jnthn: would it make sense to add a '#line' equivalent to nqp so that we get better errors for combined files? 17:09
17:09 spintronic left, FROGGS left, spintronic joined 17:10 rurban1 left 17:15 neilb joined 17:19 domidumont left 17:21 spintronic_ joined 17:24 donaldh left 17:25 spintronic left 17:26 raiph left 17:29 nakiro left, spintronic_ left, vendethiel joined
psch m: use Test; Test.WHO.perl.say 17:35
camelia rakudo-moar 96a195: OUTPUT«{"\&failure_output" => sub failure_output () { #`(Sub|73884856) ... }, "\&output" => sub output () { #`(Sub|73885312) ... }, "\&todo_output" => sub todo_output () { #`(Sub|73885464) ... }, :EXPORT(EXPORT)}␤»
psch is that how the WHO has to look before symbols are imported..? 17:36
17:36 cpage_ left
psch 'cause i am definitely missing something here... 17:36
loading of java classes seems to work, but the imports don't happen
17:37 virtualsue left
llfourn m: use Test; say Test::EXPORT::DEFAULT.WHO.perl.say # symbols are "imported" from here (sort of) 17:38
camelia rakudo-moar 96a195: OUTPUT«{"\&MONKEY-SEE-NO-EVAL" => sub MONKEY-SEE-NO-EVAL () { #`(Sub|94177080) ... }, "\&can-ok" => sub can-ok (;; Mu | is raw) { #`(Sub|94176472) ... }, "\&cmp-ok" => sub cmp-ok (;; Mu | is raw) { #`(Sub|94173280) ... }, "\&diag" => sub diag (Mu $message) { #`(S…»
psch m: say Test::EXPORT.WHAT 17:39
camelia rakudo-moar 96a195: OUTPUT«Could not find symbol '&EXPORT'␤ in block <unit> at /tmp/EpwjQn7W3E line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/EpwjQn7W3E line 1␤␤»
psch m: say Test::EXPORT::.WHAT
camelia rakudo-moar 96a195: OUTPUT«Could not find symbol '&EXPORT'␤ in block <unit> at /tmp/fNMR2xy3oW line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/fNMR2xy3oW line 1␤␤»
psch hm, so the package itself isn't anything useful for WHAT but the WHO has the Stash..? 17:40
llfourn psch: use Test; say Test::EXPORT.WHAT
psch oh duh
m: use Test; say Test::EXPORT.WHAT
camelia rakudo-moar 96a195: OUTPUT«(EXPORT)␤»
psch m: use Test; say Test::EXPORT.HOW.^name
camelia rakudo-moar 96a195: OUTPUT«Perl6::Metamodel::PackageHOW␤»
psch well, yeah, i think that's the lines i've been trying to look along 17:41
unfortunately i fail to see how i can build that kind in a work-y manner
as in, github.com/rakudo/rakudo/blob/nom/...er.nqp#L22 this way gives me either "expected Stash but got Hash" or something related to nqp::ctxlexpad 17:42
llfourn m: say $*REPO.need(CompUnit::DependencySpecification.new(:short-name<Test>)).handle.export-package.WHO.keys
camelia rakudo-moar 96a195: OUTPUT«()␤»
17:43 dakkar__ left
llfourn m: say $*REPO.need(CompUnit::DependencySpecification.new(:short-name<Test>)).handle.export-package.keys 17:43
camelia rakudo-moar 96a195: OUTPUT«(DEFAULT ALL)␤»
llfourn this is how things are actually loaded
I'm not at all familar with JVM side of things
but each package's .WHO should be a stash 17:44
m: Stash.new
camelia ( no output )
psch right
the bit i'm stuck with is turning the Hash i get from RakudoJavaInterop.computeInterop into a package with a correct WHO 17:45
the Hash there contains stuff like $method_name => CodeRef and '/TYPE/' => HOW 17:46
llfourn I see. I'm not sure what kind of envionment your in, but there is an nqp::setwho operation I think
which will take keyvalues
and may play nicely 17:47
psch hm, that'd play out to pulling the linked bit to Perl 6 level so i can make it a Stash instead of a Hash..?
llfourn otherwise the best thing to do is to create a PackageHOW.create_type
psch 'cause i think nqp::hash there gives a P6-level Hash
...or it hllizes somewhere sneakily 17:48
hm, i'll play around with those two approach, thanks llfourn++ 17:49
llfourn nw :)
psch ehh, i had a jumble there. the computeInterop Hash doesn't actually play into this, it's only the type object from typeForName that comes from load_module... 17:51
these bits used to be less complicated and Just Work once /o\
...not that i'm actually against anything that the CUR* work brought :) 17:52
17:53 virtualsue joined 17:58 spintronic_ joined 18:01 raiph joined 18:02 virtualsue left 18:03 colomon left, zpmorgan left 18:04 spintronic_ left 18:05 firstdayonthejob joined
arnsholt psch: IIRC nqp::hash (and nqp::list for that matter) creates an object according to a type object set during HLL config 18:06
So in Perl 6, it'll give you a Perl 6 hash, yeah, I think 18:07
18:22 patrickz joined
nine psch: what do you tink about turning JavaModuleLoader into a proper CompUnit::Repository? 18:23
psch nine: github.com/rakudo/rakudo/blob/jvmi...ry/Java.pm is what i'm doing, starting from what NQP does 18:24
nine: seeing as the NQP Repository also has the ModuleLoader separate... 18:25
also that could just be because NQP needs to have the ModuleLoader separate because NQP itself has it already 18:27
or rather, the CU::R::NQP is just piggybacking on what NQP already brings vOv
18:27 sortiz joined
psch anyway, i could probably drag the JavaModuleLoader code into CU::R::Java, but i'll stick with "make it work" for now ;) 18:28
sortiz \o #perl6 18:30
yoleaux 15:51Z <hoelzro> sortiz: thanks, I'll take a look when I have some time!
[Coke] keeps reading sortiz as soritz like moritz. 18:31
18:32 ka left
nine psch: NQP's module loader code is mostly in NQP because it started out that way and there was not enough incentive to fight the porting problems. 18:32
18:32 sufrostico joined
psch s/also/although/ # belatedly 18:33
18:33 raiph left
nine psch: doing it in Perl 6 may save you some of these NQP vs. HLL problems though :) Maybe github.com/rakudo/rakudo/blob/jvmi...y/Perl5.pm could be an inspiration 18:34
psch i had looked at that a bit too, to figure out this Stash stuff... 18:35
18:35 spider-mario joined
psch but yeah, if nothing else we could lose the JavaModuleLoader 18:35
nine This is the other half: github.com/niner/Inline-Perl5/blob...5.pm6#L832 18:36
18:38 CIAvash left
psch huh, so i also need an &EXPORT..? 18:39
nine I can only tell you that it seems to work. I tinkered around till it did what it should 18:40
psch ah, a development method after my own heart :) 18:41
18:41 raiph joined, musiKk joined
psch well, as mentioned i'm mostly looking for ideas which direction i should tinker towards 18:43
and moving all this to P6-level seems like a good one, 'cause building the Stash/Package structure there is quite a bit easier than in NQP
18:44 AlexDaniel joined 18:45 virtualsue joined
dalek kudo/nom: ab4d432 | coke++ | docs/release_guide.pod:
remove unneeded tag instructions
18:46
kudo/nom: c86ac20 | coke++ | docs/release_guide.pod:
add -u option, fails for me without
18:47 roguelazer left, roguelazer joined
TreyHarris a couple grammar questions... first, years ago, i think it was common to specify "proto token foo {*}; token foo:sym<one> { ... }; token foo:sym<two> { ... }; etc..." in preference to specifying alternations in a single token. But the current docs don't give this as an example and I don't see any examples of that in the core, so do I presume that's fallen out of favor? (it still works) 18:49
18:51 Actualeyes left 18:52 AlexDani` joined 18:54 AlexDaniel left, AlexDani` is now known as AlexDaniel 18:55 musiKk left, cdg left
MadcapJake anyone know how i can get a perl.org email? I need one and a login in order to send emails via my issue submitter 19:00
19:03 yqt joined
perlpilot TreyHarris: no, that hasn't fallen out of favor. That's still one of the best ways to extend a grammar when the tokenization is already right but you want to add more alternatives. 19:04
TreyHarris perlpilot: thanks
second question: so what's a good concise rule or rules to represent hashy perllike comments and no-op whitespace? 19:05
perlpilot TreyHarris: um ... whatever is in src/Perl6/Grammar.nqp :) 19:06
TreyHarris my TOP is currently: "token TOP { [<cmd> \n+]* }", which surprisingly to me does not allow for blank lines between valid <cmd>s 19:07
I'd think the "\n+" would allow that
arnsholt Why should that match blank lines? \n+ matches a sequence of newlines =) 19:09
perlpilot maybe you want rule instead of token? 19:10
maybe you want to match <ws> ?
maybe you want an anchor or two?
arnsholt Yeah, you probably want something based on <ws> as well to gobble up the blanklines
TreyHarris arnsholt: if 'a' and 'b' are my only two allowed matches of <cmd>, why does "a\nb\n" match but "a\n\nb\n" not?
19:11 molaf left
perlpilot TreyHarris: can cmd match zero characters? 19:11
arnsholt That's weirder, yeah
psch m: grammar G { token TOP { [ [a|b] \n+ ]* } }; G.parse("a\nb\n").say # ? 19:12
camelia rakudo-moar c86ac2: OUTPUT«「a␤b␤」␤»
TreyHarris um, here, i'll gist it, one moment. (is gist the preferred paste here?)
psch m: grammar G { token TOP { [ [a|b] \n+ ]* } }; G.parse("a\n\nb\n").say # ?
camelia rakudo-moar c86ac2: OUTPUT«「a␤␤b␤」␤»
perlpilot TreyHarris: gist is fine
TreyHarris oops, that was in error, turns out my examples with blank lines lacked an ending newline before EOF. 19:17
but: gist.github.com/treyharris/9f39736e766bbc0c1a8b
what would I change to allow newlines before my first a or b?
psch m: gist.github.com/treyharris/9f39736e766bbc0c1a8b
camelia rakudo-moar c86ac2: OUTPUT«noparse␤»
psch m: say slurp
camelia rakudo-moar c86ac2: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
psch right, of course 19:18
perlpilot TreyHarris: btw, do you know about % in regex? 19:19
pmurias Ian Hague grants are voted on two weeks after the end of the community feedback period? 19:21
TreyHarris perlpilot: yes, but where I was going was to make blank lines a type of comment, so [<my-rule>+ % \n+] seemed wrong
19:21 TEttinger joined 19:22 FROGGS joined
TreyHarris perlpilot: though I now see that "token TOP { [<my-rule>+ % \n]* }" doesn't work so I guess I don't understand % after all 19:23
19:23 prammer left
psch m: grammar G { token TOP { [ [a|b]+ % \n* ]* } }; G.parse("a\n\nb").say 19:23
camelia rakudo-moar c86ac2: OUTPUT«「a␤␤b」␤»
psch % doesn't do trailing separators
m: grammar G { token TOP { [ [a|b]+ %% \n ]* } }; G.parse("a\nb\n").say 19:24
camelia rakudo-moar c86ac2: OUTPUT«「a␤b␤」␤»
psch %% does though
perlpilot psch++ for the examples while I was distracted :) 19:25
19:26 espadrine left
TreyHarris psch++ thanks 19:26
I see the answer from Grammar.nqp is to define comments as a type of ws 19:27
which may be fine for my purposes, not sure, I'll have to get farther into the real project. The thing I'm doing is to parse a variant of Markdown that will still render correctly in a normal Markdown processor, so I was planning on sticking my extensions in (Markdown) comments. So I was trying to start with a un-flavored Markdown grammar and then extend it, but if comments are waved away as ws from the start, 19:32
it seems it would be difficult to say in a derived grammar "... but this one kind of ws I now want to make not ws" without doing copy-pasting from the parent ws rule. hrm. This is why I'm practicing with a toy grammar, I assume this will become clearer as I practice. :)
19:32 ka joined 19:34 colomon joined, prammer joined
TreyHarris i expected to find a perl6 markdown-to-html someone wrote at some point, but i don't see one. there are several exmples of perl6 converting othing things _to_ markdown (including POD, of course) 19:36
19:36 sufrostico left, prammer left
psch modules.perl6.org points at github.com/retupmoca/p6-markdown 19:36
19:37 ka left 19:38 sufrostico joined 19:40 [particle] left
AlexDaniel I've actually used it. It worked OK 19:40
psch m: grammar G { token TOP { a* %% <ws> } }; class A { method TOP($/) { make $<ws>>>.ast }; method ws($/) { make ~$/ eq ' ' ?? "double space!" !! '' } }; G.parse("a\na a\n a \n", :actions(A.new)).made.say # somewhat hacky way to react to specific kinds of <ws>
camelia rakudo-moar c86ac2: OUTPUT«[ double space! ]␤»
TreyHarris psch: ahh, clever 19:41
psch where "somewhat" means "please wait if anyone has a better idea"... :)
moritz fwiw you should overwrite ws to only match non-significant whitespace in your problem domain 19:42
so if two line breaks make a paragraph, make sure that <ws> doesn't match that
19:43 [particle] joined
TreyHarris moritz: right, but if i'm inheriting from a grammar where <ws> matches any amount of line breaks, and I, say, want to intercept four newlines in a row and make them not <ws>, how can I do that without copy-pasting from the parent ws? 19:44
psch usual inheritance practice applies, i'd say
19:44 itaipu joined
psch as in, either provide a ws rule that does exactly what you want or handle special cases before redispatching to the parent 19:44
moritz right
TreyHarris hm... what does an initial || in a token do? 19:48
19:49 yqt left
moritz nothing 19:49
it's just that you're allowed to put the || not just between tokens, but also up front 19:50
for nicer vertical formatting
AlexDaniel it is there so that you can line up || nicely
TreyHarris Ohhh. Okay, so that explains github.com/perl6/nqp/blob/master/s...ar.nqp#L54 19:51
how do you "redispatch"? that word doesn't appear anywhere I see except for doc.perl6.org/type/X::NoDispatcher#...dispatcher 19:52
moritz callsame
or explicit calling with <TheClass::method> or something 19:53
19:54 virtualsue left
sortiz .ask lizmat Seems to me that Buf.push and Buf.append are identical (the same for .unshift/.prepend). It's intended? 19:54
yoleaux sortiz: I'll pass your message to lizmat.
moritz probably, because Buf doesn't have the flat/non-flat distinctions that Array has 19:55
TreyHarris argh, my google search didn't find doc.perl6.org/language/functions#Re-dispatching for some reason.... 19:56
19:56 prammer joined
TreyHarris sorry and thanks. 19:56
19:58 prammer left
sortiz moritz, Can be, but then Buf.append should attempt to always flat its arguments, I though. 20:03
moritz the *@values candidate does, no? 20:04
m: my $b = Buf.new; $b.apend((1, 2), (3, 4); say $b
camelia rakudo-moar c86ac2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LkbmMf1w_D␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/LkbmMf1w_D:1␤------> 3Buf.new; $b.apend((1, 2), (3, 4); say $b7⏏5<EOL>␤ expecting any of:␤ post…»
moritz m: my $b = Buf.new; $b.apend((1, 2), (3, 4)); say $b
camelia rakudo-moar c86ac2: OUTPUT«Method 'apend' not found for invocant of class 'Buf'␤ in block <unit> at /tmp/vet1JmRKun line 1␤␤»
moritz m: my $b = Buf.new; $b.append((1, 2), (3, 4)); say $b
camelia rakudo-moar c86ac2: OUTPUT«Buf:0x<01 02 03 04>␤»
moritz sortiz: seems like it's flattening fine
sortiz moritz, indeed. 20:05
20:05 sufrostico left
moritz is anybody interested in helping me with a bit of web design for a (non-Perl 6) project? 20:05
20:07 sufrostico joined 20:08 darutoko left 20:09 SCHAAP137 joined
sortiz moritz, In that cases, It would be worthwhile to use simply aliases? (To avoid the code bloating) 20:11
moritz sortiz: if that's fast enough, yes
[Coke] moritz: sure. 20:13
20:14 domidumont joined
[Coke] I need a break from docker & git. 20:14
lizmat . 20:15
yoleaux 19:54Z <sortiz> lizmat: Seems to me that Buf.push and Buf.append are identical (the same for .unshift/.prepend). It's intended?
sortiz moritz, lizmat is an expert in benchmarks, I'll wait for her opinion. Thanks. Btw, Buf.shift is missing. 20:16
lizmat sortiz: yes, as you can only push/append ints anyway
sortiz \o lizmat
lizmat you could argue that multi-element push on Buf should be disallowed
20:16 musiKk joined
lizmat sortiz: wrt to shift missing: good point :-) 20:17
sortiz lizmat, And found another problem: Buf!pend uses a CATCH to report unboxing problems, but the generic Blob.new(@values) don't. 20:20
lizmat yeah, it's on my list of things to go through as well
similar issues with native arrays
sortiz: I'll take PR's also :-) 20:21
jnthn Um, don't put CATCHes on paths like that. :( 20:22
You'll never get it inlined
20:23 colomon left
dalek p: ba2aa73 | (Pawel Murias)++ | src/vm/js/Compiler.nqp:
[js] Remove useless code.
20:23
p: c7b640d | (Pawel Murias)++ | t/nqp/75-curcode.t:
Test nqp::curcode with methods.
p: 51983bf | (Pawel Murias)++ | t/nqp/76-capture.t:
Test nqp::usecapture with methods.
p: fcecdf1 | (Pawel Murias)++ | src/vm/js/ (5 files):
[js] Compile suspected methods in a different manner that passes the invocant using this instead of as the 3 js arguments.

For now it just slows things down a bit, will be used to optimize method calls.
jnthn The right fix is to provide a hll_config place to let us have the VM throw the appropriate typed exception there 20:24
Well, or call code to throw...
If we already have tests for the type exception, though, guess we leave the CATCH there and fix it later. 20:25
But it's something to look out for...CATCH + hot path = bad news. 20:26
sortiz jnthn, For the Blob.new case I was thinking in something in the lines of: nqp::push_i($buf, $pulled.DEFINITE ?? +$pulled !! 0) with maybe a warning.
jnthn I think a straight +$pulled will spit out a warning anyway 20:27
say +Int
m: say +Int
camelia rakudo-moar c86ac2: OUTPUT«Use of uninitialized value of type Int in numeric context in block <unit> at /tmp/qXJsL7LRLt line 1␤0␤»
20:27 prammer joined
sortiz jnthn, like the idea of fallback to 0 in other cases? 20:29
dalek kudo/nom: c6df201 | lizmat++ | src/core/Buf.pm:
Add Buf.shift, sortiz++ for spotting its absence
20:31
20:32 prammer left
lizmat jnthn: in the !pend case, would you suggest nqp::istype(...,Int) for each value before push/unshifting ? 20:32
lizmat benchmarks 20:33
jnthn lizmat: A branch guarded by nqp::istype will be elminated nicely by specialization 20:34
lizmat ok
jnthn But we can't really easily eliminate CATCH and the associated handler bits; it means proving the impossibility of an exception being thrown 20:35
Moar actually can inline code with handlers in it too, but the machinery around a CATCH tends to produce enough code that it pushes an otherwise small enough thing over the inline limit. 20:37
20:37 yqt joined
jnthn (The main reason it can is to cope with return handlers in small subs) 20:37
20:37 sufrostico left
sortiz lizmat, btw, for the .push/.append/.prepend/.unshift (Buf:D: int @values) I suspect that nqp::splice can be faster 20:38
lizmat sortiz: again a good point :-) 20:39
jnthn Very likely, yes
20:39 sufrostico joined
jnthn We're not quite smart enough to make that a memcpy yet 20:39
But can in the future
sortiz I'm doing my homework :) 20:40
20:42 _dolmen_ joined
sortiz jnthn, And for the case of identical methods and avoid code bloat, can be possible to use method aliasing? 20:43
m: class Foo { method foo { say "Im foo" } }; Foo.HOW.add_method(Foo,'bar', Foo.^method_table<foo>); Foo.new.bar; # Seems to work 20:44
camelia rakudo-moar c86ac2: OUTPUT«Im foo␤»
lizmat sortiz: in general, you can: but this very early in the setting, and my experiences with tricks like that aren't good :-(
so I try to avoid these tricks in the settings
20:45 prammer joined
lizmat jnthn: looks like !pend is already above the inline level, as the difference is in noise :-( 20:46
lizmat tries to make methods smaller
20:47 yqt left
sortiz lizmat, I'm aware of that, but in this case there are lots of duplicate code. 20:47
jnthn soritz: You'd have to do it in a BEGIN block
20:48 prammer left
sortiz jnthn, Sure, worth it? 20:50
jnthn sortiz: Well, the trouble is that introspection will show up the method under its original name 20:51
So .^methods will give bogus output
lizmat separating !pend into an !push and a !unshift, only make things (marginally) worse 20:53
20:53 adhoc joined 20:54 adhoc left, adhoc joined
sortiz jnthn, yes, that use the name in the Method and not the one of the method_table. 20:54
20:55 adhoc left
jnthn sortiz: Correct. :) 20:55
So your'd actually need to .clone and .set_name
*you'd
lizmat I'm not seeing any benefit in this line of thought, so I;m abandoning it for the moment 20:56
gist.github.com/lizmat/0fa96cd2c6782b1bb2b0 # in case anybody is interested in playing around with this some more
20:57 TimToady left, prammer joined
sortiz Thinking in "method bar is alias(foo);" 20:58
20:59 TimToady joined
pmurias jnthn: how can I detect if something is compiled as a method in nqp? 21:04
21:05 yqt joined, telex left
pmurias jnthn: guess more then detect as I don't have to be 100% correct 21:05
jnthn pmurias: I don't really understand the question, sorry 21:06
pmurias: In Rakudo you'd check ~~ Method I guess but we don't distinguish code object types in NQP 21:07
What's the use case?
pmurias I want to compile methods slightly differently for optimalization purposes
sortiz lunch & 21:08
pmurias if the take the invocant using the javascript this rather then as a positional parameter I can just put them into a prototype and call them directly
s/the/they/
jnthn Remember that you can .^find_method and then call it as a sub
pmurias that's supported too 21:09
21:10 colomon joined
pmurias it's just that one way of calling them will be faster 21:10
jnthn ok
21:10 domidumont left
jnthn I'm often wary of opts that go against things that Perl 6 has as "fundemental" in a sense, I guess. :) 21:11
An easy heuristic may be to see if it has a "self" lexical
But we lower away most of those
pmurias I'm using this heuristic currently, but the lowering gets into the way
21:12 telex joined
pmurias jnthn: is it ok if I add an annotation that marks if the QAST::Block was declared as a sub or method? 21:13
jnthn No
I don't really like annotations have semantic meaning to code-gen.
Heh, an absolute cheat is to look at the .node on the block, and see if you see the word "method" at that string offset :P 21:15
21:15 autarch joined
dalek kudo/nom: bd60603 | lizmat++ | src/core/Buf.pm:
Optimize Buf.push|append|unshift|prepend(int @a)

Suggested by sortiz++
21:19
lizmat jnthn: hmmm. I just noticed that the methods in Buf use a mix of .throw and fail :-( 21:21
21:21 itaipu left
lizmat jnthn: I guess fail would be more consistent, eh? 21:22
nine Meh...I'm gonna have to change how precomp ids are determined. This is becoming more involved than I would have liked.
21:25 sno left 21:28 sufrostico left 21:30 sftp left 21:32 _mg_ left 21:33 cdg_ joined, cdg_ left
jnthn lizmat: Yeah...I guess follow what we do for Array since we tend to have thought it out well there, as it's the most used of the classes :) 21:33
21:33 cdg_ joined 21:34 sftp joined
dalek kudo/nom: 0a35d4c | lizmat++ | src/core/Buf.pm:
Streamline failing in Buf
21:39
21:41 kaare_ left
[Coke] yapc-na; hackathon before or after? 21:50
21:52 sno joined
nine Once you start thinking about loading precomp files from multiple stores the current architecture doesn't fit at all anymore 21:55
21:59 kid51 joined
lizmat [Coke]: at this point, I could go either way :-) 22:01
jnthn nine: Yes, when I started thinking about that, I realized how tangled it becomes...
...which is why the "head of the chain precomps" design came up 22:02
22:02 rindolf left
jnthn What I didn't expect us to do was to end up with such a long chain :) 22:02
[Coke] lizmat: just looking at flights. look like I can book something today for saturday to saturday for not unreasonable amounts of dollars. 22:03
i'm sure there will be some hacking available during that window, if I can make that happen.
22:04 skids left
lizmat yes, then it will *definitely* happen :-) 22:04
jnthn: did you ever consider an nqp::slice op ?
for slicing elements out of nqp lists ?
lizmat is looking at implementing Buf.splice 22:05
creating the return value of Buf.splice is expensive :-(
jnthn nine: I still wonder if no modules in this repo = skip and let the next one use its precomp store could work
lizmat: Can't you use nqp::splice in some cunning way to do that?
22:06 musiKk left
lizmat looked at this, but nqp::slice returns the list on which it operates 22:06
*not* what is being removed
jnthn Ah 22:07
lizmat (or I must be getting too tired)
nine jnthn: now that you mention that, I wonder why I haven't tried implementing that. Skipping an empty repo sounds rather trivial and would get us a good part of the benefit. 22:08
lizmat anyways, having an nqp::slice could be generally beneficial for slicing into native arrays, no?
jnthn lizmat: No, I think you're right
lizmat: yes but...
lizmat: I've long pondered a more general nqp::memcpy style op
I think we might be able to fold it into that
lizmat ok, in that light, I'll fake it for now, we can plug it in at a later time 22:09
jnthn *nod*
It'd be useful for subbuf too
lizmat yup
jnthn But also for various NativeCall scenarios I suspect
lizmat yup 22:10
sortiz jnthn, That would make my NativeHelpers::Buff worthless! ;-) 22:11
jnthn
.oO( In one fell op... )
timotimo don't worry, it's just a little nerf
sortiz s/Buff/Blob/ 22:12
btw, some decision about my proposed :initial-elems for Blob.new() ? 22:15
lizmat jnthn sortiz : perhaps a 'new-with-size(...) method ? 22:16
timotimo hum, weren't blobs read-only? 22:17
lizmat eh, yeah, sorry, Buf.new I guess
timotimo right, but isn't it enough to my $b = Buf.new(); $b[1000] = 0; ?
m: my $b = Buf.new(); $b[10] = 0; say $b.perl
jnthn Yeah, but it's ugly :)
camelia rakudo-moar 0a35d4: OUTPUT«Buf.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤»
timotimo well, fair enough 22:18
jnthn But yeah, it's pretty much just as good functionally :)
Maybe Buf.allocate($items) is nicer
timotimo that sounds all right
jnthn Where $items is the number of items 22:19
timotimo could also do something like that for NativeCall's CArray
sortiz And that don't work for Blob, 'cus inmutable size.
jnthn I shoulda written $elems :)
22:19 yurivish joined
jnthn sortiz: Yeah, there's no point putting this method on Blob :) 22:19
timotimo isn't Blob also immutable content?
jnthn You can't mutate it :)
sortiz It's for preallocation only, the alternative Blob.new(0 xx 100) is slow... 22:20
jnthn I dislike Buf.allocate($elems) the least so far, anyways :)
timotimo what do you do with a Blob that's preallocated?
lizmat timotimo: an immutable buf with nulls ? 22:21
jnthn lizmat: Yes, so you'd use Buf, not Blob...
lizmat so .allocate on a Blob doesn't make sense
indee
d
sortiz Is inmutable in size, not in content.
timotimo really? i'm pretty sure that's a bug, then 22:22
lizmat Blob should be immutable in content as well, no ?
sortiz Sorry, you right
lizmat m: my $b = Blob.new(1,2,3); $b[2] = 42 # sortiz, how are you changing the blob ?
camelia rakudo-moar 0a35d4: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at /tmp/CDMn7Q3npb line 1␤␤»
timotimo well, you can mutate it using the low-level ops with "use nqp" ;) 22:23
sortiz And pass the reference to NC to fill it. 22:24
*can*
lizmat still, I think using a Buf would be more correct 22:25
22:25 vendethiel left
lizmat m: my $b = Buf.new(1,2,3); $b.push(Buf.new(4,5,6)) # hmmm... this should probably also work 22:25
camelia rakudo-moar 0a35d4: OUTPUT«This representation (VMArray) does not support attribute storage␤ in any at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤ in block <unit> at /tmp/LVq9TZwWey line 1␤␤»
sortiz lizmat, In the later case (NC) dunno, precisely because it is inmutable. 22:26
lizmat jnthn: what are your thoughts on a Blob being changed in NC ? 22:27
sortiz lizmat, yeah, that should work.
jnthn lizmat: DIHWIDT
I strongly suggest folks pass a Buf instead 22:28
m: Blob.new(1..10).say
camelia rakudo-moar 0a35d4: OUTPUT«Blob:0x<01 02 03 04 05 06 07 08 09 0a>␤»
jnthn m: Blob.new(1..10).subbuf(2, 5).say
camelia rakudo-moar 0a35d4: OUTPUT«Blob:0x<03 04 05 06 07>␤»
jnthn m: Blob.new(1..10).subbuf(2, 5).WHAT.say
camelia rakudo-moar 0a35d4: OUTPUT«(Blob)␤»
jnthn So, that I plan to implement later as taking a view into the original 22:29
And if you go mutating it you'll get action at a distance.
lizmat but not so for Buf, I would assume ?
indeed
jnthn Right
It's quite a notable optimization that we can do for Blob (and we do a similar thing for .substr under the hood in Moar) 22:30
lizmat yeah, for substr that would be brill
timotimo substr already has that
jnthn lizmat: It already does it for substr :)
sortiz Right now passing "Str is rw" to NC has valid user cases.
lizmat ah?
cool! 22:31
timotimo sortiz: right, but NC doesn't get the original underlying string
we don't want to leak out synthetic codepoints, ever
jnthn Also, `is rw` is talking about a Scalar pointing to a Str. The rw thing is the Scalar, not the Str.
lizmat jnthn: perhaps also for lists ?
jnthn lizmat: Perhaps, yeah
I mean, the functionality would support it 22:32
How we'd expose/use it API wise, I'm not sure
(The VM level functionality, I mean) 22:33
lizmat me neither atm, but I am pretty tired already :-)
jnthn Yeah, I've had two longer days than I should probably be having :)
(Now relaxing with a beer before sleep...and tomorrow should be an easy day :)) 22:34
sortiz jnthn, Before I forget, what are the plan about "my $foo is MyContainer"
jnthn sortiz: Works already, no?
Well...hm 22:35
I guess I only checked it for @/%
:)
And we case-analyze $ so it's not quite so easy there
22:35 sevvie joined
dalek kudo/nom: a02d44b | lizmat++ | src/core/Buf.pm:
Add Buf.splice(int @a) candidate

More to come...
22:35
jnthn sortiz: I suspect it'll be a case of writing a STORE/FETCH method anyway 22:36
May need a little low-level work
Also a *lot* of care to not infinitely recurse
(As it's quite easy to manage with a Proxy) 22:37
I think github.com/rakudo/rakudo/pull/688 isn't going to fly as a solution for the reason nine++ pointed out 22:39
But I did ponder another way
Which is to use subsignatures
sub MAIN(('subcommand', Str $arg, Int :$subcom-option), :$general-option) { ... } 22:40
Which probably would deal with that case
dalek kudo/nom: b801c3a | coke++ | docs/release_guide.pod:
use errata branch for testing, not original tag
jnthn Would need some mangling but might be a more promising direction to explore in. 22:41
timotimo i like the sound of that 22:42
it's also unlikely that someone would already have a signature like that in their MAIN so far
so we wouldn't break things
at least i think so 22:43
BBIAB
jnthn rest time 22:47
'night all o/
sortiz Thank you jnthn, relax
lizmat good night, jnthn 22:48
22:48 spider-mario left
jnthn Will do. Looking forward to digging into more Perl 6 things again soon. \o/ 22:48
o/
Skarsnik gah, I did not work on dbiish today
anyway, have a good night #perl6
sortiz lizmat, you also deserve it. 22:49
o/ Skarsnik.
lizmat gnight Skarsnik 22:50
Skarsnik and ++ for the optimision stuff I glimps on dalek msg x)
sortiz Skarsnik, I plan to work in dbiish tomorrow, btw. 22:51
22:53 yurivish left 22:58 haircode left, avar left, crux left, wtw left, literal left, jervo left, sjohnson left, matt_ left, kid51 left, FROGGS left, AlexDaniel left, vytas left, john51 left, rhr left, brabo left, erdic left, MilkmanDan left, yqt left, TEttinger left, inokenty left, ribasushi left, leedo left, dpk left, xiaomiao left, cognominal left, xnrand left, Roamer` left, Woodi left, ranguard left, Grauwolf left, au left, moritz left, rjbs left, mst left, broquaint left, [Coke] left, camelia left, eiro left, burnersk left, sevvie left, SCHAAP137 left, roguelazer left, wamba1 left, mithaldu_ left, peteretep left, jnthn left, alnewkirk left, xinming left, hobbs left, beatdown left, mrsolo left, ilmari left, polyfloyd left, andrewalker left, Praise left, kent\n left, petercommand left, edenc left, damnlie left, Khisanth left, [Tux] left, mspo left, dsp- left, jercos left, pochi left, pdcawley left, d^_^b left, Hotkeys left, gabiruh left, b2gills left, mohae left, PotatoGim left, lnrdo left, ugexe left, nebuchadnezzar left, simcop2387 left, mkz left, TeamBlast left, sftp left, _dolmen_ left, [particle] left, firstdayonthejob left, Guest72897 left, pmurias left, tmch left, DarthGandalf left, tharkun left, decent left, khw left, synopsebot6 left, dalek left, skarn left, caasih left, boegel left, hoelzro left, jnap left, flussence left, hacst left, renormalist left, aindilis left, cfedde left 22:59 Jarcode left, jsimonet1 left, autogen left, luis left, Juerd left, El_Che left, sivoais left, TimToady left, lostinfog left, TreyHarris left, araujo left, jeek left, dg left, shadowpaste left, keix left, jferrero left, nemo left, diakopter left, Bucciarati left, konobi left, sm0x left, masak left, dustinm` left, ilbot3 left, japhb left, kst left, agentzh left, psch left, mattp_ left, lestrrat left, felher left, awwaiid left, LGD left, Upasaka left, arnsholt left, captain-adequate left, sjn left, jevin left, zacts left, breinbaas left, Util left, bpmedley left, emdashcomma left, tadzik left, ingy left, jdv79 left, perigrin left, geraud left, cibs left, sno left, cdg_ left, prammer left, Skarsnik left, nowan left, cgfbee left, RabidGravy left, lustlife left, lucs left, bhm left, Sgeo left, Gothmog_ left, sunnavy left, musca left, llfourn left, apejens left, yeltzooo left, Amnez777 left, Grrrr left, cosimo left, mathw left, perlpilot left, krakan left, SHODAN left, tony-o left, sergot left, zhmylove left, cxreg left, kshannon left, jast left, profan left, raydiak_ left, autarch left, patrickz left, jameslenz left, atta left, salva left, noganex left, Celelibi left, huf left, gregf_ left, ggoebel16 left, adrusi left, n0xff left, gfldex left, Vitrifur left, lizmat left, cpage left, ambs left, rdleon left, tinita left, Timbus left, gypsydave5 left, BooK left, KotH left, jcallen left, MadcapJake left, pederindi left, nine left, olinkl left, mre left, Possum left, ruoso left, BuildTheRobots left, parisba left, clkao left, kipd left, Spot__ left, ggherdov left, chansen_ left, rodarmor left, dylanwh_ left, apathor left, Humbedooh left, retupmoca left, Lucas_One_ left, SmokeMachine____ left, rudi_s left, DrForr left, silug left, ab5tract left, maddingue left, Ulti left, skaji left, telex left, colomon left, raiph left, neilb left, gensym left, Cabanossi left 23:00 solarbunny left, ilbelkyr left, grondilu left, stmuk_ left, pnu left, khagan left, rvchangue left, sQuEE left, zostay left, nchambers left, richi235 left, pRiVi left, domm_ left, ponbiki left, charsbar__ left, rntz left, f3ew left, geekosaur left, integral left, mephinet left, notbenh left, frew left, drforr1 left, frederico left, lnx left, Rotwang left, k-man left, ashleydev left, Fleurety left, garu left, vike left, xxpor left, anshin left, [ptc] left, robinsmidsrod left, Peter_R left, avalenn left, jantore left, Amnez777 joined 23:03 MilkmanDan joined, brabo joined, rhr joined, erdic joined, vytas joined, AlexDaniel joined, FROGGS joined, kid51 joined, jervo joined, wtw joined, literal joined, crux joined, avar joined, profan joined, raydiak_ joined, perigrin joined, cibs joined, jast joined, jdv79 joined, kshannon joined, cxreg joined, ingy joined, zhmylove joined, sergot joined, tadzik joined, emdashcomma joined, bpmedley joined, tony-o joined, Util joined, breinbaas joined, SHODAN joined, jevin joined, krakan joined, sjn joined, captain-adequate joined, arnsholt joined, perlpilot joined, Upasaka joined, mathw joined, Grrrr joined, cosimo joined, LGD joined, yeltzooo joined, awwaiid joined, apejens joined, llfourn joined, felher joined, lestrrat joined, zacts joined, musca joined, sunnavy joined, mattp_ joined, psch joined, agentzh joined, kst joined, Gothmog_ joined, geraud joined, japhb joined, Sgeo joined, ilbot3 joined, dustinm` joined, bhm joined, masak joined, sm0x joined, diakopter joined, Bucciarati joined, konobi joined, nemo joined, jferrero joined, lucs joined, keix joined, shadowpaste joined, dg joined, jeek joined, lustlife joined, RabidGravy joined, araujo joined, cgfbee joined, nowan joined, Skarsnik joined, TreyHarris joined, lostinfog joined, prammer joined, TimToady joined, cdg_ joined, sno joined, telex joined, matt_ joined, haircode joined, sivoais joined, El_Che joined, Juerd joined, autogen joined, luis joined, jsimonet1 joined, Jarcode joined, cfedde joined, aindilis joined, renormalist joined, hacst joined, flussence joined, jnap joined, hoelzro joined, boegel joined, caasih joined, synopsebot6 joined, khw joined, tharkun joined, decent joined, DarthGandalf joined, tmch joined, pmurias joined, Guest72897 joined, firstdayonthejob joined, [particle] joined, _dolmen_ joined, dalek joined, avalenn joined, robinsmidsrod joined, [ptc] joined, Peter_R joined, daxim joined, timrs2991 joined, sjohnsen joined, BinGOs joined, timotimo joined, xxpor joined, anshin joined, vike joined, ashleydev joined, garu joined, k-man joined, Fleurety joined, frederico joined, lnx joined, Rotwang joined, drforr1 joined, frew joined, notbenh joined, mephinet joined, integral joined, geekosaur joined, burnersk joined, eiro joined, camelia joined, [Coke] joined, broquaint joined, moritz joined, rjbs joined, mst joined, au joined, Grauwolf joined, ranguard joined, Woodi joined, Roamer` joined, xnrand joined, cognominal joined, xiaomiao joined, leedo joined, dpk joined, inokenty joined, ribasushi joined, TEttinger joined, yqt joined, sjohnson joined, TeamBlast joined, mkz joined, simcop2387 joined, nebuchadnezzar joined, ugexe joined, lnrdo joined, mohae joined, b2gills joined, gabiruh joined, Hotkeys joined, d^_^b joined, pdcawley joined, dsp- joined, jercos joined, pochi joined, mspo joined, [Tux] joined, Khisanth joined, damnlie joined, edenc joined, petercommand joined, kent\n joined, Praise joined, cameron.freenode.net sets mode: +v camelia, andrewalker joined, polyfloyd joined, ilmari joined, mrsolo joined, beatdown joined, hobbs joined, xinming joined, jnthn joined, alnewkirk joined, peteretep joined, mithaldu_ joined, wamba1 joined, roguelazer joined, SCHAAP137 joined, baest joined, mindos joined, skaji joined, Ulti joined, maddingue joined, ab5tract joined, silug joined, rudi_s joined, SmokeMachine____ joined, Lucas_One_ joined, apathor joined, Humbedooh joined, retupmoca joined, dylanwh_ joined, rodarmor joined, chansen_ joined, Spot__ joined, kipd joined, clkao joined, parisba joined, DrForr joined 23:04 Amnez777 left, huf_ joined, jantore joined, solarbunny joined, grondilu joined, stmuk_ joined, pnu joined, rntz joined, khagan joined, rvchangue joined, sQuEE joined, zostay joined, richi235 joined, pRiVi joined, domm_ joined, ponbiki joined, charsbar__ joined, f3ew joined, hahainternet joined, sevvie joined, john51 joined, colomon joined, raiph joined, neilb joined, gensym joined, yoleaux joined, cameron.freenode.net sets mode: +v yoleaux 23:05 KotH_ joined, n0xff_ joined, gypsydav15 joined, john51 left, ruoso_ joined, BooK_ joined, tinita_ joined, caasih left, gfldex_ joined, jnap left, Amnez777 joined
dalek kudo/nom: 64e1c72 | lizmat++ | src/core/Buf.pm:
Buf:D candidates for Buf.splice|push|unshift etc.
23:05
23:06 salv0 joined, FROGGS left, autarch joined, patrickz joined, jameslenz joined, n0xff joined, atta joined, salva joined, noganex joined, huf joined, gregf_ joined, ggoebel16 joined, adrusi joined, gfldex joined, Vitrifur joined, lizmat joined, cpage joined, ambs joined, rdleon joined, tinita joined, Timbus joined, gypsydave5 joined, BooK joined, KotH joined, jcallen joined, MadcapJake joined, pederindi joined, nine joined, mre joined, Possum joined, ruoso joined, ChanServ sets mode: +v dalek, Timbus_ joined, sftp joined, nchambers joined, sjohnson left, firstdayonthejob left 23:07 jcallen left, gregf_ left, huf left, n0xff left, tinita left, gypsydave5 left, BooK left, KotH left, ruoso left, gfldex left, mre left, WAADLHR joined, salva left, Timbus left
lizmat hmmm... dalek is taking a long time to see my push 23:07
23:07 lizmat left, Cabanossi joined, lizmat_ joined, ilbelkyr joined, jcallen joined, john51 joined, Celelibi joined, skarn joined
lizmat_ yup, something amiss in the mean hook delivery time on status.github.com 23:08
geekosaur [23 23:05] <dalek> rakudo/nom: 64e1c72 | lizmat++ | src/core/Buf.pm:
23:08 lizmat_ is now known as lizmat
geekosaur not that one? 23:08
lizmat ah, *i* did not see that, but I see it in the backlog
geekosaur weird effects from the rehubbing or whatever
lizmat guess I was on the wrong end of a netsplit
23:09 mre joined
geekosaur everyone was for a bit, they rebooted some network device and netsplit *everyone* 23:09
lizmat ah, ok :-)
anyways, enough from me today
good night, #perl6!
23:09 vendethiel joined 23:10 Skarsnik left
sortiz 'night lizmat 23:10
Thanks for the patience 23:11
23:11 sjohnson joined
timotimo gnite lizmat and jnthn 23:12
23:13 sjohnson left 23:15 sjohnson joined 23:16 zpmorgan joined, ggherdov joined 23:17 BuildTheRobots joined, KotH_ left, KotH joined 23:18 ggherdov left, ggherdov joined, BuildTheRobots left, BuildTheRobots joined 23:22 _dolmen_ left 23:25 PotatoGim joined 23:26 jnap joined 23:28 olinkl joined 23:30 vendethiel left 23:33 eiro_ joined 23:34 eiro_ left 23:37 john51_ joined 23:39 skids joined 23:40 caasih joined 23:41 john51 left
stmuk_ "Professors like Lisp because they think they can write code like mathematics, which they can't." --@ErrataRob at #polarvortexconelniño 23:42
23:50 lostinfog left 23:58 patrickz left