»ö« 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.
skink What the... 00:06
Apparently I wrote an Argon2 module like five months ago
And just completely forgot about it 00:07
teatime lol
timotimo ZoffixLappy: once to see if things match, another time to get a precise error diagnostic out of the thing 00:15
ZoffixLappy: have you ever tried a say or note inside a Proxy's FETCH method?
ZoffixLappy No
timotimo, but why doesn't that happen during my Subset $x; ? 00:16
timotimo you should. it's an enlightening experience
because it happens every time we do an istype
we consider "istype" to be an extremely cheap operation
ZoffixLappy Is there some sane way to detect which... type... of call is done, just so I could print my message only once? 00:17
timotimo check the backtrace, or have a state variable
or use a once block
ZoffixLappy state and once won't work, since the subset can be used many times. 00:18
ZoffixLappy tries the backtrace
timotimo hm.
ZoffixLappy Not sure how to "check the backtrace". Will leave this for now. 00:21
Actually, state can work: set it on first message, unset it on second message, 00:22
dalek osystem: 9e4b84f | (Zoffix Znet)++ | META.list:
Add Subset::Helper

Easily create subsets that sanely work with optional parameters and provide awesome error messages: github.com/zoffixznet/perl6-Subset-Helper
00:31
ZoffixLappy m: my $s = 0; my $v := Proxy.new( FETCH => method () { note "Meow"}, STORE => method () {} ); say $v 00:35
camelia rakudo-moar 4b0e5b: OUTPUT«Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤True␤»
ZoffixLappy :o
timotimo, I wasn't expecting this lol :)
This morning I was going to make a Proxy-based LWP::Simple lol. Glad I didn't waste my time. 00:36
timotimo i told you
ZoffixLappy Why does it fetch it so many times?
timotimo every time "decont" is called on it, it fetches
ZoffixLappy Ah
timotimo you could dump a backtrace every time fetch happens 00:37
that ought to be interesting
but decont, like istype, is expected to be trivial in cost; it's usually a pointer dereference or two 00:38
well, it's a c function invocation via the REPR
ZoffixLappy How do you dump a backtrace? I don't have an exception to call it on. 00:39
timotimo m: say callframe(0)
camelia rakudo-moar 4b0e5b: OUTPUT«/tmp/TNLLkCl38B at line 1␤»
timotimo you can just try { die "oh"; CATCH { ... } }
well, with a default clause, ideally
ZoffixLappy That's not too interesting :) gist.github.com/zoffixznet/617a627...2bbce88344 00:40
timotimo well, only callframe(0) won't be interesting 00:43
oh
you'll want --ll-exception
ZoffixLappy Same output 00:44
timotimo hum. so it is.
ah! 00:45
there's .full on the backtrace object
not too much variance
00:47 kid51 joined
timotimo leont: i trust you ran the patch in your pull request through spec tests? 00:47
timotimo also runs spectests to verify 00:48
though i suppose it can hardly impact other spec tests, really 00:49
leont I cheated a little and only ran t/spec/S17-procasync/
ZoffixLappy :)
ZoffixLappy learned two days ago an "unrelated" change can affect other tests :)
(this one github.com/rakudo/rakudo/pull/743#...-210489723 ) That I originally ignored entirely :P 00:50
timotimo heh 00:51
leont I immediately moved on to rebasing my tap harness PR, but now I need to sleep first
timotimo have a good rest!
and thanks for your continued involvement in Tap6 and stuff! 00:52
ZoffixLappy leont++ 00:53
00:56 mr-foobar left, sue joined 00:57 kurahaupo joined 00:58 mr-foobar joined 01:00 Sgeo joined
ZoffixLappy Type panda install Test::Output .... go on a Social Media excursion while the module installs... Come back... Realize you forgot to press ENTER 😂😂 01:02
01:02 kurahaupo left 01:04 leont left 01:09 boegel left 01:13 mr-foobar left
timotimo i went ahead and merged it, leedo_ 01:14
sorry, meant leont
but they left the channel
01:16 mr-foobar joined
skink > $encoded.decode 01:18
$argon2i$v=19$m=65536,t=2,p=1$D6dL87cRUdNBUkW0RlV+bA$wsbEjnb0zmWmxmbPNE1ZxavQfuIbo37mhThG/tfEnrw
Oh
So... that works.
01:27 kurahaupo joined 01:30 yurivish left
skink sortiz, Got a question you'd probably have an opinion for 01:32
01:32 kurahaupo_ joined
skink Default to returning Str for a password hash, or give the encoded Buf which you'd .decode for the Str 01:32
?
01:33 kurahaupo left 01:37 kurahaupo joined 01:38 kurahaupo_ left 01:45 Ben_Goldberg joined, jnap_ left, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
skink What the... 01:55
sortiz, I just ran into something that apparently you reported as a bug already :D
>Bytecode validation error at offset...
01:56 ZoffixLappy left
skink > my $hash = argon2-hash("password").decode; 01:59
$argon2i$v=19$m=65536,t=2,p=1$PmrqP5tZRGRWc4SiS9mvPA$0R9KvVCjntFHcWJNCYdrWg
> argon2-verify($hash, "password")
True
woo 02:00
02:03 kurahaupo left 02:07 chansen_ left 02:09 chansen_ joined 02:15 telex left 02:16 telex joined 02:17 djbkd left 02:27 adhoc left 02:31 jnap_ joined 02:37 araujo__ joined 02:38 noganex joined, araujo_ left, kid51 left 02:41 noganex_ left
sortiz skink, For the password question: as the password is all ascii, returning a Str is ok. 02:56
s/password/hash/ 02:57
03:10 kipd joined 03:12 p6_nb joined, p6_nb left 03:16 Peter_R left 03:17 clkao joined, araujo__ left 03:21 Peter_R joined 03:23 kaare_ joined 03:29 Herby_ joined
Herby_ Evening, everyone! 03:29
o/ 03:30
03:33 Herby_ left, Herby_ joined 03:34 hankache joined
hankache m: my @a = (1,2,3); my @b = (4,5,6); say @a == @b; 03:35
camelia rakudo-moar c4f04d: OUTPUT«True␤»
hankache :(
was this always the case ? 03:36
sortiz hankache, you are comparing the number of elements. 03:40
\o Herby_ 03:42
hankache sortiz yeah i just remarked, i thought it compared the also the elements inside.
so what would you use to compare the elements? eq eqv or something else?
sortiz Yep, eqv 03:43
hankache thanks
sortiz Or ~~
Smart match is, well, "smart" :-) 03:44
hankache indeed :)
sortiz m: say (1,2,3) eqv (1..3), (1.2.3) ~~ (1..3) # for example 03:51
camelia rakudo-moar c4f04d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pzwoxVq1X7␤Malformed postfix call␤at /tmp/pzwoxVq1X7:1␤------> 3say (1,2,3) eqv (1..3), (1.2.7⏏053) ~~ (1..3) # for example␤»
sortiz m: say (1,2,3) eqv (1..3), (1.2,3) ~~ (1..3) # for example 03:52
camelia rakudo-moar c4f04d: OUTPUT«FalseTrue␤»
hankache aha 03:53
~~ is "smarter" than eqv
sortiz Yep, 'cus "inside" (1..3) you have a Range. 03:55
hankache sortiz: github.com/hankache/perl6intro/pull/37 03:56
sjn m: say (1..3).Bag eqv (1,3,2).Bag
camelia rakudo-moar c4f04d: OUTPUT«True␤»
hankache hello sjn 03:57
sjn \o
skink Is there an efficient way to trim null bytes off an allocated buffer? 03:58
sortiz skink, if the null bytes are at the end, and you know its start position, a subbuf is ideal. 04:01
It is a common case in NC, when you give an allocated Buf to a function returning something with a max size, and the function returns the size used. 04:03
04:04 kurahaupo joined
skink Well, actually I'm not sure if that's a problem 04:06
m: say Blob.new(65, 66, 67, 68).decode
camelia rakudo-moar c4f04d: OUTPUT«ABCD␤»
skink m: say Blob.new(65, 66, 67, 68, 0, 0).decode
camelia rakudo-moar c4f04d: OUTPUT«ABCD␀␀␤»
skink Okay, maybe that is part of the problem 04:07
sortiz, The Argon2 lib has encodedlen() to determine the size of the char array you need to allocate
But it seems it gives too large a result
04:08 skids joined
skink hey skids 04:08
04:08 kurahaupo left
skids o/ 04:08
skink I'm using the same defaults as the Python module, and can verify hashes created with that module, but that module cannot verify my outputs 04:09
Mine are 3char too long
sortiz m: Blob.new(65, 66, 67, 68, 0, 0).subbuf(0,4).say
camelia rakudo-moar c4f04d: OUTPUT«Blob:0x<41 42 43 44>␤»
skink 4, actually
sortiz, It's variable how many extra bytes it gives, though, depending on your settings 04:10
So I would have to scan for the position of the first null byte or something
But also, having the null bytes isn't adding extra chars 04:11
I'm not sure what's causing that
Oh!
I'm dumb.
My Python module is an old version which doesn't support the new API 04:13
04:13 Cabanossi left
skink That support was only added last week 04:13
04:15 Cabanossi joined 04:17 sue left 04:30 hankache left
sortiz good night o/ 04:32
04:33 sortiz left
Herby_ ZoffinWin: trying out your Twitter module 04:36
having some issues (probably self-induced)
skink ZoffixWin, Submitted PR to add Crypt::Argon2. Already has travis set up and passing :) 04:39
04:49 Ben_Goldberg joined 04:50 BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 04:55 kurahaupo joined, geekosaur left 04:58 CIAvash joined, djbkd joined 04:59 khw left 05:02 geekosaur joined 05:03 djbkd left 05:05 skink left 05:09 molaf joined
dalek ar: c36ceae | (Naoum Hankache)++ | docs/perl6intro.pdf:
Update docs/perl6intro.pdf
05:11
ar: 6d24982 | (Steve Mynott)++ | docs/perl6intro.pdf:
Merge pull request #69 from hankache/master

Update docs/perl6intro.pdf
05:13 mane joined
Herby_ anyone still awake? 05:52
messing around with this example: github.com/sergot/http-useragent/b...crawler.p6
skids barely
Herby_ getting an error: Method 'for' not found for invocant of class 'List' 05:53
its specifically the: sub get-urls function that is throwing the error 05:54
AlexDaniel hm, what's the perl 5 equivalent for perl 6 Supply?
Herby_ AlexDaniel: o/
AlexDaniel o/
Herby_: what did you mean by this “for”? 05:55
Herby_: oh, you meant .map ? 05:56
geekosaur github.com/sergot/http-useragent/b...ler.p6#L39
skids Herby: I bet that's suposed to be .map not .for
AlexDaniel m: say (2,3,4).for({$_ × 2}) 05:57
camelia rakudo-moar c4f04d: OUTPUT«Method 'for' not found for invocant of class 'List'␤ in block <unit> at /tmp/Ez61aR1shJ line 1␤␤»
AlexDaniel m: say (2,3,4).map({$_ × 2})
camelia rakudo-moar c4f04d: OUTPUT«(4 6 8)␤»
Herby_ trying to play around with HTTP::UserAgent and copied that example, got that error
let me try map
AlexDaniel is it an old thing or just a typo?
Herby_ it works now. thats why they pay you guys the big bucks :)
AlexDaniel is not getting paid
geekosaur nov 2015 according to github... 05:58
skids Assuming it was ever tested :-)
AlexDaniel Herby_: also note that you can still use for, just not as a method
geekosaur I have a vague recollection that .for was an alias that got removed at some point
AlexDaniel m: say ($_ × 2 for (2,3,4))
camelia rakudo-moar c4f04d: OUTPUT«(4 6 8)␤»
AlexDaniel geekosaur: ok, then I'm not hallucinating 05:59
Herby_ AlexDaniel: i'll poke around at it, thanks
AlexDaniel it's interesting that nobody wrote an awesome error message for this case 06:00
“use .map instead!”
I also remember several cases when people did not know about map and were trying to do it with .for
ok not several but maybe two 06:01
geekosaur I'd have to dig in the repo, but if it was there and removed then it may have been long enough ago that it went through a period with such a deprecation message before complete removal
also I think all of those were yanked before 6.c release
AlexDaniel oooooooh
geekosaur because deprecations during prerelease were not considered relevant for the first actual release 06:02
AlexDaniel yeah, that totally makes sense
still, if I stumble upon a newcomer who is trying to use “for” instead of “map” (without knowing that it ever existed) again I'll file a ticket 06:03
Herby_ the other newcomers will probably know better :) 06:07
AlexDaniel still, I'd love to know how to have “Supply” in perl 5…
I'd ask that in #perl5 but I'm afraid that they will execute me if I phrase my question this way 06:08
although maybe they are more friendly than I expect
06:11 kurahaupo left 06:14 djbkd joined 06:20 aries_liuxueyang left 06:21 aries_liuxueyang joined 06:28 BenGoldberg left 06:30 skids left
llfourn AlexDaniel: have you seen metacpan.org/pod/Mojo::EventEmitter ? 06:34
AlexDaniel llfourn: nope!
llfourn it does the job pretty well :)
obviously you need to combine it with the IO::Loop for it to be useful 06:35
AlexDaniel hmm 06:36
06:40 xiaomiao left 06:46 xiaomiao joined 06:47 cpage__ joined 06:48 AlexDani` joined 06:49 Cabanossi left, clkao left 06:50 jameslen_ joined, jameslenz left, kipd left, AlexDaniel left, cpage left, cpage__ is now known as cpage 06:52 Xliff joined 06:53 Cabanossi joined
Xliff 'lo 06:54
06:54 kipd joined 06:57 clkao joined 07:01 dolmen joined 07:03 rindolf joined 07:05 AlexDani` is now known as AlexDaniel
Xliff \o AlexDaniel 07:07
AlexDaniel \o/
Xliff What are you up to, this fine Sunday? 07:08
AlexDaniel programming like crazy for my thesis, haven't slept yet :) So in my mind it is not Sunday yet 07:09
Xliff knows that feeling.
Don't wear yourself out, too much. And good luck!
AlexDaniel thanks 07:10
07:18 dwarring left 07:39 dolmen left
nine AlexDaniel: Perl 5 people are usually way more friendly than you seem to expect :) 07:45
Xliff tries to grok out to get Pointer[Pointer[Pointer[num32]]] into something usable. 07:46
07:47 Xliff_ joined, Herby__ joined, djbkd_ joined 07:48 notostraca joined 07:49 avenj_ joined 07:51 jeek_ joined 07:54 Spot___ joined, rafl_ joined, avalenn_ joined 07:56 MadcapJake_ joined, Herby__ left, Xliff left, djbkd left, Herby_ left, TEttinger left, jeek left, rafl left, b2gills left, infina left, Spot__ left, MadcapJake left, avenj left, tadzik left, avalenn left, chee left, Guest23064 left, eiro left, gabiruh left, rafl_ is now known as rafl 07:57 b2gills joined, MadcapJake_ is now known as MadcapJake 07:58 chee joined, Spot___ is now known as Spot__, M-tadzik joined
AlexDaniel llfourn: I ended up using a shared array of Thread::Queue's 07:59
07:59 gabiruh joined 08:02 noganex_ joined 08:03 djbkd joined 08:04 astj joined 08:05 jameslenz joined, uruwi joined 08:06 kshannon_ joined, Some-body_ joined, richi235 joined, masak_ joined 08:07 ilbelkyr joined, jdv79_ joined, lucs_ joined, perlpilot joined, jferrero_ joined, jantore_ joined, Praise- joined, Praise- left, Praise- joined 08:08 gtodd1 joined, nine_ joined, shmibs_ joined, kmwallio_ joined, pochi_ joined 08:09 kaare__ joined, M-tadzik left 08:10 Upasaka_ joined, Celelibi left, Celelibi_ joined 08:11 edenc_ joined, avalenn joined 08:12 b2gills left, avalenn_ left, jeek_ left, avenj_ left, djbkd_ left, jameslen_ left, AlexDaniel left, kaare_ left, noganex left, M-matthew left, uruwi_ left, nine left, autarch left, raydiak_ left, Woodi left, mls left, gtodd left, aindilis left, jamesneko left, orbus_ left, m0ltar left, ribasushi left, nightfrog left, zostay_ left, Praise left, lucs left, Util left, PerlJam left, jferrero left, shmibs left, ilbelkyr_ left, charsbar_____ left, richi238 left, jdv79 left, agentzh left, jolts left, Some-body_ is now known as DarthGandalf, firstdayonthejob joined, kmwallio_ is now known as kmwallio 08:13 Celelibi_ left, M-matthew joined, cgfbee left, M-matthew left, M-matthew joined, Celelibi joined, xnrand left 08:14 ribasushi joined, Woodi joined, mls joined, Peter_R left, m0ltar joined, domm_ joined, cgfbee joined, aindilis joined 08:15 mephinet left, Spot__ left 08:16 darutoko joined 08:17 shmibs_ is now known as shmibs 08:18 sivoais joined, sivoais left, sivoais joined, orbus_ joined, xnrand joined, mephinet joined 08:19 raydiak_ joined 08:20 charsbar_____ joined, Util joined, b2gills joined, jamesneko joined 08:21 zostay joined, matt_ joined, nightfrog joined, matt_ is now known as Guest55473 08:24 autarch joined 08:25 M-tadzik joined, masak_ is now known as masak 08:26 masak is now known as Guest90489, Guest90489 is now known as masak_grrr, Peter_R joined
masak_grrr alright. 08:26
I'd like to solve this SSE thing. I think it might be easier to solve it on the side, not in my existing webapp. 08:27
so here's my set of requirements: one route `a/` and one route `b/`, both of which respond to a GET request.
08:27 jeek joined
masak_grrr then one route `events/` which streams back server-side events, specifically `a` and `b` respectively whenever someone hits those other two routes. 08:28
that's all.
open questions as I go into this:
(a) can I already do this in Bailador proper? (probably not) 08:29
(b) if I get this to work, which levels do I have to hack? (probably HTTP::Easy or something)
(c) could I publish the eventual solution as an extension module to Bailador? (or will that not even be necessary?)
(d) can I expose my SSE response as a Channel? (I really, really hope so) 08:30
Xliff_ masak: Sorry, bud. I have yet to grok Bailador. 08:31
masak_grrr 's ok
I'm brain-dumping just in case *someone* has some prior art somewhere
08:31 Spot__ joined
masak_grrr actually, the most likely place to find prior art is probably CPAN 08:31
but I don't know if I'll be lucky enough to stumble over it 08:32
Xliff_ Moar NativeCall fun: What's the best way to get Pointer[Pointer[Pointer[num32]]] into something useful?
masak_grrr hits the Dancer docs
Xliff_ my @outer_ap = nativecast(CArray[CArray[num32]], $pcm.deref); 08:33
my @chan_a = nativecast(CArray[num32], @outer_ap[i]);
^^ First attempt
08:35 notostraca is now known as TEttinger
masak_grrr Xliff_: I'm sorry -- I'm not at all 'versed in NativeCall. 08:35
Xliff_ LOL!
No worries.
masak_grrr wow, Dancer is pretty cool. 08:36
08:37 djbkd left
masak_grrr finds no prior art re Dancer + Server-Sent Events 08:38
Xliff_ Server-Side or Server-Sent? Or is the difference smaller than a hair?
masak_grrr I just stopped saying the (wrong) "Server-Side", and hoped no-one would notice... :P 08:40
Xliff_ =)
masak_grrr ok, wow, so I'm on my own, and breaking ground both in Perl 6 and Perl 5
well, let's first get this working in isolation
mojolicious, however: mojolicious.org/perldoc/Mojolicious...eb-service 08:41
of course this works in mojolicious ;)
Xliff_ LOL 08:43
I just too a deeper look into Mojolicious, today.
08:43 jdv79_ is now known as jdv79
Xliff_ Previously I had only explored Mojo::DOM 08:43
Strong stuff!
masak_grrr yeah
Xliff_ masak: lists.preshweb.co.uk/pipermail/danc...02974.html 08:45
This one looks generic SSE 08:48
www.perlmonks.org/?node_id=1140968
masak_grrr no-one replied to that email, back in 2013 08:49
Xliff_ Yeah. Just noticed.
I pasted that more for the code segment in the email.
masak_grrr *nod*
I'm in a little bit over my head here
Xliff_ Aaaaand. THAT's all the relevant looking results I was able to pull.
masak_grrr, you sound like me and NativeCall! LOL! O_O 08:50
masak_grrr but I think github.com/ufobat/Bailador/blob/b1...#L144-L148 in Bailador is a show-stopper
because it presupposes a synchronously computed response content
which is exactly what I won't have ;)
Xliff_ oooo
masak_grrr so, either (a) patch Bailador, or (b) work around Bailador 08:52
seems to me (b) might be easier in the short run
Xliff_ new module contents: use Bailador; class Bailador::AsyncRoute is Bailador { # override dispatch here } 08:54
Maybe ?
08:55 pierrot left
masak_grrr yeah, something like that 08:57
may not go with class inheritance, because it is a little too Highlander-ish ;)
good or bad style: `my @params = $match.list if $match;`
I could write the above as `my @params = $match ?? $match.list !! ();`, but I realized I could just use the if there to do the *assignment* conditionally 08:58
Xliff_ :) 08:59
masak_grrr it's basically turning the assignment into a thunk
(I'm replacing the `if` statement I linked to above in a pull request) 09:00
09:01 xinming left 09:02 wamba joined
masak_grrr ufobat: github.com/ufobat/Bailador/pull/62 :) 09:05
09:05 agentzh joined, jolts joined
Xliff_ masak_grrr, I thought you didn't want to refer to $app.response.content? 09:08
Or are you golfing 2 lines, there? :) 09:09
Xliff_ used "golf" as a verb.
Xliff_ slaps himself silly.
masak_grrr just a stylistic PR, not fixing my actual problem 09:11
I'm nowhere near an action plan yet, except "might skip the Bailador level on the first go"
nine_ masak_grrr: maybe you want to work with Crust instead of Bailador? 09:17
09:17 jervo joined, literal joined 09:18 avar joined
masak_grrr nine_: maybeee...? 09:18
09:18 wtw joined
masak_grrr nine_: I have a Bailador app already up and running on heroku, though. so it'd take some convincing for me to switch. 09:19
nine_ I guess combining them is not possible yet which is a shame. 09:20
masak_grrr it wouldn't be a very big conversion. I have a small app. 09:21
but how would it help me with SSE?
nine_ I don't know :) I haven't seen much of either Bailador or Crust. Just figured, since Bailador is very high level and doesn't support your use case and Crust is much more low level, the latter might be easier to coerce into supporting you. 09:22
masak_grrr *nod* 09:23
09:23 xinming joined
masak_grrr judging by the eg/ directory, Crust also doesn't support SSE 09:30
I'm sorry to say that it's not clear to me from the Crust README, test, and eg/ directory how to get started with Crust. 09:31
I can see that .p6sgi files play a role, but not how to run them in my application 09:33
09:36 aindilis left
nine_ masak_grrr: you run it with bin/crustup 09:36
masak_grrr ok... 09:45
I'd like to point out that that is *not* in the README
m: class D { method foo { say "OH HAI" }; method dispose { say "...and that is that!" } }; { my $d will leave { .dispose } = D.new; $d.foo; die "augh" }; CATCH { default { say .message } }
camelia rakudo-moar c4f04d: OUTPUT«OH HAI␤augh␤...and that is that!␤»
masak_grrr man, that is so cool.
I posit that 95% of the time when people want DESTROY, what they *actually* want is the above 09:46
we would do well to put something like the above code in a FAQ somewhere, to short-circuit the anguish for those people
09:48 infina joined, eiro joined, infina left, infina joined 09:50 spider-mario joined
masak_grrr this is my first use of `will leave` in production. yay! 09:50
09:53 masak_grrr is now known as masak 09:56 mane left 10:00 keix left 10:01 avenj_ joined 10:03 keix joined 10:16 azawawi joined
azawawi hi 10:16
10:16 TEttinger left
azawawi so how does one close an RT perl6 bug via email? :) 10:16
10:22 jack_rabbit left
spider-mario yeah, tbh I find our current bug tracker quite horrible 10:24
it feels like 1997
10:28 araujo joined
masak RT is not perfect, to be sure 10:28
but we're quite invested in it -- lots and lots and lots of information-rich tickets -- and I don't like "feels like 1997" as a reason to switch 10:29
10:30 RabidGravy joined
masak what teams usually do when they switch (whether to Github issues or something else) is declare ticket bankrupcy. I think that would be a shame, and a high price to pay 10:30
vendethiel well, "makes people not want to participate in it because it's so hard to access, search etc" is a good reason
masak yes, that's a better one
vendethiel declaring ticket bankrupcy would be insane, though :).
masak though it *is* very easy to send an email to [email@hidden.address]
the ease of this is a big part of why I've submitted so many
I kinda like RT a little :) I seem to be in a minority, though 10:31
vendethiel and the reason why the UX is so horrible is probably because it's from 1997. But I know I try to avoid RT at all costs just because I can't comprehend it. Why do I get permission refused trying to see the ticket list? How do I filter by this or that? How to search by "tags" or whatever-else
masak yeah. 10:32
again, it's not perfect and I'm not defending RT for its technical shortcomings
but I'm getting a lot of value out of it, personally
one does get into a sort of symbiosis with the tech one uses
azawawi masak: so how does one close an RT perl6 bug via email? :) # backtracking 10:33
masak azawawi: one doesn't. one closes a ticket via the web interface. 10:34
azawawi: email is only for creating the ticket.
azawawi masak: i see
masak (this is just my answer, not an "official" answer. maybe there is a way to close a ticket via email that I don't know about.)
spider-mario well, I can’t seem to reply to anything from the web interface, for example 10:35
(also, what on earth is the difference between “respond” and “comment”?) 10:36
azawawi can someone please close rt.perl.org/Public/Bug/Display.html?id=127883 ? :)
azawawi starts reading raw.githubusercontent.com/perl6/do...tshell.pod
spider-mario another issue I have with only being able to report bugs via e-mail is that of privacy 10:41
10:41 firstdayonthejob left
spider-mario I must make sure that the From: field is properly configured in my e-mail client and that the smtp server won’t change it back 10:41
so, I don’t know how other people feel about RT, but to me, the barrier to interaction simply feels too high to bother 10:42
(especially if, for some reason, I can’t even reply to existing bugs) 10:43
azawawi or close them lol 10:44
it feels like 1990 to be exact :) 10:45
10:46 firstdayonthejob joined
spider-mario yeah :) 10:46
if I click a “Respond” link, all I get is: i.imgur.com/ol4Sr2L.png
that’s it 10:47
azawawi spider-mario: The thing i hate the most about RT is the concept of anonymous user and the ancient login bitcard system. It feels a lot out of age. 10:48
RabidGravy well that's weird, but on each entry on a ticket there is a 'Reply' and 'Comment' in the right top corner, both provide a form me
azawawi RabidGravy: boom :) 10:49
masak spider-mario: I've had the response a couple of times lately too.
10:49 gdo joined
masak spider-mario: I suspect it means you're not logged in. 10:49
spider-mario ah.
that’s not very clear
masak (but yeah, as an error message, it sucks)
azawawi masak: and the cross-site forgery warning. isnt that scary? :) 10:50
masak haven't seen that.
azawawi well i have after submitting a perlbug
masak my stance is, sure, we can leave RT behind. I won't stand in the way. but I want us to have a very deliberate plan about what to move to, and how.
azawawi: via the web interface? 10:51
azawawi masak: yup
masak azawawi: ah, that's why. I always do email.
RabidGravy it seems that the moaning about RT comes up at least once a week, but other than the almost certain non-starter of "use github issues" no-one has actually provided a concrete and doable alternative
10:51 rvchangue joined
masak I like Github's issue system, and that would certainly lower the barrier for many people. but I'm not 100% sure Github's issue system will be a satisfactory replacement for RT. 10:52
azawawi masak: pasteboard.co/fFR2Q8t.png # scary
RabidGravy yeah that's why I describe it as a non-starter
masak another component of this, of course, is that RT is written in Perl. as much as we're complaining about it, as long as we're using it, we're dogfooding.
azawawi: agreed; scary. 10:53
azawawi: also, "Referrer" should be spelled "Referer"
(it's "Referrer" in *English*, but "Referer" in HTTP)
masak really hopes that's not the reason it doesn't find the header :P 10:54
RabidGravy of course if half the people complaining were to make a replacement issue tracking system in Perl 6 , arrange to have it hosted somewhere and migrate all the existing tickets, it would become someone elses problem 10:55
10:56 Ven joined, Ven left
psch afair respond and comment differ by notifying the original submitter or not 10:57
azawawi RabidGravy: If you build it, they will come? :)
10:57 pmurias joined
psch although that's just preselected checkboxes that can be un-/checked anyway 10:57
pmurias masak: using a Perl 5 request tracker isn't really dogfooding Perl 6 10:58
re moving to github issues would it even be possible (someone mentions we couldn't assign ticket ownership properly on github when migrating them) 11:00
azawawi what's the status of the Perl 6 on JVM? Is it passing `make spectest`?
psch azawawi: not at all
although it does look a lot better than i thought... 11:02
well, unless i'm misreading [Coke]++'s summary github.com/coke/perl6-roast-data/b...ummary.out
arnsholt masak: I think "referrer" vs. "referer" might be a British English vs. American English thing
11:04 gdo left
RabidGravy I think it's just a mis-spelling on the part of the original auther of the spec that didn't get noticed until it was too late 11:04
11:04 leont joined 11:05 gdo joined 11:06 gdo left
arnsholt Or that. Being a non-native, I'm more or less incapable of keeping track of americanisms vs. britishisms 11:07
dalek c/rb-nutshell: 27a2f72 | azawawi++ | doc/Language/rb-nutshell.pod:
Fix typos and Improve documentation
11:08
azawawi RabidGravy: 81 days github contribution streak so far :) 11:09
timotimo cool :) 11:10
masak arnsholt: it's a misspelling which became spec, not a BrE/AmE distinction. 11:11
you're right that there are BrE/AmE distinctions like that, like "canceled"/"cancelled" 11:12
11:12 jnthn left 11:13 khagan left, nowan left, khagan joined
spider-mario wow, I had no idea about that one 11:13
11:13 M-tadzik left, nebuchadnezzar left, gypsydave5 left, azawawi left 11:14 stux|RC-only left, apejens_ left, nebuchadnezzar joined, nowan joined 11:15 gypsydave5 joined, Xliff__ joined 11:17 ocbtec joined 11:18 Xliff_ left 11:19 stux|RC-only joined, Vitrifur left, Timbus left, jnthn joined, Timbus joined, kid51 joined, M-tadzik joined 11:20 emdashcomma left, ingy left 11:21 ingy joined, Vitrifur joined
pmurias masak: backlogged and read the ticket bankrupy part, that seems kind of a high price 11:21
11:23 emdashcomma joined, tinita joined 11:40 apejens joined 12:18 kid51 left 12:23 CIAvash left 12:35 Emeric joined 12:39 chee left, chee joined
moritz \o 12:56
13:04 pmurias left 13:05 pmurias joined
RabidGravy harr 13:15
13:17 kid51 joined 13:21 rindolf left 13:23 mr-foobar left 13:27 rindolf joined, bent__ joined
bent__ www.reddit.com/r/perl6/comments/4f...ot_debian/ 13:28
13:29 Xliff joined
[Coke] .seen jnthn 13:29
yoleaux I saw jnthn 15 Apr 2016 15:04Z in #perl6: <jnthn> japhb: Ah, because CPUs start in it by default for back-compat?
13:30 Xliff left, Xliff__ is now known as Xliff
[Coke] s/croll end 13:38
13:39 Praise- is now known as Praise
stmuk arnsholt: I'm pretty certain RabidGravy is right about it being a mispelling 13:40
I'd never even noticed the Americans used "canceled"! 13:41
and I'd rather use github issues than RT :) 13:42
13:51 colomon joined 14:06 Actualeyes joined
Emeric How can i shuffle an array ? 14:09
m: my @l = (0, 0, 0, 1, 1, 1); @l.pick(*); say @l;
camelia rakudo-moar 617bb4: OUTPUT«[0 0 0 1 1 1]␤»
psch m: my @l = (0, 0, 0, 1, 1, 1); say @l.elems
camelia rakudo-moar 617bb4: OUTPUT«6␤»
psch ...i still occassionally get confused by that, apparently 14:10
m: my @l = (0, 0, 0, 1, 1, 1); say @l.pick(+@l)
camelia rakudo-moar 617bb4: OUTPUT«(0 1 1 0 1 0)␤»
psch that's interesting, though 14:12
ooh, no...
Emeric: pick doesn't mutate
Emeric: you can use the assign metaop for the method invocation op if you want to mutate in-place
m: my @l = (0, 0, 0, 1, 1, 1); say @l.=pick; say @l 14:13
camelia rakudo-moar 617bb4: OUTPUT«[0]␤[0]␤»
psch ...with * as argument, obviously
m: my @l = (0, 0, 0, 1, 1, 1); say @l.=pick(*); say @l
camelia rakudo-moar 617bb4: OUTPUT«[0 0 0 1 1 1]␤[0 0 0 1 1 1]␤»
psch ...just my luck
m: my @l = (0, 0, 0, 1, 1, 1); @l.=pick(*); say @l
camelia rakudo-moar 617bb4: OUTPUT«[1 1 0 1 0 0]␤»
14:14 buharin joined
buharin hi 14:14
:)
Emeric psch: it finally works, thanks for your help !
buharin: hi :)
buharin are there any jobs in perl6? 14:15
grondilu can I not write 'class :: does (role {...}) {}'?
14:15 tharkun left 14:16 colomon left
grondilu wanted to experiment with roles in the REPL without polluting his namespace. 14:16
14:17 colomon joined, tharkun joined
grondilu
.oO( { my role Foo {...}; class :: does Foo {...} } )
14:17
psch grondilu: you can stuff roles into lexicals as well, if that's more to your liking
grondilu m: @by differs from $by in that each criterion is applied, in order, until a non-zero (tie) result is achieved 14:18
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vUaqpwXecf␤Variable '@by' is not declared␤at /tmp/vUaqpwXecf:1␤------> 3<BOL>7⏏5@by differs from $by in that each criter␤»
14:18 colomon left
grondilu oops wrong paste 14:19
m: { my role Foo { submethod BUILD { say "building" } }; class :: does Foo {}.new }
camelia rakudo-moar 617bb4: OUTPUT«building␤»
grondilu so submethods are inherited when they come from a role or something? 14:20
psch role composition isn't inheritance
it's more like pasting the role body into the class body
grondilu m: { my class Foo { submethod BUILD { say "building" } }; class :: is Foo {}.new }
camelia rakudo-moar 617bb4: OUTPUT«building␤»
psch m: class :: { } but role { } # if you want to have everything anon
camelia ( no output )
psch hm, that second one shouldn't happen afaiu 14:21
grondilu m: (class :: {} but role { submethod BUILD { say "building } }).new
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Tz7efyUHv8␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/Tz7efyUHv8:1␤------> 3submethod BUILD { say "building } }).new7⏏5<EOL>␤ expecting any of:␤ argu…»
grondilu m: (class :: {} but role { submethod BUILD { say "building" } }).new 14:22
camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:22 colomon joined
grondilu oh yeah this one is ok sorry 14:22
m: { my class Foo { submethod BUILD { say "building" } }; class :: is Foo {}.new }
camelia rakudo-moar 617bb4: OUTPUT«building␤»
grondilu ^but this one is dubious 14:23
14:24 colomon left
psch m: class Foo { submethod BUILD { say "building" }; class :: is Foo {}.new 14:24
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VzD7_tdcfX␤'<anon|60499264>' cannot inherit from 'Foo' because 'Foo' isn't composed yet (maybe it is stubbed)␤at /tmp/VzD7_tdcfX:1␤»
psch m: class Foo { submethod BUILD { say "building" } }; class :: is Foo {}.new 14:25
camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:25 colomon joined, dolmen joined
psch m: class Foo { submethod BUILD { say "building" } }; class Bar is Foo {}.new 14:25
camelia rakudo-moar 617bb4: OUTPUT«building␤»
psch oh
BUILD is special 'cause its needed for construction
it's not that Bar.BUILD prints "building", but for Bar to be constructed, Foo has to BUILD 14:26
something about BUILDPLAN and BUILDALLPLAN... probably in S12, i think?
design.perl6.org/S12.html#Construct...ialization 14:27
m: class Foo { has $!bar; submethod BUILD(:$!bar = "baz") { }; method bar { $!bar } }; class Bar is Foo { }; say Bar.new.bar
camelia rakudo-moar 617bb4: OUTPUT«baz␤»
psch otherwise that stops working 14:28
grondilu: ^^^ hth
14:28 wallisds joined, colomon left, wallisds left 14:29 colomon joined
grondilu ok 14:29
dalek c: 3693778 | coke++ | doc/Language/concurrency.pod:
Add react/whenever X<>'s for Issue #134
14:39
c: e6c92f4 | coke++ | doc/Type/IO.pod:
Add missing :

Closes RT #427
RabidGravy gah, this is really annoying 14:41
is it possible to somehow parameterise a role with a type capture that is not known at compile time? 14:42
my experiments seem to indicate this is not the case
psch m: role R[::T] { method foo { say T.^shortname } }; my $t = rand < .5 ?? Str !! Int; my $rt = R.^parameterize($t); $rt.foo 14:44
camelia rakudo-moar 617bb4: OUTPUT«Str␤»
psch blames the AE/BE difference :P
RabidGravy ah 14:46
14:46 sue joined
RabidGravy I was doing 14:48
m:role Bop[::Zub] { has Zub $.bap; }; role Foo[::Bap] { has Bap $.bop; }; my $f = Str; my $d = class :: does Bop[$f] { }; my $c = class :: does Foo[$d] { }; for $c.^attributes -> $a { my $t = $a.type; say $t; for $t.^attributes -> $a { say $a.type; } }
m: role Bop[::Zub] { has Zub $.bap; }; role Foo[::Bap] { has Bap $.bop; }; my $f = Str; my $d = class :: does Bop[$f] { }; my $c = class :: does Foo[$d] { }; for $c.^attributes -> $a { my $t = $a.type; say $t; for $t.^attributes -> $a { say $a.type; } }
camelia rakudo-moar 617bb4: OUTPUT«(Any)␤»
RabidGravy m: gist.github.com/jonathanstowe/2205...2095c3f853 14:53
camelia rakudo-moar 617bb4: OUTPUT«(<anon|55058800>+{Bop[Str]})␤(Str)␤»
RabidGravy which does indeed work 14:54
14:56 chenfei joined, chenfei left 14:57 BenGoldberg joined 14:58 khw joined
RabidGravy now to see if it works in the actual code 14:58
grondilu wonders how he could live so long without ':set foldmethod=indent' 14:59
RabidGravy I vary on the folding 15:02
15:02 skink joined
psch hardly ever folds 15:02
i usually jump between marks 15:03
skink RabidGravy, Just 'argon2' for resources doesn't find the library
RabidGravy sometimes I find I can't live without it, sometimes I find it really annoying
skink, let me fix that for you 15:04
[Coke] finds that p6-doc sparse ain't awesome. 15:06
15:07 CIAvash joined
skink Ah, wait, 'libargon2' 15:08
does work for resources
It's only the suffixes it doesn't care about 15:09
RabidGravy ah, yes, I'd forgotten that part 15:10
skink 'libargon2' for meta resources and 'argon2' for %?RESOURCES, rather confusingly 15:12
15:13 luis left 15:15 luis joined
skink Pushed, RabidGravy 15:15
I can add OS X to travis for that 15:16
15:19 colomon left 15:20 kurahaupo joined
grondilu m: (class :: { submethod BUILD { say "building" } } but role { submethod BUILD { say "mixing" } }).new 15:21
camelia rakudo-moar 617bb4: OUTPUT«building␤mixing␤»
grondilu ^happy to notice this behavior. Can I rely on it?
15:22 Emeric1 joined
grondilu I mean the execution of *both* build submethods? 15:22
ZoffixWin Yup. 15:23
grondilu ok
15:24 skids joined, Some-body_ joined, rindolf left 15:25 DarthGandalf left, Some-body_ is now known as DarthGandalf, sue left, xinming_ joined 15:26 tharkun_ joined, Skarsnik joined, khagan_ joined
[Coke] so, I'm trying to see if there's an opportunity to speed up the build on perl6-docs; it's using python to build the docs, but is trying (and failing) to use inline::python to do it. 15:26
15:26 timotimo left
[Coke] adding a warning so it says that it's trying and failing to use Inline:: 15:27
15:28 esh joined, esh_ left 15:30 sue joined, tharkun left, Emeric left, khagan left, avenj_ left, xinming left, Emeric1 is now known as Emeric
dalek c: f4be522 | coke++ | htmlify.p6:
Let dev know that we failed
15:32
15:33 Actualeyes left
skink RabidGravy, OS X travis build passes 15:33
15:34 jjido joined 15:35 timotimo joined
dolmen CaptionBot AI about Camelia: twitter.com/omengue/status/721723306185998336 15:36
15:42 sue left, Herby_ joined
Herby_ Morning, everyone! 15:42
\0
ZoffixWin Herby_, what sort of trouble did you have with Twitter module? Granted, I barely started on it and there aren't any tests :/ 15:45
cognominal so, definitively young -Ofun
[Coke] m: Inf.base(16)
camelia rakudo-moar 617bb4: OUTPUT«Earlier failure:␤ Cannot coerce Inf or NaN to an Int␤ in block <unit> at /tmp/NXJAFvBkuW line 1␤␤Final error:␤ Type check failed in assignment to $int_part; expected Int but got Failure (Failure.new(exception...)␤ in block <unit> at /tmp/NXJA…»
[Coke] m: NaN.base(16)
camelia rakudo-moar 617bb4: OUTPUT«Earlier failure:␤ Cannot coerce Inf or NaN to an Int␤ in block <unit> at /tmp/6km9xRn2h_ line 1␤␤Final error:␤ Type check failed in assignment to $int_part; expected Int but got Failure (Failure.new(exception...)␤ in block <unit> at /tmp/6km9…»
15:49 krakan left, krakan joined
Herby_ ZoffixWin: Let me take another look at it to see what error I was getting. Last night was another night of Percocet and Programming :) 15:49
ZoffixWin You're still taking them? Dude, they're opiates. You're probably already addicted. 15:50
Herby_ I only started with 10 total, and I'm all out :) 15:51
grondilu wow never seen this error before:
===SORRY!===
Unknown QAST node type NQPMu
shell returned 1
[Coke] there's a few RTs with that, I think. 15:53
moritz grondilu: congratulations, you've triggered a compiler bug
15:53 rindolf joined
Herby_ zoffixwin: getting an ERROR 599: Internal Exception 15:56
i can try and paste the error code, one sec
15:56 Actualeyes joined, buharin left
Herby_ pastbin.com/qcWx4hKU 15:57
I'm using your simple example, with my keys substituted in
pastebin.com/qcWx4hKU
Xliff Interleved arrays and pointer math.... oh my. 15:58
Sometimes I can really dislike C APIs and libs that do things difficult. 15:59
ZoffixWin Herby_, seems like an issue with HTTP::Tinyish. Does this work: perl6 -MHTTP::Tinyish -e 'say HTTP::Tinyish.new(agent => "Mozilla/4.0").post: "httpbin.org/post", headers => { "Authorization" => "blah" }, content => "foo=bar"' 16:03
Oh. You're on Win10... maybe it doesn't work on it. 16:04
Herby_ running this on an lubuntu virtual box
16:05 kaare_ joined
ZoffixWin Ah 16:05
16:05 kaare__ left
skink Xliff, I still really wanna know why this wasn't working for us pastebin.com/raw/QTqKtczv 16:05
When in the Argon2 module, using a Buf instead of a CArray worked just fine 16:06
16:06 jjido left
pmurias rakudo++ # me just discovered it has version control marker detection in the grammar 16:07
16:07 kurahaupo_ joined
Herby_ zoffix: here is that command: pastebin.com/6QdL1cpe 16:08
ZoffixWin Yup. Same error as with Twitter module. Hm.
skink (meant to s/CArray/Buf/ for the sysfunc there) 16:09
16:09 kurahaupo left
ZoffixWin Herby_, do you have `curl` installed? 16:09
[Coke] tries to get the RT CLI working again. 16:10
ZoffixWin Seems like shelling out to curl is *still* the only method HTTP::Tinyish supports. I need to use something different in Twitter module.
16:15 BenGoldberg left 16:16 BenGoldberg joined 16:19 colomon joined 16:21 pierrot joined
dogbert17 Good afternoon #perl6 16:21
is moritz still around? 16:22
16:23 emdashcomma_ joined 16:26 Emeric1 joined 16:27 nowan_ joined, leont_ joined
ZoffixWin was half an hour ago 16:27
dogbert17 ZoffixWin: thx, I have tried to document the samecase method and was hoping he could take a look at it 16:29
16:29 smls joined, colomon left 16:31 skids1 joined, khagan_ left, skids left, Emeric left, emdashcomma left, nowan left, leont left, rvchangue left, firstdayonthejob left, Emeric1 is now known as Emeric 16:32 rvchangue joined, patrickz joined 16:35 bent__ left 16:36 ufobat joined
ufobat hi perl6 16:36
16:36 dolmen left
Herby_ ufobat: o/ 16:37
16:37 sue joined 16:38 buharin joined 16:39 khagan joined 16:40 Herby_ left, firstdayonthejob joined 16:41 Herby_ joined, araujo left 16:46 Philj left
Herby_ m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep (.jpg); say @jpgs; 16:47
camelia rakudo-moar 617bb4: OUTPUT«Method 'jpg' not found for invocant of class 'Any'␤ in block <unit> at /tmp/LGrX_jBqa3 line 1␤␤»
Herby_ blah thats ugly
$content.match(/ \s 'href="' (<-["]>+) '"' /, :g).map({ $_[0] }).grep( rx:i/^http/ ) 16:48
how would i modify that to match http links that end in .jpg
ZoffixWin Use an HTML parser? :)
16:48 colomon joined
Herby_ m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep ('.jpg', @array); say @jpgs; 16:49
camelia rakudo-moar 617bb4: OUTPUT«[]␤»
Herby_ m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep (.jpg, @array); say @jpgs;
camelia rakudo-moar 617bb4: OUTPUT«Method 'jpg' not found for invocant of class 'Any'␤ in block <unit> at /tmp/pYZ3keTkRo line 1␤␤»
ZoffixWin m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep /'.jpg'/, @array; say @jpgs;
camelia rakudo-moar 617bb4: OUTPUT«[photo.jpg]␤»
ZoffixWin m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep { $_ ~~ '.jpg' }, @array; say @jpgs;
camelia rakudo-moar 617bb4: OUTPUT«[]␤»
ZoffixWin oh, well, missing // in the last one :)
m: say '<a href="foo.html"></a><a href="bar.jpg"></a>'.comb: /<after 'href="'> <-["]>+/ 16:52
camelia rakudo-moar 617bb4: OUTPUT«(foo.html bar.jpg)␤»
ZoffixWin Herby_, ^ 16:53
16:53 colomon left, Some-body_ joined
ZoffixWin m: say '<a href="foo.html"></a><a href="bar.jpg"></a>'.comb: /<after 'href="'> <-["]>+ '.jpg' <before '"'>/ 16:54
camelia rakudo-moar 617bb4: OUTPUT«(bar.jpg)␤»
16:54 Herby__ joined 16:55 jnthn_ joined 16:58 Timbus_ joined 17:00 Herby_ left, skids1 left, pierrot left, DarthGandalf left, skink left, pmurias left, Timbus left, jnthn left, stux|RC-only left, wtw left, avar left, literal left, jervo left, Some-body_ is now known as DarthGandalf 17:03 colomon joined 17:04 skink joined
skink freenode has such long timeout periods... 17:04
17:04 stux|RC-only joined 17:07 pmurias joined 17:08 skids joined 17:11 Herby__ left, avenj_ joined 17:13 geekosaur left 17:14 geekosaur joined
dalek osystem: f125369 | skinkade++ | META.list:
Add Crypt::Argon2

Friendly password-hashing on top of a libargon2 binding.
17:15
osystem: dba382f | RabidGravy++ | META.list:
Merge pull request #196 from skinkade/patch-2

Add Crypt::Argon2
17:26 Emeric left, Emeric joined 17:34 zakharyas joined, Vals joined 17:37 colomon left, bent__ joined 17:38 djbkd joined 17:41 bent__ left 17:42 BenGoldberg left 17:43 BenGoldberg joined 17:46 llfourn joined 17:49 kid51 left 17:51 bent__ joined 17:52 nchambers is now known as sillytime
psch ZoffixWin: huh, i didn't know we had ambivalent lookahead :) 17:55
as in, i wasn't aware <before ...> means anything, and thought we only had <?before ...> for positive and <!before ...> for negative lookahead
17:55 bent__ left
psch m: grammar G { }; my \r = G.^can('before'); say r[0].name # ah 17:59
camelia rakudo-moar 617bb4: OUTPUT«before␤»
psch that's an intersting MTOWDI
as in, the assertion <?before foo> is equivalent to the predefined subrule <before foo> 18:00
18:00 Actualeyes left
psch s/MTOWDI/MTOWTDI/ 18:00
18:02 kid51 joined 18:06 pierrot joined
timotimo Today I More'd 18:08
ZoffixWin psch, oh.. I actually mis-copied from the docs lol. 18:12
I wonder if there's a difference between <after ...> and <?after ...> 18:13
timotimo shouldn't
psch ZoffixWin: i think <?after ...> is equivalent to <{? .after(...) }> or something like that
ZoffixWin: as in, every grammar has the predeclared rule "after", which does the lookbehind 18:14
and <?after ...> is a shorthead for "does the subrule with the name after the question mark match here", which i think is approximately what <?{ ."$name"(...)" }> should do 18:15
hm, <{? is a type, meant as <?{ :) 18:17
grr, s/type/typo/
timotimo <?after foobar> is the same as <?foobar> you mean? 18:19
18:23 sue left
MadcapJake Why does enc need a colon in github.com/perl6/doc/issues/427 18:25
timotimo because that turns it into a Pair on the LHS of the =>
and then it doesn't become a named parameter
you could also use "enc" => 'latin1' instead
that'd do the same thing 18:26
the "fix" seems wrong to me
smls m: dd (:a => 1); say (:a => 1).key.WHAT 18:27
camelia rakudo-moar 617bb4: OUTPUT«(:a) => 1␤(Pair)␤»
smls not quite the same thing
18:27 zakharyas left
MadcapJake m: dd (:a => 1); dd (a => 1); dd ("a" => 1) 18:27
camelia rakudo-moar 617bb4: OUTPUT«(:a) => 1␤:a(1)␤:a(1)␤»
timotimo spurt "path/to/latin1_file", "latin1 text: äöüß", enc => "latin1";
this actually already works 1:1
with the : it says 18:28
Too many positionals passed; expected 1 argument but got 2
MadcapJake timotimo: the example uses say
smls &say does not accept that named parameter (or any other that I'm aware of)
only positional ones 18:29
timotimo that's right, but the example is about spurt, not about say
MadcapJake m: my $filename = 'enc_missing_colon.txt'; say $filename, "latin1 text: äöüß", enc => 'latin1';
camelia rakudo-moar 617bb4: OUTPUT«Unexpected named parameter 'enc' passed␤ in block <unit> at /tmp/rJ4z8vL1dA line 1␤␤»
MadcapJake m: my $filename = 'enc_missing_colon.txt'; say $filename, "latin1 text: äöüß", :enc => 'latin1';
camelia rakudo-moar 617bb4: OUTPUT«enc_missing_colon.txtlatin1 text: äöüß(enc => True) => latin1␤»
timotimo the title of the issue is "doc.perl6.org/routine/spurt: example lacks ':'"
i'm going to comment on the issue 18:30
MadcapJake timotimo: you're right! the changed code is wrt spurt as well
timotimo MadcapJake: why would it need the : when using say? 18:31
when you use a : when doing it with say it *doesn't* *work*
MadcapJake timotimo: I don't know why but it does
timotimo it just spits out "(enc => True) => 'latin1'" at the end of the string
MadcapJake m: my $filename = 'enc_missing_colon.txt'; say $filename, "latin1 text: äöüß", :enc => 'latin1';
camelia rakudo-moar 617bb4: OUTPUT«enc_missing_colon.txtlatin1 text: äöüß(enc => True) => latin1␤»
timotimo that's nonsense
why would that be what you want?
MadcapJake timotimo: ahhh i thought maybe it was doing something, but you're right it's just concat'ing
smls :enc => 'latin1' creates a pair which has another pair (enc => True) as its key 18:32
MadcapJake smls: yep, I just assumed that with it being fixed there was just some crazy mechanic that I wasn't following :) 18:33
smls the example worked fine before that commit
timotimo to be fair, the issue was opened 30 days ago; maybe the text in the docs has changed since then?
psch m: sub f(:$) { }; # i'm still wondering how to match that sig, if we are on named param weirdness vOv 18:34
camelia ( no output )
timotimo hah, oh snap
that's mean :)
18:34 boegel joined
psch but it *is* allowed :) 18:34
well, actually, the mean one is the following one 18:35
m: sub f(:$!) { }; 18:36
camelia ( no output )
RabidGravy finally gets a role parameterised by a parameterised role working in the actual code
timotimo MadcapJake: what's a "named pair"? :)
MadcapJake I dunno :P
RabidGravy waaaaaaaaay harder than it should have been
smls m: sub f(:$!) { say "matches" }; f;
camelia rakudo-moar 617bb4: OUTPUT«matches␤»
timotimo your explanation isn't completely accurate, either
whether or not it gets turned into a named argument isn't about whether the key is a string
psch smls++
neat 18:37
MadcapJake timotimo: fixed it
psch that used to not work - and arguably still shouldn't, but i don't really *want* to argue it
MadcapJake isn't it though? functions given pairs with string keys will look for named arguments with that same name
timotimo that's not true :)
let me give you an example
m: sub test(*%a) { say %a }; test hello => 1 18:38
camelia rakudo-moar 617bb4: OUTPUT«{hello => 1}␤»
psch m: my $pair = a => 1; sub f(:$a) { }; f $pair
camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub f at /tmp/VHepcaNlTn line 1␤ in block <unit> at /tmp/VHepcaNlTn line 1␤␤»
timotimo ^- that's obvious, right?
m: sub test(*%a) { say %a }; test "hello" => 1
camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub test at /tmp/eBZHGsh8TW line 1␤ in block <unit> at /tmp/eBZHGsh8TW line 1␤␤»
timotimo ^- this is what i mean
MadcapJake timotimo: ok one caveat: if a function accepts a slurpy hash, then it will first search named args THEN it will place in hash slurpy
timotimo it's a purely syntactic thing whether or not it'll end up a named argument
m: sub test(:$hello) { say $hello }; test "hello" => 1
camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub test at /tmp/yQwNH3HBNI line 1␤ in block <unit> at /tmp/yQwNH3HBNI line 1␤␤»
timotimo ^- without a slurpy, it still behaves like that 18:39
psch is still somewhat unhappy with that
timotimo if you want to put an actual Pair object into it as a named argument, you will have to use flattening
psch but the convenient Pair constructor is unfortunately overloaded to mean named argument in some cases
timotimo the convenient pair constructor won't let you use a quoted string for names, so it's always valid for creating a named argument 18:40
MadcapJake timotimo: so you're saying that you need to specifically use unquoted pair keys or the colon form to trigger named argument checking?
timotimo yes, exactly
it's syntax on the caller's side, not semantics on the callee's side
psch m: (a => 1).WHAT.say; {$:a.WHAT.say}(a => 1)
camelia rakudo-moar 617bb4: OUTPUT«(Pair)␤(Int)␤»
smls MadcapJake: And it needs to be diretly in the argument list
psch timotimo: ^^^ that's what i mean
smls (Not inside parens or in an expression inside the argument list) 18:41
timotimo ah, the difference between an argument list and just parenthesis
smls Basically, argument lists are parsed differently than normal expressions, and that's one of the differences.
psch note, i'm not disagreeing, i understand the distinction. it's still just think it's a bit too close together for easy access
s/it\'s/i/ 18:42
smls Another difference is that | interpolates arguments instead of creating Slip's.
timotimo that's sufficiently ingrained into my brain already for me to not see it as a problem :)
does somebody want to revert coke's merge commit?
psch yeah, it works out if one accepts that sub invocation does things *handwave*
and i generally think it's a good thing we mostly have this one spot where the grammar works a bit differently 18:43
well, excluding all the obvious "this is a slang now", like regexen
MadcapJake timotimo: ok I updated my comment.
timotimo to me, it's not "sub invocation does things", it's a purely syntactic difference 18:44
18:45 domidumont joined
psch hm, i suppose that works too. syntactically, inside an argument list, we're not completely in the main language anymore 18:45
MadcapJake which is why I think that a lot of the intro text in type/Signature should be elaborated upon in a language/ArgumentsParameters pod 18:46
or just placed in the functions pod 18:47
18:48 literal joined 18:49 domidumont left 18:50 domidumont joined 18:55 jjido joined
dalek c: 4a9da56 | timotimo++ | doc/Type/IO.pod:
Revert "Add missing :"

This reverts commit e6c92f416c52ca4c1a456e5cc4b1efca09ebd0af.
As discussed in the issue #427, this wasn't correct.
18:55
timotimo i went ahead and did it
psch timotimo++ MadcapJake++ # GH issue comments 18:58
18:59 dwarring joined 19:00 colomon joined, ribasushi left
timotimo i added a final comment and closed the issue 19:01
19:02 ribasushi joined
timotimo interesting 19:02
19:02 skaji left 19:03 skaji joined
timotimo doc.perl6.org/routine/say - see how "role IO" has a "From IO" which links to /types/IO#say, but the anchor it's supposed to link to is actually called #sub_say 19:03
anybody want to open an issue about that (if there isn't one already) while i'm AFK?
19:03 Ven joined 19:04 colomon left, AlexDaniel joined
AlexDaniel how to confuse the whole perl 6 community? Just say that some example lacks a colon. 19:04
jjido AlexDaniel: for example? 19:06
AlexDaniel jjido: github.com/perl6/doc/issues/427
19:06 M-tadzik is now known as tadzik
AlexDaniel jjido: also note that this was opened for 29 days :) 19:08
jjido it was a bad suggestion isn't it? 19:09
19:10 geekosaur left 19:11 geekosaur joined, kid51 left 19:18 cdg joined
AlexDaniel jjido: it wasn't bad, it was just wrong :) 19:19
19:20 hankache joined 19:21 kurahaupo_ left, jjido left
masak re RT: I'm thinking the most constructive part we can do right now is collect a list of our current woes 19:24
and we don't need to decide upfront whether to use that list to jump ship or to send it to the RT dev team
in fact, we can treat that as a superposition, which might help us stay focused and constructive 19:25
timotimo huh, i think i missed this round of the RT discussion :)
masak timotimo: irclog.perlgeek.de/perl6/2016-04-17#i_12350200
19:26 ribasushi left, pierrot left
timotimo RT is all right for me 19:26
i can work it, and that's all that matters to me 19:27
19:27 Emeric left, patrickz left
masak that's about where I stand with it too. (except that I actually like some parts of it sometimes.) 19:27
19:27 ufobat left 19:28 BenGoldberg left 19:29 patrickz joined, skaji left, Emeric joined, skaji joined 19:30 Ven_ joined, BenGoldberg joined
timotimo i don't use it thoroughly enough to like parts of it :) 19:32
the amount of time i spend with the interface would only allow for shallow hatred of paper cuts and such
19:33 geekosaur left, Ven left, avenj_ left, skids left
masak I know I have a special relationship with RT because it's happened more than once that people sigh and give up finding something using RT, and I search and I find it 19:33
19:33 ribasushi joined, pierrot joined 19:34 pecastro joined, geekosaur joined 19:36 BenGoldberg left, ocbtec left 19:38 pecastro left, BenGoldberg joined 19:39 ufobat joined
timotimo masak the bugbot :) 19:41
are bears good at finding stuff? is "bugbear" something demeaning to call someone?
timotimo looks it up
oh, wow, that's not a nice thing to call someone at all
19:42 ocbtec joined
skink Is there anything I need to add to META if I have stuff in bin/? 19:43
for included scripts
19:43 kaare_ left, hankache left
timotimo gptrixie has an entry in its "provides" section for that, but i'm not sure that's needed 19:44
(that's just the first example i found)
skink Ah, right 19:46
timotimo no clue what other modules come with a script that gets installed
19:47 skids joined 19:50 CIAvash left
masak I feel like an experienced developer these days. I don't make silly mistakes, and I think before I leap. 19:51
...but I just wrote an off-by-one. and now I'm kicking myself over it. :P 19:52
I wonder if we'll ever get static analysis that can catch off-by-ones
timotimo hmm. it's not static, but if you fuzz your program and run a memory checker like valgrind or asan you'll likely be able to find a condition where you run past the end off an array when it was meant to access the last slot instead ... maybe 19:53
19:57 Exodist joined
masak in my case, I was thinking 1-based indixes for some reason, but of course they're 0-based 19:58
indices*
timotimo Inline::Lua is your friend, then :) 19:59
20:07 domidumont left
masak bleh :0 20:08
:)
20:14 Herby_ joined 20:22 BenGoldberg left 20:23 cdg left 20:24 BenGoldberg joined 20:26 Ven_ left 20:28 darutoko left 20:29 AlexDaniel left
Herby_ m: my @array = <1 1 2 3 3 4 5 5>; my @array = @array.unique; say @array; 20:45
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5===␤Cannot use variable @array in declaration to initialize itself␤at /tmp/zKTZeTcM2K:1␤------> 3array = <1 1 2 3 3 4 5 5>; my @array = @7⏏5array.unique; say @array;␤ expecting any of:␤ term␤Other potential diffic…»
Herby_ m: my @array = <1 1 2 3 3 4 5 5>; @array = @array.unique; say @array; 20:46
camelia rakudo-moar 617bb4: OUTPUT«[1 2 3 4 5]␤»
20:46 jjido joined
Herby_ m: set(1,2,3,5,5,3,4,6,3).list 20:48
camelia ( no output )
Herby_ m: my @array = set(1,2,3,5,5,3,4,6,3).list; say @array;
camelia rakudo-moar 617bb4: OUTPUT«[5 => True 4 => True 3 => True 1 => True 6 => True 2 => True]␤»
Herby_ whoa
grondilu m: sub (UInt $?) {}()
camelia rakudo-moar 617bb4: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3426␤ in sub at /tmp/8aLnim7TX4 line 1␤ in block <unit> at /tmp/8aLnim7TX4 line 1␤␤»
grondilu ^should I report this bug? 20:49
m: sub (Int $?) {}() 20:50
camelia ( no output )
skink Argon2 lets you create hashes that require 4.4 TB of RAM 20:51
That's completely stupid and I love it
grondilu m: subset Even of Int where * %% 2; sub (Even $?) {}()
camelia rakudo-moar 617bb4: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in block <unit> at /tmp/MnU3IfnJov line 1␤␤»
grondilu or is it that optional arguments are not allowed with constraints? 20:52
s/arguments/parameters/
m: sub ($ where * %% 2) {}() 20:53
camelia rakudo-moar 617bb4: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤ in sub at /tmp/MW9YvGhR4N line 1␤ in block <unit> at /tmp/MW9YvGhR4N line 1␤␤»
grondilu m: sub ($? where * %% 2) {}() 20:54
camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context in whatevercode at /tmp/MQVK3LkJKp line 1␤»
grondilu seems so
makes some sense, but I'm not totally convinced.
20:54 buharin left 20:56 dolmen joined
grondilu m: sub ($? where True) {}() 20:56
camelia rakudo-moar 617bb4: OUTPUT«Potential difficulties:␤ Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤ at /tmp/SBznbdywD1:1␤ ------> 3sub ($? where 7⏏5True) {}()␤»
grondilu m: sub ($? where *) {}()
camelia ( no output )
psch m: sub ($x?) {}() 20:59
camelia ( no output )
psch m: sub ($?) {}()
camelia ( no output )
masak 'night, #perl6
psch m: sub ($x? where * %% 2) {}()
camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context in whatevercode at /tmp/ntiiAVfoFQ line 1␤»
psch oh, yeah
21:00 jjido left
psch grondilu: if you haven't, please check if it's ticketed and do so if not 21:00
i don't think optionals with a where constraint should have exist 21:01
as in, the constraint is probably checked when it shouldn't be
m: sub f(:$ where True) {}()
camelia rakudo-moar 617bb4: OUTPUT«Potential difficulties:␤ Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤ at /tmp/KZsbNHLUMr:1␤ ------> 3sub f(:$ where 7⏏5True) {}()␤»
psch m: sub f(:$ where * %% 2) {}()
camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context in whatevercode at /tmp/MaHl6nJF9z line 1␤»
psch ...at least it's consistent, so maybe i'm wrong :/ 21:02
21:03 Emeric left
grondilu it's hard to justify why sub (Int $?) {}() should be ok and not sub (UInt $?) {}(). Unless we consider subsets as second-class types or something. 21:07
psch well, from an impl perspective subsets *are* second-class types
but that should be an implementation detail, as far as i am aware
m: sub f(UInt $) { }; &f.signature.say 21:08
camelia rakudo-moar 617bb4: OUTPUT«(Int $ where { ... })␤»
psch ^^^ proof
21:08 Herby_ left 21:15 vendethiel left
grondilu I'm confused by those error messages splitting the error in "Earlier Failure", "Final error" and sometimes: "Actually thrown at" 21:16
21:23 colomon joined, smls left 21:24 TEttinger joined 21:26 exodist_ joined 21:28 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg, ufobat_ joined, khagan_ joined 21:29 esh_ joined, nebuchad` joined, skids1 joined 21:30 ribasushi_ joined 21:33 rvchangu- joined 21:34 Vals_ joined 21:39 ocbtec_ joined 21:41 Exodist left, skids left, ocbtec left, ufobat left, geekosaur left, pierrot left, ribasushi left, Vals left, khagan left, rvchangue left, leont_ left, timotimo left, esh left, apejens left, tadzik left, nebuchadnezzar left, RabidGravy left, keix left, rvchangu- is now known as rvchangue 21:43 M-tadzik joined, timotimo joined 21:46 leont joined 21:48 M-tadzik is now known as tadzik 21:50 teatime left 21:54 dpk joined 21:57 dpk left 22:01 geekosaur joined 22:04 diego_k left 22:05 diegok joined 22:09 RabidGravy joined 22:14 uuu_john joined 22:15 pmurias left 22:17 pochi joined, dogbert4711 joined, pochi_ left 22:19 patrickz left, dogbert17 left 22:22 dolmen left
RabidGravy boom 22:24
22:28 apejens joined 22:29 firstdayonthejob left, firstdayonthejob joined
grondilu m: role A {}; (my %h)<foo> = my @ A; class { has A @a }.new: :a(%h<foo>) 22:30
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6DzwfjQgi3␤Two terms in a row␤at /tmp/6DzwfjQgi3:1␤------> 3role A {}; (my %h)<foo> = my @7⏏5 A; class { has A @a }.new: :a(%h<foo>)␤ expecting any of:␤ infix␤ infix stopper…»
22:31 dogbert2 joined
grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @a }.new: :a(%h<foo>) 22:31
camelia ( no output )
grondilu wth
m: role A {}; (my \%h)<foo> = my A @; class { has A @.a }.new(:a(\%h<fo 22:32
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/N_oHALeLFw␤Malformed my␤at /tmp/N_oHALeLFw:1␤------> 3role A {}; (my7⏏5 \%h)<foo> = my A @; class { has A @.a }␤»
22:32 dogbert4711 left
grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(%h<foo>) 22:33
camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @!a; expected A but got Array[A] (Array[A].new())␤ in block <unit> at /tmp/n5uSFfPVsl line 1␤␤» 22:34
grondilu ahah
m: role A {}; class { has A @.a }.new: :a(my A @) 22:35
camelia ( no output )
grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(%h<foo>)
camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @!a; expected A but got Array[A] (Array[A].new())␤ in block <unit> at /tmp/px8mwmITrJ line 1␤␤»
grondilu I keep stumbling on things like that every time I try to write something. That's very LTA
psch m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(|%h<foo>) 22:36
camelia ( no output ) 22:37
grondilu m: role A {}; my $foo = my A @; class { has A @.a }.new: :a($foo)
camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @!a; expected A but got Array[A] (Array[A].new())␤ in block <unit> at /tmp/Vbepv2naez line 1␤␤»
psch doesn't see how that's surprising 22:38
grondilu m: role A {}; my $foo := my A @; class { has A @.a }.new: :a($foo)
camelia ( no output )
22:38 colomon left
psch m: role A {}; my $foo := my A @; my $bar = my A @; say $foo.WHAT; say $bar.WHAT 22:39
camelia rakudo-moar 617bb4: OUTPUT«(Array[A])␤(Array[A])␤»
psch okay, that is somewhat surprising
m: class A { has Str @.a }; A.new(:a(["foo", "bar"])) 22:40
camelia ( no output )
grondilu basically I had a hash and I wanted to put a typed array in one of its entries. Things went fine until I had to actually use this entry to affect an other typed array.
psch typed arrays are somewhat weird to handle
fwiw, moritz++ general advice is "better don't use typed arrays"
grondilu :/
psch which is somewhat suboptimal, and i'm probably not giving moritz enough credit here by paraphrasing it like that 22:41
grondilu m: role A {}; my A @ = my $ = my A @
camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @; expected A but got Array[A] (Array[A].new())␤ in block <unit> at /tmp/sw7I1D4xdW line 1␤␤»
grondilu m: role A {}; my A @ = my $ := my A @ 22:42
camelia ( no output )
22:42 dogbert17 joined
psch ...why would you even do that 22:43
sorry
that probably comes of a bit weird
grondilu because I want to use a deep typed structure in a hash
psch right
well
22:43 dogbert2 left
psch context is involved there, a blot 22:43
-b
m: my @a = ^5; my $b = @a; say $b.WHAT 22:44
camelia rakudo-moar 617bb4: OUTPUT«(Array)␤»
psch m: my @a = ^5; my $b := @a; say $b.WHAT
camelia rakudo-moar 617bb4: OUTPUT«(Array)␤»
timotimo grondilu: i think when you my A @ = my $ you'll get list-assignment which will put the single A array as one item into the leftmost A array
psch notices the example doesn't help
timotimo that's why you'd get the "expectde A but got Array[A]"
but when you := it, it won't behave as an item, because you overruled the $ semantics
and then it'll get one-argument-rule'd because it's just one iterable 22:45
and then it's fine
psch timotimo++
grondilu seems like a sensible explanation
psch that's, i think, what i was trying to find my towards
in general, binding cheats
it breaks everything that we normally use to DWIM, and skips container semantics 22:46
grondilu m: role A {}; my A @ = @(my $ = my A @)
camelia ( no output )
grondilu m: role A {}; my $foo = my A @; class { has A @.a }.new: :a(@$foo)
camelia ( no output )
grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(@(%h<foo>)) 22:47
camelia ( no output )
grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(@%h<foo>)
camelia rakudo-moar 617bb4: OUTPUT«Earlier failure:␤ Type List does not support associative indexing.␤ in block <unit> at /tmp/JgX3QPRJf1 line 1␤␤Final error:␤ Type check failed in assignment to @!a; expected A but got Failure (Failure.new(exception...)␤ in block <unit> at /tm…»
22:47 colomon joined
psch m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(@(%h<foo>)) 22:48
camelia ( no output )
psch well, or just slip that one
grondilu not sure about the priorities in @%h<foo>
psch m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(|%h<foo>)
camelia ( no output )
psch postcircumfix binds looser than prefix @
+< >
grondilu m: role A {}; my A @ = |my $ = my A @ 22:49
camelia ( no output )
psch i don't think i'll argue whether i agree or not right now :)
grondilu the slip solution looks elegant but I'm not sure I understand it.
psch afaiu it structurally lowers the argument into the callees expectation
22:49 dogbert17 left
psch m: sub f(:$a, :$b) { say $a, $b }; my %h = a => 1, b => 2; f |%h 22:50
camelia rakudo-moar 617bb4: OUTPUT«12␤»
22:50 dogbert17 joined, colomon left
psch m: sub f($, $, $) { say "three args" }; my @a = ^3; say f |@a 22:50
camelia rakudo-moar 617bb4: OUTPUT«three args␤True␤»
psch like that
of course, if it doesn't fit after lowering it fails to dispatch 22:51
m: sub f($, $, $) { say "three args" }; my @a = ^4; say f |@a
camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 3 arguments but got 4␤ in sub f at /tmp/zE6THSOwJb line 1␤ in block <unit> at /tmp/zE6THSOwJb line 1␤␤»
Xliff I'm getting a segfault when trying to execute a native C call wiht signature (float ***)
my $appp = Pointer.new(); 22:52
say "Calling C routine...";
my $ret = pointerArrayTest($appp);
psch braces for lots of pasted lines
Xliff Doesn't matter what $appp is set to, rakudo drops.
Nope. That's it. For anything more, I will pastebin
psch fwiw, i don't even understand a C signature like that... :) 22:53
Xliff Or gist... whatever
psch: Pointer to a 2d array
psch well, except with reframing it... yeah
grondilu it's a pointer to a pointer to a pointer to a float, isn't it?
timotimo rakudo drops?
Xliff Segfaults 22:54
timotimo i don't think Pointer.new will do what you want
arnsholt Yeah, I was about to say the same
Xliff 'k
timotimo you'll want to use something like malloc, or have a CArray
leont I'm observing my program dieing because Match.to isn't in the range substr($from) accepts, this is weirdness :-/
psch yeah, i'd have guessed CArray[CArray[num]] probably
arnsholt It depends entirely on what your function does, but Pointer.new is almost never going to be what you want
Xliff OK. Let me try that.
timotimo leont: it might signify a failed match
skink I'm with psch
timotimo though i think we only do that with cursors, not with match objects? not sure.
psch arnsholt: do you have any idea about NC on r-j, ooc? 22:55
timotimo i think when you Pointer.new() you're getting the default value of 0 for your pointer, so you have ... a null pointer :)
leont Well, it's in a while block, so I shouldn't be getting a failed match
psch arnsholt: it looks like getattr can't cope with inlined NativeCallBodys
Xliff timotimo, that makes sense.
So how do I pass "CArray[CArray[num32]]"?
leont while $foo.subparse($bar) -> $match { $foo.substr($match.to) } 22:56
timotimo just nativecast(TheTargetType, $thecarray)
leont Erm, second $foo should be $bar, and I should use better names in my example :-p
timotimo don't forget you'll probably have to create an inner CArray for each entry of the outer CArray
skink m: use NativeCall; my $test = CArray[CArray[num]].new; say $test.WHICH
camelia rakudo-moar 617bb4: OUTPUT«NativeCall::Types::CArray[NativeCall::Types::CArray[num]]|91041912␤» 22:57
leont while $grammar.subparse($string) -> $match { $string.=substr($match.to) }
Xliff timotimo, I'm pretty sure the C-code handles initializing inner and outer array. It's the pointer to those that I'm worried about. 22:58
timotimo OK 22:59
skink Xliff, Pretty sure passing a function a CArray will always pass a pointer 23:00
timotimo yeah 23:01
Xliff Well... I keep getting this when passing an array:
Native call expected return type with CArray representation, but got a P6opaque 23:02
timotimo what do you have in the "returns"?
Xliff int32
timotimo huh
that's neither of those things
psch does the CArray have an @ sigil?
timotimo what kind of array are you passing? 23:03
Xliff Hold on. Let me fpaste it.
psch: Yes
timotimo ah, yes, that'd be trouble
unless you use := consistently with it
skink If you use $ it's more magical
Or something like that :)
arnsholt psch: I wrote a lot of that code, at some point. But it's been a while
timotimo hey! i have a good idea for a little commit. gimme a sec.
shadowpaste "xliff" at 217.168.150.38 pasted "NativeCall Arrays" (29 lines) at fpaste.scsys.co.uk/510804
arnsholt psch: From the sound of it, I think you're talking about inlined CStructs in other structs? 23:04
psch arnsholt: the gist that binding the $!call of a Sub+{Native[...]} during BUILDALLPLAN runs into getattr complaining about "trying to access a native attribute as reference attribute" 23:05
+is
arnsholt: some digging has turned up that NativeCall returns a StorageSpec.INLINED from get_storage_spec, which seems to behind the wrongly gen'd code there 23:06
'cause i'm pretty sure a NativeCallBody isn't a native attribute, from a jvm perspective at least
Xliff := seems to fix the call, but now I can't get the data.
psch i have to admit i'm not great wrt JNA, so maybe i'm wrong there and the problem is somewhere else
arnsholt Yeah, that's different I think
Could be that something changed in the internals of the JVM backend, and the NativeCall bits weren't updated to match 23:07
timotimo i just pushed a commit to MoarVM
if you git pull and make install in your moarvm folder, you should get better error messages for this case 23:08
23:08 geraud joined
timotimo oh no 23:08
never mind
argh
psch arnsholt: right, if nothing immediatly comes to mind i'll have to dig some more i suppose.. :)
arnsholt Yeah, sorry
I think that particular bit was implemented by jnthn++ originally 23:09
23:09 Skarsnik left
timotimo force-pushed over his blunder 23:10
23:10 pierrot joined, wamba left
skink Xliff, After calling the C function, does the CArray contain nothing, or does it contain null bytes? 23:11
23:12 telex left
Xliff skink, Looking like undef bytes. I've tested this in C and it works. 23:12
s/bytes/values/
23:12 telex joined
[Coke] sees his simple doc patch failed. whoops. 23:13
psch now, if i only had a known working git ref for NC on r-j...
psch starts at the v6.c tag 23:14
maybe that works... vOv
shadowpaste "xliff" at 217.168.150.38 pasted "NativeCall Arrays #2" (26 lines) at fpaste.scsys.co.uk/510805 23:15
Xliff ^^ Latest version.
psch ...hardtabs 23:16
what kind of monster are you!? :P
Xliff What's wrong with hardtabs?
psch in all seriousness, nothing, actually
anyway, i take it that means the paste as-is still doesn't have useful values? 23:17
timotimo Xliff: are you aware of CArray not having a size to speak of to go with it?
Xliff Yes
timotimo ok
you may have to handle the outer CArray as an CArray[Pointer] and nativecast the individual entries to CArray[num32] or what you have
skink He said the C lib initializes the arrays
Xliff timotimo: The C call should handle allocation.
timotimo OK, but i was mostly wondering about usage rather than allocation 23:18
oh, it looks like that's what you're doing already in that paste
psch m: use NativeCall; my $r = CArray[CArray[num32]].new; say $r[0].defined
camelia rakudo-moar 617bb4: OUTPUT«False␤»
Xliff Yes. =)
skink $appp = CArray[Pointer].new() you mean timotimo? 23:21
Xliff, If you figure this out, it's probably worth adding to the docs 23:22
Xliff kk
23:22 wamba joined
Xliff That's odd! $appp.WHAT -> "(CArray[num32]])" 23:22
Extra ]
skink: He means "my $chan_a = nativecast(CArray[num32], $appp[$c]);" 23:24
psch m: class A { submethod BUILD { self does Real } }; A.new.WHAT.say 23:27
camelia rakudo-moar 617bb4: OUTPUT«(A+{Real})␤»
psch m: role Foo { }; class A { submethod BUILD { self does Foo } }; A.new.WHAT.say
camelia rakudo-moar 617bb4: OUTPUT«(A+{Foo})␤»
psch oh, packages have to be involved for that bug, right
m: role Bar::Foo { }; class A { submethod BUILD { self does Bar::Foo } }; A.new.WHAT.say 23:28
camelia rakudo-moar 617bb4: OUTPUT«(Foo})␤»
psch ^^^ that's what i suspect behind the extra ]
Xliff Ah. 23:29
After return call.... $appp is defined, but $appp[0] is not.
psch should probably ticket that... 23:30
23:30 keix joined, keix left
Xliff ( ಠ益ಠ) 23:30
23:31 keix joined 23:32 dogbert4711 joined
psch RT #127916 23:34
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127916
psch seems LHF-ish, but not really
as in, it could probably be fixed with heuristics that take better care of what to assign to $!shortname, but that's more of a bandaid solution
23:34 wamba left 23:35 spider-mario left, dogbert17 left
Xliff OK. So now no segfault (progress!) but argument passed to C-lib results in a N-OP. 23:35
It's like the call never happened, even though the return value indicates that all is OK.
psch yay, no segfault \o/
that means it works, ship it! 23:36
Xliff psch, I know, right!
psch ...sorry, but i don't think i have actually useful input :/
Xliff Heh! No worries. I'll continue to plug at it. 23:37
Right after I assassinate pixels.
I will probably veg on video games for a bit.
23:38 RabidGravy left 23:41 tardisx joined 23:46 ZoffixLappy joined 23:47 dogbert2 joined, ocbtec_ left
BenGoldberg m: multi sub f(:$ where * %% 2) {}; f() 23:48
camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context in whatevercode at /tmp/TB4xiXYITW line 1␤Use of uninitialized value of type Any in numeric context in whatevercode at /tmp/TB4xiXYITW line 1␤»
BenGoldberg m: multi sub f($ where * %% 2) {}; f() 23:49
camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/RmzE73TFSP␤Calling f() will never work with any of these multi signatures:␤ ($ where { ... })␤at /tmp/RmzE73TFSP:1␤------> 3multi sub f($ where * %% 2) {}; 7⏏5f()␤»
psch m: sub f(:$ where (*.defined && * %% 2)) {}; f()
camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context in whatevercode at /tmp/eNV5iSHJDH line 1␤»
psch that still should short-circuit at least..?
23:50 dogbert4711 left
ZoffixLappy You used two args 23:50
Can't reuse * for the same arg, gotta go with $_
There's also Subset::Helper I made lastnight that avoids this issue. 23:51
Hm, short-curcuit... right. Weird
Ah, you get a WhateverCode, which is true 23:52
psch m: sub f(:$ where $_.defined && $_ %% 2) {}; f()
ZoffixLappy m: *.blah and say "meow"
camelia rakudo-moar 617bb4: OUTPUT«Constraint type check failed for parameter '<anon>'␤ in sub f at /tmp/zoetwuh45N line 1␤ in block <unit> at /tmp/zoetwuh45N line 1␤␤»
rakudo-moar 617bb4: OUTPUT«meow␤»
psch that seems more reasonable, yeah
ZoffixLappy m: sub f(:$ where {.defined && $_ %% 2 }) {}; f()
camelia rakudo-moar 617bb4: OUTPUT«Constraint type check failed for parameter '<anon>'␤ in sub f at /tmp/daIhUkrNFn line 1␤ in block <unit> at /tmp/daIhUkrNFn line 1␤␤»
psch i mean, it's still weird that we can't have optionals with where constraint
ZoffixLappy where doesn't need an explicit block?
psch ...huh 23:53
it should, actually, i think..?
ZoffixLappy m: sub f(:$ where $_.defined && $_ %% 2) {}; f(42)
camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub f at /tmp/ipw7zMMowQ line 1␤ in block <unit> at /tmp/ipw7zMMowQ line 1␤␤»
ZoffixLappy m: sub f(:$x where $_.defined && $_ %% 2) {}; f(:42x)
camelia ( no output )
ZoffixLappy Guess not
psch neat :)
23:53 regreg left