»ö« 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.
00:06 boegel left 00:07 cdg left, hahainternet left 00:08 cdg joined, notostraca joined, dvinciguerra left 00:09 hahainternet joined
timotimo very nice talk 00:09
00:09 TEttinger left, BenGoldberg joined
timotimo i need constant reminders that perl6 is actually quite neat 00:10
Ulti neat even on my super ancient VM my tests now take 4s to run I think about 5 years ago it took ten minutes
timotimo it's really hard to not forget all those neat features because you're so used to them
00:12 cdg left 00:13 boegel joined
MadcapJake so Robert via RT doesn't want to give me an email 😢 00:19
timotimo hm? 00:21
00:21 CurtisOvidPoe left
MadcapJake I was going to use an email address from perl.org to send in RT tickets from my issue submitter, but Robert (the webmaster at perl.org) says no 00:22
AlexDaniel timotimo: just try other languages to realize how much they suck ;) 00:23
MadcapJake He claims that it would just lead to spam and that I'd be forging the from field. So I replied that I would be writing something just like a mail client but only sending via logging in to the perl.org SMTP server, so how is that forged? then I'd include a captcha on the page. Hopefully he comes around
diakopter but I thought threre already was one
MadcapJake If someone else would like to email to provide some pressure and further perspectives, please send to [email@hidden.address] 00:24
diakopter pressure for what?!
MadcapJake getting an email address! :P 00:25
for my issue submitter
diakopter to send *as*??
or send *to*?
MadcapJake right, because the only other option would be to just write a long mailto URL
to send *as* 00:26
diakopter why not use one of yours
invent an email address at any domain
MadcapJake yes I could do that
00:26 CurtisOvidPoe joined
MadcapJake but I just wanted something to look nice when you open the ticket, you'd see [email@hidden.address] instead of [email@hidden.address] 00:27
diakopter don't bother Robert; he has very linited time
MadcapJake ok, I guess I'll just go the gmail route then 00:28
diakopter you may actually have to send through gmail though
because of SPF and such 00:29
(instead of smtp to perl.org directly) 00:30
MadcapJake how does an email client work then? 00:31
diakopter what 00:32
could you possibly be asking
MadcapJake how come I can't just do what an email client does?
diakopter that is what an email client does 00:33
teatime Is there a parseInt() or similar that could xform 'deadbeef' ₁₆→ Int, '0755' ₈→ Int ?
diakopter it sends through its organization's mail servers
MadcapJake but what about Outlook, Thunderbird, etc.
diakopter exactly
MadcapJake they don't do that, they ask for the smtp server
[Coke] please don't "pressure" [email@hidden.address] 00:34
BenGoldberg m: use experimental :macros; macro foo(AST $expr) { return quasi { {{{$expr}}} } }; say foo(3)
camelia rakudo-moar 8df1a6: OUTPUT«Weird node visited: QAST::BVal␤3␤»
teatime ooo, m: say :16('deadbeef')
diakopter yes, if you add a gmail account to those clients, it emails through gmail's smtp servers
teatime m: say :16('deadbeef')
camelia rakudo-moar 8df1a6: OUTPUT«3735928559␤»
diakopter [Coke]: I already said that
BenGoldberg m: use experimental :macros; macro circumfix:<< ⌊ ⌋ >>(AST $expr) { return quasi { {{{$expr}}} } }; say ⌊ 3 ⌋ 00:35
camelia rakudo-moar 8df1a6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EPxVPVgJd3␤Calling circumfix:<⌊ ⌋>(Int) will never work with declared signature (AST $expr)␤at /tmp/EPxVPVgJd3:1␤------> 3) { return quasi { {{{$expr}}} } }; say 7⏏5⌊ 3 ⌋␤»
BenGoldberg m: use experimental :macros; macro circumfix:<< ⌊ ⌋ >>($expr) { return quasi { {{{$expr}}} } }; say ⌊ 3 ⌋
camelia rakudo-moar 8df1a6: OUTPUT«Type check failed in unquote evaluation; expected AST but got Int (3)␤ in macro circumfix:<⌊ ⌋> at /tmp/KPv6iEVoom line 1␤ in block <unit> at /tmp/KPv6iEVoom line 1␤␤»
MadcapJake [Coke]: This was the suggested route I take to doing this from people here in #perl6 so I just thought that if more people were to ask, it might happen, I wasn't trying to imply that we storm his mail account...
[Coke] suggested by... whom? 00:36
BenGoldberg m: use experimental :macros; macro circumfix:<< ⌊ ⌋ >>($expr) { return quasi { $expr } }; say ⌊ 3 ⌋
camelia rakudo-moar 8df1a6: OUTPUT«AST.new␤»
teatime MadcapJake: You would have to use their SMTP server; you can't just send email from random hosts anymore, they need to be in SPF records etc. because spam; otherwise your mail will just get rejected 90% of the time.
MadcapJake I don't recall :P but it was suggested that I contact the perl.org and I did some searching on issues and in one it said "for a new mail account contact [email@hidden.address]
BenGoldberg m: use experimental :macros; macro circumfix:<< ⌊ ⌋ >>($expr) { return quasi { floor {{{$expr}}} } }; say ⌊ 3 ⌋
camelia rakudo-moar 8df1a6: OUTPUT«Type check failed in unquote evaluation; expected AST but got Int (3)␤ in macro circumfix:<⌊ ⌋> at /tmp/W1dNfj37N3 line 1␤ in block <unit> at /tmp/W1dNfj37N3 line 1␤␤»
BenGoldberg m: use experimental :macros; macro circumfix:<< ⌊ ⌋ >>($expr) { return quasi { floor $expr } }; say ⌊ 3 ⌋ 00:37
camelia rakudo-moar 8df1a6: OUTPUT«AST.new␤»
diakopter I'll say it again: don't bother that guy
MadcapJake: why do you want a new bug submitter form? 00:38
MadcapJake Ok seriously, I'm just trying to help build something for Perl 6 that seemed a hot button issue and a good way to help build my perl 6 programming ability...I don't understand why I'm getting all this anger thrown my way. I'm done bothering the guy, now I just need to set up my smtp client to use gmail's smtp details and get a gmail email address 00:39
[Coke] I'm not angry.
MadcapJake diakopter: check the perl6 user experience issues
diakopter what does that mean?
where would one check such a list
BenGoldberg m: sub circumfix:<< ⌊ ⌋ >> { floor $^n }; say ⌊ 3.5 ⌋; # how do I make something like this work, but turning ⌊ ⌋ into floor() at parse time? 00:40
camelia rakudo-moar 8df1a6: OUTPUT«3␤»
MadcapJake diakopter: github.com/perl6/user-experience/issues/8
[Coke] BenGoldberg: a macro? 00:42
diakopter yeah. useless thread 00:43
[Coke] which are basically experimental at this point.
I agree with the premise that our bug reporting process is in need of improvement.
timotimo AlexDaniel: whenever i try another language, its execution speed is faster :P 00:44
diakopter RT is junk, junk, and more junk, and so is bitcard, despite the ancient despots who luck into having it "work"
timotimo well, usually ...
but developing in perl6 as compared to other languages is rather enjoyable
MadcapJake I'm trying to help alleviate that, some people (Robert included) don't think I should send the email for people though...I don't really agree, if all it does it build an elaborate mailto url, it just seems kind of wasteful, the user then has to wait for their mail client to open and it's just generally annoying
AlexDaniel timotimo: true, yeah, but not much. YMMV 00:45
teatime BenGoldberg: this works for me: sub circumfix:<⟦ ⟧>(Str:D $s) { $s.comb.permutations».join }
timotimo well, i just tried a bit of C++ development
diakopter I agree with Robert; you shouldn't have an unauthenticated form emailing rakudobug
MadcapJake it begs the question, why not just open your mail client in the first place
timotimo :P
teatime BenGoldberg: I don't see why yours doesn't.
AlexDaniel MadcapJake: is there any simpler solution? 00:46
00:46 sortiz joined
MadcapJake AlexDaniel: two solutions, mailto url builder and actually logging into an SMTP server and emailing the bug. No API to do this (and Robert said even if one was developed it would be a huge pain trying to integrate it in their current instance) 00:47
diakopter MadcapJake: the original complaint is correct; it's the documentation that needs improving
00:47 tmch joined
MadcapJake diakopter: well, (un)fortunately, I've spent a fair number of hours working on this issue submitter and others have put forth that it's a good idea, so I'm going to continue, please respect that. 00:48
diakopter I mean, making an email form is admirable and all, but it shouldn't be unauthenticated
MadcapJake how would I authenticate it?
diakopter use github login like someone suggests
AlexDaniel MadcapJake: e.g. here's a random idea: make a small page titled “Quick Bug Reports”. Anyone is allowed to write anything there (it's just a huge bin of user complaints). Then anybody else can move these reports to appropriate repos. This will make it harder for developers (someone has to manage these reports), but perhaps will make it easier for users to file reports.
MadcapJake diakopter: ok i'll look into that. 00:50
AlexDaniel if we are going to use github login to authenticate then perhaps we can simply use github…
MadcapJake AlexDaniel: currently seems like that might be a tall order, plus I think it's generally safe to say that most people don't want to do this kind of work :) Also, it really seems silly to not just automate the whole process, why make an extra human step here? 00:51
diakopter MadcapJake: but at that point you might as well just accept github issues into a separate repo
MadcapJake well that's really not up for debate (at least the general consensus is that we are not going that route) however a separate repo is an interesting idea
diakopter it's ridiculous if perl6 doesn't accept github issues 00:52
AlexDaniel MadcapJake: I don't think that bug reporting is a thing that can be automated
diakopter MadcapJake: it's the general consensus by moritz I suspect
MadcapJake diakopter: that's an unfair generalization, many others have stated similar viewpoints 00:53
AlexDaniel
.oO( I really think that we should make it TIMTOWTDI-ish for users. That is, just allow issues to be filed on github as well )
00:54
MadcapJake AlexDaniel: plenty of games/IDEs and others would disagree, bug reporting can totally be automated, the question is *how* automated
diakopter well, propose a system that doesn't require THEM maintaining something.. and isn't unauthenticated
AlexDaniel: agreed, of course
MadcapJake Ok, I'm currently sticking to my guns a bit, I will set up a gmail, add a robust Captcha of some kind, and then propose to a wider audience whether going full-authentication is the preferred route. 00:55
00:55 maybekoo2 left
diakopter bows out of this conversation which is 15 years too late (still) 00:56
BenGoldberg This might be bikeshedding, but I think we should have a 'perl6bug' program, which opens up the users browser to the appropriate page. The benefit of this is that the program can append Rakudo's current version, and some of the environment, to a query string, which then becomes part of the bug report.
MadcapJake There are many who have voiced quite different opinions on the matter that aren't currently here discussing this. Look back in the IRC log even for more than is in that thread. 00:57
00:58 cdg joined
diakopter MadcapJake: this topic is ten years old 00:58
MadcapJake BenGoldberg: the intent is for this webapp to not only ask users for the language version, compiler version, and environment but also to redirect the user to the thread once it has been created actually. But I do agree that a CLI app would also be useful!
diakopter: only goes to show that it's an important thing to discuss 00:59
MadcapJake is off to RL stuff, ciao!
01:00 dvinciguerra joined 01:02 perlawhirl joined 01:13 atweiden left 01:14 geraud left 01:17 jack_rabbit left 01:35 jack_rabbit joined
timotimo hm 01:40
i'm wondering why my code isn't executing lazily :\
but removing the indirection via a variable made it work all right 01:41
xinming oops, sorry, wrong channel. :-) 01:42
timotimo huh?
01:44 Actualeyes joined 01:47 AndyDee left 01:48 perlawhirl left 01:49 cognominal left 01:50 guest666_ joined 01:56 johndau joined 02:03 cdg_ joined 02:04 kid51 left, khw left 02:05 cdg left
skids
.oO(autopun?)
02:05
02:06 molaf left, eyck left 02:07 molaf joined 02:12 tmch left 02:13 colomon left, colomon joined 02:14 eyck joined 02:15 yqt left 02:18 BenGoldberg left 02:19 BenGoldberg joined 02:21 BenGoldberg left 02:23 BenGoldberg joined 02:29 dvinciguerra left, manchicken joined
manchicken So, I'm having build failures for moarvm on my VM, and my searches seem to indicate that compiling moarvm requires up to 2GiB. I've also had trouble building on the Raspberry Pi, but not on OSX... so I'm wondering if it really does take 2GiB of RAM in order to build moar. Does anybody know? 02:33
02:36 molaf_ joined
AlexDaniel manchicken: I'm not sure about memory consumption, but you on RPi you can install rakudo from debian unstable 02:38
colomon I think I got it built once on a PowerPC Mac with 512MB? Never got Rakudo built, however.
AlexDaniel s/you//
colomon and that was a few years back.
manchicken Are there x86_64 images for Debian/Ubuntu? 02:39
I keep getting this: make: *** [CORE.setting.moarvm] Error 137
And then the build fails.
02:40 molaf left
geekosaur hm. 137 *could* be a segfault (sadly error codes are not sufficiently expressive especially when filtered through a shell) 02:40
manchicken This looks like it may be relevant to what I've got going on: www.nntp.perl.org/group/perl.perl6....g2361.html 02:44
geekosaur ohg right, math wrong 137 = 128+9 02:45
that would be OOM
geekosaur should not math late at night
that is, you ran out of swap and the out-of-memory killer nuked it 02:46
manchicken Wee...
Gonna check launchpad...
02:47 bobby_ joined 02:48 perlawhirl joined
geekosaur basically there's only 3 ways to get "Killed" (signal 9): sending it explicitly, OOM killer, or a dynamically loaded symbol going unexpectedly missing after dlsym() found it 02:48
bobby_ 'p6: say 3;'
geekosaur the latter is hard to accomplish without doing some really evil things with dynamically loaded code, and I think you'd need to be abusing NativeCall to trigger it with perl6 02:49
so OOM is most likely
bobby_, the 's are not part of the bot command 02:50
manchicken Yeah, that's what I though.
bobby_ @geekosaur...was hoping nobody saw that fail :) lol, thanks for the tip though....I wonder how many times i have to try before getting it lol 02:51
just no apostraphe's right?
geekosaur right 02:52
m: 4.say
camelia rakudo-moar 8df1a6: OUTPUT«4␤»
bobby_ p6: say 3;
camelia rakudo-moar 8df1a6: OUTPUT«3␤»
geekosaur ("p6" would run all supported backends, which currently is rakudo-moarvm because rakudo-jvm is broken
bobby_ m: 4.say 02:53
camelia rakudo-moar 8df1a6: OUTPUT«4␤»
bobby_ what does the "m" mean? method call?
02:53 kalkin- left, kalkin-_ joined
bobby_ ah gotcha 02:53
geekosaur m is short for "moar" which is short for rakudo-moar 02:56
camelia: help
camelia geekosaur: Usage: <(nqp-parrot|pugs|debug-cat|star-m|star-j|nqp-js|prof-m|p5-to-p6|rakudo-jvm|std|nqp-jvm|nqp-moarvm|niecza|rakudo-moar|rakudo-MOAR|sm|nqp-q|p56|nqp-p|sj|n|Pnr|r-jvm|nPr|perl6|m|rj|r|rn|j|nqp-m|p6|r-m|rnP|star|nqp|rakudo|M|nrP|nom|nqp-mvm|nr|rPn|rm|P|nqp-j|r-j|Prn)(?^::\s(?!OUTPUT))
..$perl6_program>
geekosaur many of those are not currently functional: parrot backend is essentially dead, jvm is broken (they're working on it), std (basically a parse tester working against the spec) bitrotted when rakudo-moar started using a parser based on the spec instead of the original ad hoc one 02:58
pugs is still there but massively bitrotted, niecza is almost as badly bitrotted now 02:59
dalek Iish/mysql-prepare-t2: 7c8c93f | (Salvador Ortiz)++ | lib/DBDish/mysql/Native.pm6:
Cleanup, use our blob common functions

Noted by abraxxa++
03:00
Iish/mysql-prepare-t2: ec3de60 | (Salvador Ortiz)++ | lib/DBDish/mysql/StatementHandle.pm6:
Don't leak the binding structures
bobby_ thanks @geekosaur....yea i found it interesting it referenced pugs, parrot, and niecza 03:05
geekosaur it's still sometimes useful to refer back to them
bobby_ Is there ever any discussion on having both a JVM backend and the standard C bytecode moar vm is too much? 03:06
understood
I don't see a problem with that
geekosaur multiple targets is good, there's even a javascript backend in development although it's not part of the main project (yet)
keep in mind that much of perl 6 is written in itself and another chunk is written in nqp which is a sort of mini-perl6 that abstracts over the backend to some extent 03:07
the biggest problems tend to be not so much getting thinsg working, as doing so in a way that will play nicely with other stuff on the target (so for example making rakudo-java able to work with existing java stuff) 03:08
bobby_ Read Zoffix's artitcle mentioning JS today lol
manchicken Sadface. I can't find any suggestions on how to build with less RAM. 03:10
I was going to port the Net::AMQP::RabbitMQ natives over... 03:11
geekosaur (and if I understood correctly, the current JVM issue is actually 2 bugs, because moarvm should *also* be crashing... meaning there's also a moarvm bug somewhere) 03:12
bobby_ thanks geekosaur, do you know who is planning on using the JVM backend? 03:14
if Moar-VM ends up being pretty fast w/ the JIT, is the backend mainly for cooperating w/ the JVM kind of like how you can call Java libraries like Swing with Clojure? 03:15
geekosaur not offhand but people are actively working on it and that usually means they have plans to use it for something
manchicken Are people commonly using Java libs rather than porting Perl5 stuff over?
bobby_ I suppose that is logical :)
geekosaur perl6 compileable to java certainly has use casesd. none that I would be interested in, but then that's because I don't have much use for java in general 03:16
manchicken Well, RabbitMQ has a rather commonly used Java interface.
I help maintain the Net::AMQP::RabbitMQ module in Perl5 which uses XS to talk to librabbitmq-c. 03:17
bobby_ hmmmm manchicken...interesting thought....i guess having a JVM backend would give you access to thousands of modules? it wouldn't be nearly as fast as real java (guessing from Clojure, Scala, Groovy, Kotlin speeds which i hear are less optimized)
manchicken Do you still think it's a worthwhile endeavor to make a perl6 version?
I wanted to play with some of the new native stuff.
I suppose there may be many a perl5 XS developer asking themselves the same question. 03:18
dalek Iish: dddfba3 | (Salvador Ortiz)++ | / (2 files):
Use .dispose when needed
Iish: eb3dc55 | (Salvador Ortiz)++ | lib/DBDish/Connection.pm6:
Support for .execute method at Connection level

Keep last $dbh.rows after $sth.dispose
03:18 dalek left
manchicken I know Perl5 isn't going anywhere, but still... 03:18
03:19 dalek joined, ChanServ sets mode: +v dalek 03:21 bobby_ left
perlawhirl hi perler6, lil help 03:23
m: my %foo; %foo<bar>.push: 'this'; %foo<bar>.push: 'that'; say "#$_" for %foo<bar>;
camelia rakudo-moar 8df1a6: OUTPUT«#this that␤»
perlawhirl i expects '#this' and '#that'
where did i go wrong
03:23 BenGoldberg left 03:29 guest666_ left, noganex_ joined 03:30 manchicken left
perlawhirl ok it works if i .say for |%foo<bar>... but i don't understand why it's needed when %foo<bar> is an (Array) with 2 elems 03:31
sortiz m: my %foo; %foo<bar>.push: 'this'; %foo<bar>.push: 'that'; say "#$_" for @(%foo<bar>);
camelia rakudo-moar 8df1a6: OUTPUT«#this␤#that␤»
03:32 noganex left 03:33 nowan left
sortiz perlawhirl, If %foo<bar> is an Array and want to iterate it you can use @( ) ^^^ 03:33
03:34 cdg_ left
sortiz m: my $a = <a b c d>; say "List: $_" for $a; say "Elem: $_" for @$a; # In general 03:36
camelia rakudo-moar 8df1a6: OUTPUT«List: a b c d␤Elem: a␤Elem: b␤Elem: c␤Elem: d␤»
03:40 nowan joined
perlawhirl got it... i suppose i could just for %foo<bar>.list as well 03:42
sortiz perlawhirl, Remember that Hash (and Array) elements are Scalar "items", so in a for you need some expression to de-itemize them.
Yep
perlawhirl got it 03:43
thanks
04:19 tmch joined 04:21 perlawhirl left 04:35 AlexDaniel left 04:39 skids left 05:00 telex left 05:02 telex joined 05:14 vendethiel joined 05:24 vendethiel left 05:35 notostraca is now known as TEttinger 05:37 aindilis left 05:41 jack_rabbit left 05:45 Cabanossi left 05:48 Cabanossi joined, aindilis joined 05:49 dalek left 05:50 dalek joined, ChanServ sets mode: +v dalek 06:01 CIAvash joined 06:06 Cabanossi left, solarbunny left, solarbunny joined, dalek left 06:07 dalek joined, ChanServ sets mode: +v dalek 06:08 mojca joined 06:09 Cabanossi joined
MadcapJake is there a way to do a subset of a sub with a certain signature? 06:10
06:10 cpage_ left 06:27 pmurias joined, buharin joined
Hotkeys I feel like it should be as easy as doing 'subset Foo of Sub where *.signature ~~ :( ... )' 06:28
but it doesn't seem to be
m: sub Foo (Int $a) { $a * 2 }; subset IntSub of Sub where *.signature ~~ :(Int $); say &Foo.signature ~~ :(Int $); my IntSub &qux = &Foo; 06:31
camelia rakudo-moar 8df1a6: OUTPUT«True␤Type check failed in assignment to &qux; expected Callable[IntSub] but got Sub (sub Foo (Int $a) { #`...)␤ in block <unit> at /tmp/34eaNv09uV line 1␤␤»
06:34 cdg joined 06:35 raiph left 06:37 perlawhirl joined 06:39 cdg left, mohae left
perlawhirl Hotkeys: it sounds like you just need a multi? what is the subset of a sub (subsub?) for? 06:40
Hotkeys perlawhirl: I was responded to MadcapJake
responding*
perlawhirl so you were! 06:41
Hotkeys No idea what it'd be fore 06:42
for
06:46 [particle] left, [particle] joined 06:49 cpage_ joined 07:00 buharin left
timotimo the error above is because "my IntSub &qux" is syntax for "a sub that returns IntSub" 07:02
m: sub Foo (Int $a) { $a * 2 }; subset IntSub of Sub where *.signature ~~ :(Int $); my &qux where IntSub = &Foo 07:03
camelia rakudo-moar 8df1a6: OUTPUT«Type check failed in assignment to &qux; expected Callable[<anon>] but got Sub (sub Foo (Int $a) { #`...)␤ in block <unit> at /tmp/uJiIqMnMjN line 1␤␤»
timotimo hm.
07:08 mojca left 07:09 avalenn left 07:13 buharin joined
jdv79 how is that "low hanging fruit" moarvm config issue not fixed yet 07:14
07:16 matiaslina joined 07:22 perlawhirl left 07:23 buharin left
timotimo doesn't seem like many people feel comfortable contributing to moarvm 07:24
07:28 mojca joined 07:29 [particle] left 07:30 mojca left 07:31 [particle] joined 07:32 CIAvash left 07:34 wamba joined 07:40 domidumont joined, [particle] left 07:41 [particle] joined 07:44 domidumont left 07:45 domidumont joined 07:46 nadim joined 07:47 buharin joined 07:56 nadim left
moritz jdv79: because you didn't fix it :-) 07:56
07:58 nadim joined
timotimo fish: “sudo dnf update” terminated by signal SIGBUS (Misaligned address error) 07:59
*sigh*
08:00 isBEKaml joined, firstdayonthejob joined
jdv79 moritz: i think it might come down to that soon 08:01
timotimo huh, it looks like my tmpfs may be completely full? 08:02
oh, no, my / is just ... b0rked? 08:04
moritz time to take a backup, and reboot? 08:05
08:05 rindolf joined
timotimo it could be something went belly-up with my sata and thus the filesystem has effectively become read-only? 08:06
like, is this serious or just some random debugspam? [725331.903386] ACPI Error: [DSSP] Namespace lookup failure, AE_NOT_FOUND (20150930/psargs-359) 08:08
[725331.903390] ACPI Error: Method parse/execution failed [\_SB.PCI0.SAT0.SPT4._GTF] (Node ffff88040e0c96e0), AE_NOT_FOUND (20150930/psparse-542)
08:11 abraxxa joined 08:12 musiKk_ joined
timotimo well, the system came back up again 08:15
08:17 dalek left 08:18 dalek joined, ChanServ sets mode: +v dalek, [particle] left, darutoko joined 08:20 [particle] joined 08:22 fireartist joined 08:28 ely-se joined, dalek left 08:29 dalek joined, ChanServ sets mode: +v dalek, matiaslina left 08:36 nadim left 08:37 buharin left
Iish: 9186dd5 | (Salvador Ortiz)++ | lib/DBDish/Connection.pm6:
Connection.do dispose the sth after execute it

As Connection.do should not be used for SELECT statements warn if the passed statement produced rows
Iish: 12b19b7 | (Salvador Ortiz)++ | lib/DBDish/StatementHandle.pm6:
$sth.execute arity check centralized in role

  !enter-execute common method now can report inconsistencies between
expected and received parameters.
Iish: 5dea4e4 | (Salvador Ortiz)++ | lib/DBDish/Pg/ (3 files):
Pg: Add support for unprepared $dbh.execute
Iish: 81de0cb | (Salvador Ortiz)++ | lib/DBDish/ (3 files):
Adopt changed !enter-exectute + minor cleanup
Iish: 2c54b9a | (Salvador Ortiz)++ | / (2 files):
Make panda's users happy, now version 0.5.1
sortiz And dalek survived! 08:48
08:50 pmurias left 08:53 [particle] left 08:54 [particle] joined 08:55 M-tadzik is now known as tadzik 09:03 kaare_ joined
nine sortiz: not many pushes this time of day :) 09:07
09:08 maybekoo2 joined
sortiz nine, indeed :) 09:09
09:15 firstdayonthejob left 09:37 musca` joined
masak hi ok yeah so 09:38
what's the state of Heroku and Perl 6 these days?
is github.com/pnu/heroku-buildpack-rakudo still state-of-the-bleeding-edge? 09:39
has anyone tried it recently and wants to discuss it a bit? :)
09:39 musca left, boegel left, Exodist left, eyck left, eyck joined 09:40 musiKk_ left 09:43 boegel joined, maybekoo2 left 09:44 maybekoo3 joined 09:46 Exodist joined 09:47 eyck_ joined 09:48 solarbunny left, solarbunny joined, eyck left
pnu masak, should work but i'd be glad to hear & help if it doesn't. I'm a bit offline few days, though. Need to write some automated tests, really. 09:48
I have work in progress to combine perl and rakudo buildpacks here github.com/pnu/heroku-buildpack-pe.../christmas
masak pnu: you rock. thanks. 09:49
pnu: I'm going to try it today -- will report back with any pain points and stuff. 09:50
09:50 Woodi_ joined
masak I just have this feeling that what I want to do -- expose a small simple board game -- should be doable in a day or so of focused work. 09:50
just TDD up a minimal system, then expose it as REST through Bailador, then serve it through heroku. 09:51
09:51 Woodi left, solarbunny left, pnu left 09:53 solarbunny joined 09:55 pmurias joined 09:56 BooK joined
masak anyone else still use `expert PERL6LIB=lib` while developing? 09:58
nine I use alias prove6='prove -e '\''perl6 -Ilib'\'''
masak I keep hearing that it's gonna be removed and stuff, and that we'll transfer control to some futuristic module data store instead 09:59
nine nonsense
masak but to me, setting that env variable remains the easiest way to configure my dev environment
I confess to doing ^R on prove the whole time -- which probably means I should have an alias too :)
masak makes one
nine The futuristic module data store is for installed modules. Development trees are find and just SHOULD use a "lib" directory for module source code 10:02
10:02 johndau left
masak don't worry, I've been through this situation before :) the low-level, pragmatic, "dirty" solution tends to be quite tenacious. I'm not worried. 10:03
heh. never done a Spoonerism in a Unix command before. but I just did `mkdit r`. go home, brain, you're sleepy. 10:04
10:04 virtualsue_ joined, solarbunny left 10:08 FROGGS joined 10:09 solarbunny joined 10:11 pnu joined
moritz constantly types "gi tpull" and stuff like that, and has a shell function that autocorrects it for him 10:16
pmurias speaking of shells it would be awesome to one day replace bash with a Perl 6 REPL running a slang ;) 10:17
masak bash (and alikes) are a wonderful example of "worse is better". no-one actually *enjoys* the interpolation rules. but they're very hard to displace because they do a decent job and people are used to them. 10:19
10:23 pnu left, solarbunny left 10:25 virtualsue_ left
arnsholt Inertia is a powerful thing 10:25
10:28 gflohr joined, RabidGravy joined 10:30 pnu joined, solarbunny joined, pnu left, pnu joined
RabidGravy marnin! 10:30
10:30 wtw left
pmurias masak: the space for potential improvement seems small 10:31
10:31 virtualsue_ joined
masak pmurias: that's probably part of it too, yes. 10:31
but the interpolation rules are objectively horrible.
arnsholt And the error handling when you're scripting >.< 10:32
10:33 perlawhirl joined
masak right. shells haven't been updated to the async vision of this decade, either. 10:33
promises and channels in the shell: a killer app.
quick poll: do people tend to write `sub foo {}` or `sub foo() {}`, or is it kinda inconsistent what you tend to write?
I think I'm kinda inconsistent. 10:34
FROGGS I write the latter
10:34 labster left
FROGGS because it makes clear that there wont be any placeholder params in the sub body, so the potential reader dont need to scan for it 10:35
does not need*
10:35 wtw joined
RabidGravy mostly the latter, but it depends on the context 10:35
10:36 wtw_ joined, wtw_ left
masak I'm asking because I just found that when I add `is export`, then I also want to put in the empty parens for some reason. 10:38
10:40 pnu left
jnthn Maybe a visual pilling effect or something 10:40
10:41 solarbunny left
masak I suspect it's psychological 10:42
masak .oO( "the `is export` goes after the parameter list -- but there's no parameter list! let's add one" ) 10:43
10:43 Ven joined
Ven o/, #perl6 10:43
masak: hey, do you have a full list of your talk slides?
looking for the one you did at SPW15 :).
10:43 wtw left 10:44 wtw joined 10:45 vendethiel joined
masak I used to have a full list 10:46
pmurias Ven: \o
masak but I think it was on some pugs server, so that list is gone...
Ven masak: I tried masak.org/carl, and your blog, with no success
masak right.
Ven: masak.org/carl/yapc-eu-2015-interes...s/talk.pdf 10:47
Ven masak: thanks :)
masak this is practically the same version as happened in SPW2015. 10:48
10:51 solarbunny joined, pnu joined, pnu left, pnu joined
masak looking back at those slides, that slide stack is probably the closest to jnthn's esthetic I've ever produced :> 10:52
10:54 isBEKaml left 10:56 solarbunny left
timotimo jnthn: btw, writing $file.slurp.lines instead of $file.lines makes the heap analyzer come up like 1000x faster :) 10:57
jnthn timotimo: Wow. Then I sure better debug the perf issue in the first :) 10:58
timotimo measures it properly 10:59
2.30 instead of 1:44 11:01
Ven
.oO( who measures the measurer? )
jnthn I was happy it could do the BFS on a graph with hundreds of thousands of vertices and probably around half a million edges in just a few seconds. Would be nice to get it sub-second of course. :)
Ven (I was about to say "who rules the ruler", but I guess "ruler" can be different things :P)
timotimo we're probably trying to read the file byte-by-byte? 11:02
11:02 virtualsue_ left
timotimo so that we don't read more than we need for a single line? 11:02
jnthn timotimo: No, we grab it in chunks, but given where you said the hotspot is I think it's something silly about looking for separators.
timotimo hmm
right
32768 bytes per read call 11:03
jnthn It's unusual to have files with 10MB long lines :)
But should fix it :)
This is exactly the reason I wrote this thing in Perl 6, though. To show up some weak spots 11:04
11:04 solarbunny joined
timotimo right 11:06
jnthn I was pondering throwing off that BFS compuation in the background as soon as the Snapshot is constructed, so it'll be ready by the first path query :) 11:07
timotimo yeah, i'd like that
11:08 Ven left
timotimo * we do not encounter it, returns 9. This may mean more input buffers are needed 11:08
^- something tells me that 9 is wrong :)
11:09 vendethiel left
jnthn looks at his keyboard and sees 9 is right next to 0 :) 11:11
11:11 pnu left, virtualsue_ joined
masak that is the worst excuse ever :P 11:13
"the key's, they're right next to each other!" :P
keys*
11:14 pnu joined 11:16 wtw left, wtw joined 11:19 TEttinger left, musca` is now known as musca 11:20 wtw_ joined, wtw_ left 11:23 TeamBlast left 11:24 virtualsue_ left 11:26 TeamBlast joined 11:29 sivoais left
masak m: sub foo::bar() { say "OH HAI"; }; foo::bar() 11:29
camelia rakudo-moar 8df1a6: OUTPUT«Could not find symbol '&bar'␤ in block <unit> at /tmp/0zSiX9x7Qk line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/0zSiX9x7Qk line 1␤␤»
masak the fact that I'm able to declare `foo::bar` is a bit weird.
11:29 sivoais joined
masak is there a reason this is not disallowed? 11:29
m: say (sub foo::bar() { say "OH HAI"; }).name 11:30
camelia rakudo-moar 8df1a6: OUTPUT«foo::bar␤»
masak I can think of evil uses for this :> 11:31
jnthn m: sub foo::bar() { say "OH HAI"; }; &('foo::bar')()
camelia rakudo-moar 8df1a6: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤ in block <unit> at /tmp/1DkHoUdOsy line 1␤␤»
jnthn oh, duh
m: sub foo::bar() { say "OH HAI"; }; ::('&foo::bar')()
camelia rakudo-moar 8df1a6: OUTPUT«No such symbol '&foo::bar'␤ in block <unit> at /tmp/ayOM8k79yY line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/ayOM8k79yY line 1␤␤»
jnthn hmm
m: sub foo::bar() { say "OH HAI"; }; say MY:: 11:32
camelia rakudo-moar 8df1a6: OUTPUT«PseudoStash.new(("!UNIT_MARKER" => !UNIT_MARKER,"\$!" => Nil,"\$/" => Nil,"\$=finish" => Mu,"\$=pod" => [],"\$?PACKAGE" => GLOBAL,"\$_" => Any,"\$¢" => Nil,"\&foo::bar" => sub foo::bar () { #`(Sub|68241352) ... },"::?PACKAGE" => GLOBAL,:EXPORT(EXPORT),:GL…»
jnthn m: sub foo::bar() { say "OH HAI"; }; ::<&foo::bar>()
camelia rakudo-moar 8df1a6: OUTPUT«OH HAI␤»
jnthn hah!
masak :D
jnthn Yeah, I'm pretty sure that's not right ;)
masak .oO( you say you can't call it? look, it's EASY! ) :P
11:36 TeamBlast left
perlawhirl been playing with the markov. chain module... now you can experience the glory of #perl6 irc even if your internet goes down: hastebin.com/utiyokijup 11:40
it builds a markov chain for each users input
my favourite one i've seen so far is this one: [ jnthn: .oO( "The streets still smell like compact structs) ] 11:41
jnthn *lol* 11:42
RabidGravy years ago the #london.pm channel had a markov bot, it got quite scary at times 11:44
11:46 TeamBlast joined 11:47 musiKk_ joined
perlawhirl was reading about the taytweets thing earlier. scary... and disappointing, in a "this is why we can't have nice things" kinda way 11:48
gflohr I'm trying to understand how to use attributes: hastebin.com/xuyarigare.vhdl 11:50
why does p6 tell me that I did not provide a value for '$!template' here? 11:51
RabidGravy gflohr, because it has no accessor you can't set it from the constructor 11:52
either change the ! to a '.' or provide a "submethod BUILD($!template) { }"
jnthn Wants to be :$!template in the BUILD there 11:53
RabidGravy yeah
gflohr hm, is that explained somewhere? I know that the $.template helps me but I want the variable to remain private. 11:54
s/variable/attribute/
RabidGravy doc.perl6.org/language/classtut#Constructors may help 11:55
but you are basically limited to the BUILD alternative in that case 11:56
gflohr so, if I understand it correctly, the default constructor picks those named arguments that belong to an attribute with an accessor and silently ignores the rest? 11:58
RabidGravy yes
jnthn Generally, the principle is that you could be able to refactor any $!foo without having to care about code outside of the current class body. 12:00
Whereas $.foo is part of the public interface already, so we can offer some constructor convenience also
gflohr unless I provide a BUILD() submethod which I will have to do in 99 % of my uses cases. ;) 12:01
12:01 vendethiel joined
jnthn Well, if you have something that the consumer of a class gave you in the first place, it might be worth asking why you'd like to try and hide it ;) 12:01
12:02 kid51 joined
gflohr it could change over time and be something else, when the consumer wants it back 12:04
RabidGravy well in that case you can provide your own accessor
if you create a method with the same name as an attribute then the default accessor isn't created 12:05
jnthn True...it depends if you're seeding mutable state or throwing in something immutable I guess :) 12:06
gflohr At the moment that looks pretty weird and surprising to me. Maybe time will tell me. ;) 12:08
stmuk_ private in "is private" shock :)
gflohr atm I'm trying to figure out something useful that I could do in a constructor, when all my attributes are private but I can't see anything. 12:11
RabidGravy a quick survey reveals that only half of my modules have a BUILD and those with :$!foo because the BUILD does something more complicated 12:12
rudi_s How can I use a regex in a string and match something against it? like /$foo/ in perl5? AFAIK /$foo/ in perl6 matches the string verbatim.
jnthn /<$foo>/ 12:13
rudi_s jnthn: Thanks!
m0ltar Anyone building a web framework yet?)
RabidGravy there are several 12:14
m0ltar Anything similar to catalyst?
jnthn lunch &
RabidGravy not really, mostly more similar to Dancer 12:15
there is room for more if you have time on your hands
m0ltar Any plans for orm comparable to DBIC? 12:16
RabidGravy I'm sure someone has thought of it, not sure if anyone is actually working on it though 12:17
m0ltar Ok, thank you
RabidGravy it's sorta kinda on my todo list but in a next year or so kind of way
someone needs to make an sql abstraction thing first to bootstrap that 12:19
dalek ar: e5e742e | (Naoum Hankache)++ | docs/perl6intro.pdf:
update perl6intro
12:20
ar: 55c7d9f | lizmat++ | docs/perl6intro.pdf:
Merge pull request #66 from hankache/master

update perl6intro
m0ltar I see. That's hairy stuff.
nine RabidGravy: visitor macros may be very, very useful for an SQL abstraction 12:21
12:24 vendethiel left
stmuk_ in the sense of gist.github.com/masak/13210c51f034f931af0c ? 12:30
jnthn gflohr: github.com/jnthn/p6-app-moarvm-hea...l.pm6#L303 is an example of a more interesting BUILD that I wrote recently :) 12:32
12:33 vendethiel joined
El_Che_ puckish! 12:36
wrong channel: learning a new english word each day :) 12:37
12:37 El_Che_ is now known as El_Che
rudi_s Can I die without a stacktrace, like die "...\n" in perl5? 12:40
lizmat rudi_s: not afaik, closest thing is: note "foo"; exit 12:41
perlawhirl El_Che: As someone who's has only spoken English for his 30-something years, I don't think I've ever used the word puckish :D
jnthn rudi_s: Usual pattern is note "..."; exit 1 or so.
El_Che perlawhirl: :)
rudi_s lizmat: jnthn. Thanks.
jnthn had to look up puskish too :) 12:42
*puckish
El_Che it's a fun word :)
lizmat yes, very playful :-)
perlawhirl could someone point me in the direction of how to alias the .grep method. I'd like to play with an idea of calling it something else... 12:44
this actually comes from a language proposal (read: pipedream) i had: gist.github.com/0racle/ea0523759e2da15758d4
but if I can modularise it for now, I'd be happy with that.
i was looking at Any-iterable-methods.pm, is that a good place to start? should i just augment Any class? but honestly it kinda goes over my head a bit 12:46
12:47 gflohr1 joined, gflohr left
rudi_s lizmat: jnthn: Hm, that still prints the location. I guess I'll have to use $*ERR.say "..."; exit 1; 12:48
lizmat note prints the location ??? 12:49
m: note "foo:
camelia rakudo-moar 8df1a6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cw0aHNu8im␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/cw0aHNu8im:1␤------> 3note "foo:7⏏5<EOL>␤ expecting any of:␤ argument list␤ double quo…»
lizmat m: note "foo"
camelia rakudo-moar 8df1a6: OUTPUT«foo␤»
lizmat m: note "foo"; exit 1
camelia rakudo-moar 8df1a6: OUTPUT«foo␤»
rudi_s lizmat: Ah, damn. I'm stupid. I used warn instead of note. Sorry for the confusion. 12:51
12:54 andreoss joined
dalek c: e8e4479 | (Simon Ruderich)++ | doc/Language/5to6-perlfunc.pod:
5to6-perlfunc: document die "...\n" replacement
12:54
12:54 vendethiel left
jnthn rudi_s++ # docing it 12:55
rudi_s ;-)
RabidGravy perlawhirl, I've used "puckish" - but there again I studied Shakespeare for a literature degree :) 12:56
perlawhirl Good old Will... He was great with adjectives 12:57
lizmat
.oO( loop :puckish { } )
12:58
perlawhirl though i've only read macbeth, tho seen a handful of plays
double use of though... take that Wil!
RabidGravy nine, I'm sure they would be if I knew what they were ;-)
perlawhirl so, there seems to be a common theme when i ask about aliasing the grep method, in that i get no replies. 13:00
is a method as overarching as grep too much hassle to alias?
lizmat perlawhirl: there is currently an issue with augmenting core classes
perlawhirl so in the future it may be easier
lizmat if you augment a core class, its subclasses don't know about the augment
that's because children know about their parents in rakudo Perl 6, but parents don't know of their children 13:01
andreoss can i call class .new method inside of role which class will implement?
lizmat so when an augment is done to Any, only objects of type Any proper will see the augment
perlawhirl riiight. ok. that kinda squashes things.
lizmat which in practice means nobody sees it 13:02
you could probably augment the necessary subclasses manually, jnthn, any idea about that ?
RabidGravy I've got at least one augment (of DateTime) in a module, but that is for private purposes 13:03
and IO::Path::Mode kinda relies on it
jnthn lizmat: Even just a plain augment TheSubclass { } without putting the method in there will get it to recompute the cache 13:04
lizmat: uh, augment class TheSubclass { }
lizmat perlawhirl: ^^ 13:05
stmuk_ hmmm I suppose a crude activerecord type orm could be based in Slang::SQL 13:07
perlawhirl alright, i mean... i think doing this is still over my head, but i can keep poking around.
i'm still kinda feeling my way around the core... where else is the implementation of grep defined, other than Any-iterable-methods.pm 13:08
RabidGravy I've actually got the basic design of an ORM in my head but I think I'd actually wait until I'm writing an application with such a thing 13:09
lizmat perlawhirl: ack 'method grep' src/core
perlawhirl alright, ta
RabidGravy I was kept awake for a few hours thinking about a framework-less framework for REST applications 13:10
Ulti is there an example of using NativeCall with C++ classes anywhere?
13:11 skids joined
RabidGravy Ulti : github.com/jonathanstowe/Audio-Soundtouch - may get you started, not finished as I blocked on working out how to test it :) 13:11
Ulti excellent thanks 13:12
RabidGravy I actually started making it with a C wrapper the the lovely FROGGS++ implemented the C++ stuff so I started again 13:13
Ulti so 'is cpp-symbol' for a class with the CPPStruct representation means symbols from that class rather than something global or in another one? 13:14
RabidGravy oh that's not part of nativecall I made it for this because of the funny way the soundtouch uses namespace to avoid ugly class names 13:15
Ulti oh so its normally just symbol 13:16
RabidGravy it's just an enhanced 'symbol' trait that knows about CPP namespaces
Ulti hmm the multi sub trait_mod is a tricky thing to notice the relationship between the trait name
yup got it 13:18
13:16 < RabidGravy> it's just an enhanced 'symbol' trait that knows about CPP namespaces
oops
multi sub trait_mod:<is> ( Routine $r, Str :$cpp-symbol!) <--- not so obvious cpp-symbol is the important thing to relate to the rest of the code
guess thats where macros come in :) 13:19
13:24 Sgeo__ left
RabidGravy to be honest my brain would scan for trait definitions differently 13:26
looking for the definition of an is trait -> find " sub trait_mod:<is>" -> find the one with the second named argument the trait in question 13:27
13:31 vendethiel joined
Ulti thats because you know how traits are defined already 13:33
anything is intuitive if you already know how to do it :P
RabidGravy well that would be either a fault with the documentation or hubris on your part ;-p 13:35
Ulti I'd go with the hubris 13:41
also chatting direct with the author and then reading the code was enough to learn :P which is my preference to documentation
sure I stole some of your time, but I'll pay it forwards promise
RabidGravy :) You could write a digest authentication thingy 13:42
13:42 dvinciguerra joined
RabidGravy there are loads of things that I surprised that people haven't made 13:43
or they have made perhaps and kept secret
Ulti in Perl 6 land or more generally 13:44
RabidGravy in perl 6
Ulti might be its not so obvious how to get things into the ecosystem, I'll check the docs ;P 13:45
mst "but but but why didn't some already write this?" is one of the best motivators for writing stuff, I find
Ulti or checking stack overflow for a complete implementation that no one bothered to put anywhere else
skids
.oO(or they made it and it broke and they haven't gotten to fix it)
RabidGravy mst, that's how I ended making 7% of the ecosystem 13:47
(and afaik they all still work :)
Ulti I find I rarely need stuff outside of core, which is fairly incredible.. I think perhaps a lot of people dont realise quite how much comes baked in when looking at the ecosystem 13:49
13:52 vendethiel left
DrForr It's a huge core, stuffing all of that in your head takes effort. 13:52
Ulti yup
pmurias RabidGravy: hopefully you don't unpublish them just to cause chaos ;) 13:53
andreoss m: class Foo[::E] { }
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xxbG5yWg1O␤Unable to parse class definition␤at /tmp/xxbG5yWg1O:1␤------> 3class Foo7⏏5[::E] { }␤ expecting any of:␤ generic role␤»
andreoss m: role Foo[::E] { }
camelia ( no output )
skids classes cannot be paramaterized (except through MOP black magic) 13:54
andreoss why there's no generic classes only roles?
gflohr1 Is there something like a forward declaration for a type? hastebin.com/ejawesejuc.rb
skids I don't know the answer to "why" though.
mst andreoss: surely you just do 'class with <parameterized role>' 13:55
skids gflohr1: Yes, a yada stub.
mst andreoss: a class is generally expected to be something you can and do instantiate
gflohr1 skids: what is a yada stub? 13:56
andreoss but i can instantiate roles too?
skids m: class C {...}; class D { has C $.d; }; class C { };
camelia ( no output )
andreoss m: role Foo[::E] ; my $x = Foo[Str].new; say $x.perl
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AAiqHC4zpV␤Semicolon form of 'role' without 'unit' is illegal. You probably want to use 'unit role'␤at /tmp/AAiqHC4zpV:1␤------> 3role Foo[::E] ;7⏏5 my $x = Foo[Str].new; say $x.perl␤»
andreoss m: role Foo[::E] { }; my $x = Foo[Str].new; say $x.perl
camelia rakudo-moar f220a5: OUTPUT«Foo[Str].new␤»
skids properly said you pun the role to a class and instantiate that. 13:57
andreoss what can classes do that roles don't?
mst andreoss: yeah, that's basically doing exactly what I said
RabidGravy pmurias, nah. MInd you I'm not convinced anyone actually uses them
mst andreoss: it turns it into a class and instantiates that 13:58
gflohr1 skids: is there a working example for that? I get a "Redeclaration of symbol …"
mst andreoss: roles can't be instantiated, that doesn't make any sense
andreoss mst: it looks like they can
skids gflohr1: more working than the one that worked above?
andreoss especially when i .new on them
RabidGravy gflohr1, the '...' there is important
mst andreoss: skids> properly said you pun the role to a class and instantiate that.
skids The ... is the "yada" 13:59
mst andreoss: so, no, it doesn't, and you were already told what was happening instead :)
andreoss >you pun
not me, perl
skids Of note is that you are punning exactly Foo[Str] not Foo[whatever you want here].
gflohr1 skids: thanks, got it now
andreoss skids: Foo[Str] would be the class then? 14:00
RabidGravy Thing of it as doing " (class {} but Foo[Str]).new"
skids yes.
mst almost like what I said in the first place :) 14:02
skids As to what roles can do that classes cannot: they can stub interfaces and be incomplete.
andreoss m: role Z[::E] { } Z[Str].WHAT.say
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rBUj48N2YO␤Missing infix inside S␤at /tmp/rBUj48N2YO:1␤------> 3role Z[::E] { } Z[S7⏏5tr].WHAT.say␤ expecting any of:␤ bracketed infix␤ infix␤ infix stopper␤»
andreoss m: role Z[::E] { } ; Z[Str].WHAT.say
camelia rakudo-moar f220a5: OUTPUT«Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CurriedRoleHOW'␤ in block <unit> at /tmp/bB1ASui4oZ line 1␤␤»
skids m: role Z[::E] { } ; Z[Str].new.WHAT.say 14:03
camelia rakudo-moar f220a5: OUTPUT«(Z[Str])␤»
andreoss m: role Z[::E] { } ; (class :: does Z[Str]).WHAT.say
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1E7vPXzYZe␤Unable to parse class definition␤at /tmp/1E7vPXzYZe:1␤------> 3role Z[::E] { } ; (class :: does Z[Str]7⏏5).WHAT.say␤»
mst hence why roles are not instantiable directly, but perl6 will convert them into an empty class with that role if it can
andreoss m: role Z[::E] { } ; (class :: does Z[Str] { }).WHAT.say
camelia rakudo-moar f220a5: OUTPUT«(<anon|79295984>)␤»
andreoss m: class Z { } ; Z.WHAT.say 14:04
camelia rakudo-moar f220a5: OUTPUT«(Z)␤»
14:04 musiKk_ left, jameslenz joined
skids m: role Z[::E] { } ; Z[Str].^pun.WHAT.say 14:04
camelia rakudo-moar f220a5: OUTPUT«(Z[Str])␤»
skids m: role Z[::E] { } ; Z[Str].^pun.HOW.WHAT.say 14:05
camelia rakudo-moar f220a5: OUTPUT«(ClassHOW)␤»
skids m: role Z[::E] { } ; Z[Str].HOW.WHAT.say
camelia rakudo-moar f220a5: OUTPUT«(CurriedRoleHOW)␤»
RabidGravy what larks
andreoss so if i need a parametric class, i use role instead 14:08
14:08 mullagain joined
RabidGravy yes 14:09
andreoss and i could use roles everywhere instead of classes
mst just like if you thought you wanted an abstract base class, you should use a role instead
gflohr1 skids: But my classes are defined in different files. When I put the stub into the parent, I get an "insufficiently type-like", when the stub is in the child, I get "the following packages were stubbed but not defined".
mst er, no, you're still using classes, as we've explained
you're just letting perl6 auto-create a class that consumes the role for you
rather than doing so explicitly
RabidGravy gflohr1, correct. It only works in the same file 14:10
skids Though NativeCall and a few other spots use deep MOP magic to have paremeterized types for some (probably-REPR-related) reason.
gflohr1: A pattern that relieves that is to use a role that defines an interface in a third file, and only restrict types to things that "do" that role. 14:12
gflohr1 skids, RabidGravy: thanks! The role should do the job.
RabidGravy yeah, someone ought to write something up about that as it keeps coming up 14:13
14:13 maybekoo3 left 14:15 Actualeyes left
andreoss `method foo(A:B:)` what is the name of this notation in signature? 14:15
moritz andreoss: the trailing : is the invocant marker 14:18
and the :D or :U is a type smiley
(at least that's what I call it)
skids I think that name has pretty much stuck at this point. 14:20
14:22 dvinciguerra left 14:24 wtw left, wtw joined
pmurias jnthn: a QAST::Var with a scope of typevar is allowed to have a compile time value? 14:26
14:27 andreoss left
SmokeMachine____ m: say Int ~~ Int:U 14:28
camelia rakudo-moar f220a5: OUTPUT«True␤»
pmurias jnthn: it's set on $?CLASS and from reading the code it only seems like it's used for the hint
jnthn pmurias: iirc, it behaves entirely like lexical in everything other than saying that the implementation is allowed to assume that for a given type of the first argument it will always resolve to the same thing 14:29
RabidGravy m: (proto sub (|) foo { * }; ); # Hmmm
camelia rakudo-moar f220a5: OUTPUT«===SORRY!===␤Cannot find method 'Str'␤»
SmokeMachine____ m: say Int:D ~~ Int:U
camelia rakudo-moar f220a5: OUTPUT«True␤»
jnthn pmurias: If you don't have use for that information you can compile it just like lexical
pmurias: On Moar we emit a different lookup instruction
14:30 wtw left
SmokeMachine____ m: say Int:U.isa(Int) 14:30
camelia rakudo-moar f220a5: OUTPUT«Too many positionals passed; expected 2 arguments but got 3␤ in block <unit> at /tmp/KHfP4p0il3 line 1␤␤»
14:30 wtw joined
jnthn pmurias: We actually don't interpret it any differently from a normal lexical lookup, but spesh will use it if it specializes on the first argument. 14:30
It means that when producing specialized versions of code inside of roles, it can specialize attribute access and method dispatch 14:31
Hm, it could get dispatch anyway I guess. But not attr access :)
14:35 cdg joined, Actualeyes joined
MadcapJake is there a way to do a subset of a sub with a certain signature? 14:37
moritz m: subset Intish of Code where { .signature ~~ :(Int --> Int) }; say sub (Int --> Int) {} ~~ Intish; say sub (){} ~~ Intish 14:39
camelia rakudo-moar f220a5: OUTPUT«True␤Cannot call 'shift' on an immutable 'List'␤ in block <unit> at /tmp/1EtshWMyzC line 1␤␤»
moritz looks like a bug to me 14:40
14:40 |Sno| left
moritz presumably in the signature smart-matchin code 14:40
RabidGravy I think I reported that one a while back
MadcapJake m: subset BinInt of Sub where *.signature ~~ :(Int, Int --> Int); sub adder(Int $a, Int $b) { $a + $b }; say &adder ~~ BinInt; 14:42
camelia rakudo-moar f220a5: OUTPUT«False␤»
masak m: say :($foo) ~~ :($foo)
camelia rakudo-moar f220a5: OUTPUT«True␤»
masak m: sub x($foo) {}; say &x.signature ~~ :($foo) 14:43
camelia rakudo-moar f220a5: OUTPUT«True␤»
MadcapJake why is that false?
masak MadcapJake: because `adder` doesn't declare a return type?
MadcapJake I tried that too, same False
m: subset BinInt of Sub where *.signature ~~ :(Int, Int --> Int); sub adder(Int $a, Int $b) returns Int { $a + $b }; say &adder ~~ BinInt; 14:44
camelia rakudo-moar f220a5: OUTPUT«False␤»
RabidGravy I've got a workaround for testing a signature against a possible empty one in some module
oh yes, " subset ValidateCallback of Callable where { $_.signature.params && $_.signature ~~ :(Object --> Bool) };" 14:45
github.com/jonathanstowe/Tinky/blo...ky.pm#L758 14:46
skids m: subset BinInt of Sub where { *.signature ~~ :(Int, Int --> Int) }; sub adder(Int $a, Int $b) returns Int { $a + $b }; say &adder ~~ BinInt; 14:48
camelia rakudo-moar f220a5: OUTPUT«False␤»
skids m: subset BinInt of Sub where { $_.signature ~~ :(Int, Int --> Int) }; sub adder(Int $a, Int $b) returns Int { $a + $b }; say &adder ~~ BinInt;
camelia rakudo-moar f220a5: OUTPUT«True␤»
MadcapJake oh so its the WhateverStar that doesn't work here 14:49
RabidGravy yeah
skids Or some precedence thing.
MadcapJake cool! That's pretty sweet that subset can work on function signatures! 14:50
14:51 bjz_ joined 14:52 bjz left 14:53 sno joined
MadcapJake is there any way to indicate in a signature that a sub returns nothing (aka void) 14:55
jnthn --> Nil
MadcapJake cool! 14:56
Juerd No, not --> Cool :P 14:59
14:59 vendethiel joined
moritz want's a Whenever star 15:00
Juerd What does that mean?
moritz just like a Whatever star, only temporal :-)
15:00 cdg_ joined
Juerd whenever * { ... } 15:00
jnthn oh man, what on earth would that mean... :P 15:01
15:01 cdg left
moritz whenever you feel like, execute this for me, will you? :-) 15:01
like, an idle ticker
Juerd jnthn: Currently it seems to mean "do this now" :) 15:02
Once
15:02 keix left
jnthn m: (*).Supply.tap(&say) 15:02
camelia ( no output )
15:02 keix joined
jnthn m: my $x = *; $x.Supply.tap(&say) 15:03
camelia rakudo-moar f220a5: OUTPUT«*␤»
jnthn hah :)
'cus any item turned into a Supply will make a 1-item supply... :)
skids m: my $x = *; $x.Supply.tap(*.say) # might as well pile it on :-) 15:05
camelia rakudo-moar f220a5: OUTPUT«*␤»
MadcapJake how can I get whether I'm on linux or windows? $*DISTRO prints "ubuntu ..." 15:12
mst it is extremely useful to be able to do the equivalent of 'execute this for me in a minute' 15:13
in single threaded stuff, 'handle all currently outstanding I/O events then call this after'
MadcapJake oh $*KERNEL, what will $*KERNEL print for Windows?
jnthn m: say $*KERNEL.is-win 15:15
camelia rakudo-moar f220a5: OUTPUT«Method 'is-win' not found for invocant of class 'Kernel'␤ in block <unit> at /tmp/WihUCmuA8s line 1␤␤»
jnthn m: say $*DISTRO.is-win
camelia rakudo-moar f220a5: OUTPUT«False␤»
jnthn There's that
15:15 labster joined
masak m: class Whenever {}; sub term:<★>() { Whenever.new }; say ★; # moritz: here you go 15:15
camelia rakudo-moar f220a5: OUTPUT«Whenever.new␤»
MadcapJake oh ok that'll do, thanks!
jnthn $*KERNEL.name says win32 on Windows though
Even when it's 64 bit :) 15:16
MadcapJake strange, why is that?
15:16 abaugher left
jnthn History or something :) 15:16
I suspect 'cus it's really a reference to the API though 15:17
15:17 abaugher joined
masak .oO( seems to be the kind of history that repeats itself, probably because we don't know it well enough ) 15:17
15:19 mohae joined, nowan left 15:21 vendethiel left 15:22 nowan joined
gflohr1 how do I check whether an instance does a certain role? $instance.does($role-name) does not seem to work. 15:30
Found it, while typing the question. ;) I have to pass the type object. Logical. 15:31
jnthn Can also smart-match: $instance ~~ Role 15:33
gflohr1 good to know 15:34
15:35 perlawhirl left 15:38 ptolemarch joined 15:39 virtualsue_ joined
masak frustration: when the test frameworks outputs 'got' and 'expected' values, and they're *exactly the same* 15:40
framework*
15:42 kid51 left, kid51 joined 15:44 fireartist left
masak ah. except for a single space. that was hard to see. 15:44
masak ponders some sort of diffing
15:45 virtualsue_ is now known as sue 15:56 labster left
arnsholt My first port of call in those cases is vimdiff 16:01
The plain diff tool can probably be made to highlight only the differences too, not just changed lines
But those are super-annoying, yeah
16:11 kurahaupo joined
rudi_s What is the difference between sub foo() is native(...) { * } and without the *, it seems to work fine without the * as well. 16:13
16:14 dvinciguerra joined, ely-se left 16:15 sue left
masak arnsholt: thanks for the tip. 16:17
arnsholt: I think I want it as part of my test results.
FROGGS rudi_s: the * indicates that "somebody else is doing the work for this sub", like in a proto
timotimo right, diff has a "--word-diff" flag, or at least a mode that is called that 16:18
well, git diff does anyway
rudi_s FROGGS: But it works without it too?
FROGGS rudi_s: yes
timotimo and git diff, of course, has the --no-index flag to use it on regular files
FROGGS rudi_s: in fact, you can put anything in the sub body and it will work I guess...
jnthn rudi_s: It's just convention/documentation
rudi_s FROGGS: Ok. But it's still recommended to use the *?
FROGGS rudi_s: it wont reach that code
rudi_s: aye
rudi_s Ok. Then I'll fix the example in the docs. 16:19
FROGGS rudi_s++
16:20 dvinciguerra left
rudi_s I think I asked this already, but why exactly is there not "native_int" type in NativeCall? It feels problematic to call a C function foo(int) as foo(int32). 16:20
jnthn It's called cint, no? 16:21
m: use NativeCall; say cint
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oJDeXMve2U␤Undeclared routine:␤ cint used at line 1␤␤»
jnthn m: use NativeCall :types; say cint
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3_ryPzrhFn␤Undeclared routine:␤ cint used at line 1␤␤»
jnthn m: use NativeCall :types; say ::MY.keys
camelia rakudo-moar f220a5: OUTPUT«()␤»
jnthn m: use NativeCall :types; say ::MY
camelia rakudo-moar f220a5: OUTPUT«(MY)␤»
jnthn m: use NativeCall :types; say ::MY::.keys 16:22
camelia rakudo-moar f220a5: OUTPUT«(Pointer ulonglong $=pod CArray bool !UNIT_MARKER void ulong EXPORT $_ $! &postcircumfix:<[ ]> long ::?PACKAGE GLOBALish $¢ OpaquePointer size_t $=finish longlong $/ $?PACKAGE)␤»
jnthn hm
FROGGS rudi_s: use int32
rudi_s I haven't looked at the code, just the documentation and there int32 is explicitly mentioned to be used for int.
Well, it's not the same.
jnthn Technically.
FROGGS rudi_s: do you know of any arch that has a 16bit int?
rudi_s Architectures can use a 2 byte int for exampple.
jnthn Pragmatically though... :)
masak .oO( Designing for Fantasy Architectures ) 16:23
rudi_s Yes, micro controllers do, for example atmels.
jnthn Right, and the chances of us running on those is...? :) 16:24
timotimo oh, it'd be amazing if we ever get to run on such a small thing as an atmel
rudi_s (Not sure I'd want to use perl6 on them, but still. Doesn't feel right.)
masak how much memory does such a microcontroller have avaiable? :)
16:24 abraxxa left
timotimo couple of megabytes 16:24
masak yeah, good luck with that 16:25
rudi_s ;-)
masak that sounds like a small fraction of the setting
or the parser, even
rudi_s Anyway, another thing. Can somebody explain the explicitly-manage example in the docs to me? I don't see a reason to use explicitly-manage for const char *.
*functions taking. 16:26
Isn't this more about the fact, that the function stores the pointer somewhere and will free it later (which conflicts with the const).
Oh, and are unsigned values supported? The examples mix unsigned and signed which also seems problematic. 16:27
timotimo they are supported
16:28 firstdayonthejob joined 16:30 domidumont left
stmuk_ could nqp run on v low spec h/w if not p6 itself? 16:32
timotimo that'd be much easier at least, but we'd still have stuff like wanting to do filesystem access and stuff via libuv 16:33
rudi_s timotimo: Any docs available? 16:35
doc.perl6.org's NativeCall doesn't list it under available types.
timotimo hm, don't know 16:36
rudi_s Any examples available. Or should I look at the code?
16:36 sue joined
timotimo perl6 itself supports unsigned native and non-native unsigned ints, too 16:37
and nativecall attempts to support it as good as it can
16:38 vendethiel joined 16:46 Upasaka left, Upasaka joined 16:48 sue left 16:52 rurban joined 16:53 rurban left 16:54 sue joined 16:59 vendethiel left 17:01 sue left 17:05 khw joined 17:08 jack_rabbit joined 17:13 gflohr1 left 17:14 buharin joined
MadcapJake rudi_s: I think explicitly-manage has to do with the fact that const means "this function will not be doing anything but reading the string" and thus we want to make sure that it's not inadvertently freed after the function is called 17:16
anyone know if my assumption is right? :P 17:17
17:18 wtw left, wtw joined
rudi_s MadcapJake: But a function like strcmp() is also const char * and I see no reason to do anything special with the string. After it was used by the function in be freed. 17:19
s/in be/it can be/ 17:20
arnsholt explicitly-manage is to handle the case where the C-level string needs to be freed at some later point than after the C function it is passed to returns 17:22
MadcapJake then in that case, maybe you don't need to explicitly-manage it, but what if you intend to do something else with that string?
arnsholt So strcmp doesn't need it
It originally came up with one of the DBD drivers (Postgres?) where you bind values when executing one by one through function calls, but the C strings need to remain alive until after the *execute* has returned 17:23
It's also a horrible, horrible hack, and should probably not be used unless you have it in legacy code
MadcapJake explicitly-manage is? 17:24
arnsholt The correct solution would be to decode the string into a CArray
rudi_s Maybe we should remove it from the docs then or at least make it less visible (and not talk about const char *). 17:25
MadcapJake explicitly-manage is listed in the docs as "if you get const char *, then you need to use this)
MadcapJake doesn't know why he started with a double quote and ended with a parenthesis :P
17:25 andreoss joined
rudi_s MadcapJake: Yes. Which is incorrect (or at least confusing). 17:26
arnsholt I'm not sure why it talks about const there. It's about lifetime, not constness
rudi_s Yeah.
RabidGravy the const char * thing could be somewhat of a red herring, it's used both ways surely
MadcapJake I think it's because const on an argument means the function isn't going to mess with it 17:27
arnsholt Of course, if the C code modifies the buffer you're gonna have *terrible* time, since the Perl string will be unchanged, while the C buffer has something else in it
MadcapJake arnsholt: doesn't const specifically guard against that kind of thing? 17:28
17:30 orion7273 joined
arnsholt Yeah, so Str should only be used for const arguments in NativeCall 17:30
rudi_s arnsholt: Could you provide a minimal example how to decode the string into a CArray with a correct lifetime?
arnsholt Well, then it's simply a question of keeping the reference to your CArray alive until it can be freed 17:31
I think there's a library with helpers that can do the decoding directly from Str to CArray. NativeHelpers::Buf?
'Sec
NativeHelpers::Blob 17:33
And it only does the copying of Blobs
So first you Str.decode which can then be passed to NativeHelpers::Blob's functions to get a CArray
github.com/salortiz/NativeHelpers-Blob
RabidGravy but in the general case it boils down to CArray[uint8].new($str.encode.list) 17:34
17:34 jack_rabbit left 17:40 perturbation joined
rudi_s arnsholt: How can I guarantee that the reference isn't freed? 17:41
arnsholt Stick it in a variable that doesn't go out of scope until the last function needing it to be alive has been called 17:43
(And don't overwrite it with something else, obv.)
17:46 cognominal joined 17:47 ChristopherBotto joined, ChristopherBotto left, ChristopherBotto joined 17:50 gflohr joined, buharin left 17:52 colomon left, colomon joined 17:56 nadim joined
rudi_s arnsholt: Untested patch: pbot.rmdir.de/t9yIXNEHK8mtJ3QO5xxfSA <- what do you think? 17:58
arnsholt Looks good! 17:59
MadcapJake is there a way to do an #if directive style thing in Perl 6? I need some top-level things per OS 18:00
[Coke] use if.
timotimo [Coke]: i think the problem about that is having curlies introduces an extra lexical scope 18:01
ChristopherBotto I didn't find a test in roast for symlink. Is is correctly implemented as symlink($new, $original) as mentioned at doc.perl6.org/routine/symlink or is it supposed to be symlink($original,$new) as suggested by doc.perl6.org/language/5to6-perlfunc#symlink ?
timotimo oh, you mean the module "if" :)
[Coke] no, I just meant if
timotimo oh, ok
well, you can use "use if" if you don't want to have curlies
MadcapJake so two questions then, (1) can I use an if to introduce special OS-specific class attributes? and (2) will classes pass down into the top-levle scope from an if's scope? 18:03
18:04 orion7273 left 18:05 gflohr left
rudi_s arnsholt: Looks like I need to use "sub set_foo(CArray[uint8]) is native('./foo') { * }" <- is the Carray[uint8] part correct? 18:05
MadcapJake m: if $*DISTRO.is-win { class Foo { has $.a = 12 } }; my Foo $f .= new; say $f.a; # why is this class passing into the outer scope? 18:07
camelia rakudo-moar f220a5: OUTPUT«12␤»
timotimo could this "abizy.com" thing go die in a fire? :\ 18:08
classes always do that
for classes you'd need "my class foo" to get the opposite
MadcapJake so I can't use a conditional to introduce OS-specific classes?
but then it will be stuck in the scope!
timotimo then just return it from teh scope :) 18:09
MadcapJake how do you mean?
18:09 domidumont joined
timotimo m: constant Foo := do if $*DISTRO.is-win { my class Foo { has $.a = 12 } } else { my class Foo { has $.a = 99 } }; say Foo.new() 18:09
camelia rakudo-moar f220a5: OUTPUT«Foo.new(a => 99)␤»
dalek c: da14965 | (Simon Ruderich)++ | doc/Language/5to6-perlfunc.pod:
5to6-perlfunc: fix typo
c: 2daee8b | (Simon Ruderich)++ | doc/Language/operators.pod:
operators: fix typo in comment
c: 52daa5d | (Simon Ruderich)++ | doc/Language/nativecall.pod:
nativecall: replace explicitly-manage hack with better example
MadcapJake so you have to set it to a constant 18:10
timotimo yeah, it really should be compile-time evaluated
otherwise you can't use it for most things you'd want to use a class for
like type constraints
MadcapJake right that's specifically what I'm looking for 18:11
so do you mean it won't be compile-time evaluated?
timotimo what won't be?
MadcapJake you mean the constant declarator will mean it is compile-time evaluated? 18:12
timotimo that's right
MadcapJake ok gotcha
timotimo the RHS of a constant's = is CTE'd
MadcapJake is constant in the docs anywhere? 18:13
oh it's in language/terms 18:14
18:14 andreoss left, gflohr joined
timotimo we really don't seem to have any mention of unsigned ints and stuff in doc.p6.org 18:15
18:15 cpage_ left
MadcapJake wishes there was a way to do something similar to C/C++ #if constructs 18:15
18:16 Begi joined
timotimo you can do things in your custom BUILD.pl or whatever 18:16
MadcapJake true, I could also place stuff in a module and then use that if module, that would work right?
timotimo yeah 18:17
ChristopherBotto m: shell("touch junk.txt"); symlink("junk2.txt","junk.txt"); 18:19
camelia rakudo-moar f220a5: OUTPUT«shell is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub shell at src/RESTRICTED.setting line 15␤ in block <unit> at /tmp/BWKBNsjAHB line 1␤␤»
18:20 vendethiel joined 18:22 nadim left
ChristopherBotto m: run('touch','junk.txt"); symlink('junk2.txt','junk.txt'); 18:23
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/5YTIP4GeeE␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/5YTIP4GeeE:1␤------> 3run('touch','junk.txt"); symlink('7⏏5junk2.txt','junk.txt');␤ expecting any of:␤…»
ChristopherBotto m: run('touch','junk.txt'); symlink('junk2.txt','junk.txt'); 18:24
camelia rakudo-moar f220a5: OUTPUT«run is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub run at src/RESTRICTED.setting line 14␤ in block <unit> at /tmp/l5jDlwI6yC line 1␤␤»
timotimo camelia won't let you do stuff with the FS so easily
MadcapJake m: class Boz { has $.a = 1; if $*DISTRO.is-win { has $.b = 2 } else { has $.c = 2 } }; my Boz $b .= new; say $b; # so I can't use conditional for class attributes either :(
camelia rakudo-moar f220a5: OUTPUT«Boz.new(a => 1, b => 2, c => 2)␤»
18:24 colomon left
MadcapJake could I put that conditional inside the BUILD submethod? 18:24
timotimo touch junk.txt; perl6 -e 'symlink "junk2.txt", "junk.txt"'; ls -lisah junk* 18:25
=> 8646806 4.0K lrwxrwxrwx. 1 timo timo 8 Mar 25 19:24 junk2.txt -> junk.txt
8646791 0 -rw-r--r--. 1 timo timo 0 Mar 25 19:24 junk.txt
18:25 bloop joined
timotimo MadcapJake: you can create the class with the MOP 18:25
bloop hi
18:25 itaipu joined
bloop is anyone alive? 18:25
timotimo hello bloop!
18:25 bloop is now known as Guest58846
timotimo we're mostly managing the staying alive thing 18:26
MadcapJake Guest58846: nope, I'm undead
timotimo: how do you do that?
timotimo i dunno, it comes naturally to me to eat, breathe, and drink
MadcapJake don't forget sleep!
RabidGravy MadcapJake, if you want to do something like that at runtime consider a role 18:27
ChristopherBotto timotimo: thanks
RabidGravy or roles
Guest58846 who needs sleep when we have perl?
timotimo you can't apply roles to a type object, though
like, after the class has been composed, i mean
MadcapJake RabidGravy: you can conditionally apply a role? do you mean with but/does?
timotimo what you can of course do is write a slang that'll let you write #?if windows or somethinglike that
RabidGravy timotimo, can't you? 18:28
timotimo m: class Test { }; role Test2 { }; Test does Test2
camelia rakudo-moar f220a5: OUTPUT«Cannot use 'does' operator with a type object.␤ in block <unit> at /tmp/_JIzAZcfcL line 1␤␤»
timotimo m: use MONKEY-TYPING; class Test { }; role Test2 { }; augment Test { also does Test2 }
camelia rakudo-moar f220a5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YSw0de87l_␤Malformed augment␤at /tmp/YSw0de87l_:1␤------> 3s Test { }; role Test2 { }; augment Test7⏏5 { also does Test2 }␤»
timotimo m: use MONKEY-TYPING; class Test { }; role Test2 { }; augment class Test { also does Test2 }
camelia ( no output )
18:29 gflohr1 joined, gflohr left
timotimo ^- only with monkey typing, but that's not something you can put into an if statement 18:29
RabidGravy m: class Foo {}; say (Foo but role { }).new
camelia rakudo-moar f220a5: OUTPUT«Foo+{<anon|59662320>}.new␤»
18:29 wamba left
timotimo that doesn't change the class Foo :) 18:29
Guest58846: how can we help you today?
Guest58846 tell me please, for what purpose do you usually use perl? 18:30
RabidGravy writing software
timotimo i quite enjoy using it to do one-off jobs like bulk renaming, transforming files in-place when i need more than just a little regex 18:31
also grabbing values, like statistics, out of a random weirdly-formatted file (usually printf debug output)
Guest58846 RabidGravy: yeah, but what type of software exactly? 18:32
cool
timotimo exploratory programming is fun with perl6. like, to play with new concepts
Guest58846 seems interesting 18:33
timotimo: which book can you suggest to learn perl from complete zero? 18:34
reading documentation is a bit hard for me
timotimo there's not a book like that, sadly. not for perl6, at least
Guest58846 oh :( 18:35
so in which way it's better to get into perl6 for nowice?
timotimo there's this concept of "baby perl", which i think is about perl being very useful already if you're a beginner 18:36
18:36 AlexDaniel joined
timotimo like, it's able to grow with you as you learn 18:36
RabidGravy well in the past week or so I've written a midi sequencer, an audio streaming application and management tools for other software 18:37
AlexDaniel Guest58846: perhaps you can try this: learnxinyminutes.com/docs/perl6/ 18:38
timotimo i don't think that's "from zero"; i expect our guest really hasn't programmed much before 18:39
AlexDaniel m: my @a; @a[0..10] = 5, 6; say @a 18:41
camelia rakudo-moar f220a5: OUTPUT«[5 6 (Mu) (Mu) (Mu) (Mu) (Mu) (Mu) (Mu) (Mu) (Mu)]␤»
AlexDaniel m: my @a; @a[0..∞] = 5, 6; say @a
18:41 colomon joined
camelia rakudo-moar f220a5: OUTPUT«[]␤» 18:41
AlexDaniel this is not right, right?
18:41 spider-mario joined
timotimo i'd expect the latter to have 5, 6 in it and no Mu afterwards 18:42
AlexDaniel I'd also accept an error 18:43
18:44 cpage_ joined, vendethiel left
Guest58846 timotimo and AlexDaniel, thank you for answer :) 18:44
timotimo the learnxinyminutes document is nice, the perl6intro is maybe a bit nicer for this use case, but i think both still assume the reader knows a bit of programming 18:45
RabidGravy when I was first taught programming we started with a made up assembler like thing somewhat like MIX 18:48
didn't actually touch a computer for several weeks
timotimo i don't know what MIX is 18:49
18:49 gflohr1 left
RabidGravy It's a didactic language invented by Knuth 18:50
all the examples in the "Art of Computer Programming" use it 18:51
timotimo oh, interesting 18:52
RabidGravy or did, dunno about the latter two volumes
timotimo i have yet to actually read those books
i have access to them, though
diakopter MMIX 18:53
18:53 cdg_ left
timotimo THIS IS THE REMIX!! 18:54
18:56 vendethiel joined
MadcapJake so what are my options for conditionaly included OS specific class attributes? (Is there anything outside of MONKEY-TYPING?) 18:58
18:59 nadim joined
timotimo expose methods that just die if the wrong OS is selected? 18:59
mix in the right role in the constructor to hold the extra attributes? 19:01
RabidGravy that's what I'd do
MadcapJake So I can mixin a role inside the BUILD method? 19:03
19:03 kentnl joined, kentnl left, kentnl joined, kent\n left
timotimo i'd rather do that in "new" 19:03
because new returns the thing that'll get used, whereas in BUILD you'll have to use "does" rather than "but" 19:04
hm, but that complaint is kind of moot
MadcapJake how would that look?
method new(...) { return Class does Role }
timotimo method new(blah) { self.bless(blah) but select_right_role_for_os
19:04 colomon left
MadcapJake oh but for new and does for BUILD :P 19:05
timotimo yeah
RabidGravy or if you want totally bonkers it's create a new subclass of your class and add the methods/attributes to it like github.com/jonathanstowe/p6-Linux-...nfo.pm#L94 19:11
19:13 papillon joined
RabidGravy gosh, that module's nearly a year old 19:16
so will I be able to finish six modules before the 8th of April? 50 seems like a nice round figure 19:17
19:19 vendethiel left 19:20 Guest58846 left 19:22 kid51 left
pmurias RabidGravy: starting beginners with MIX seems like a good way to weed out the less determined 19:23
timotimo bah, subclasses ;) 19:26
19:30 vendethiel joined, kid51 joined
RabidGravy But hey I've just worked out why my gdbm binding segfaults 19:56
19:56 papillon left
RabidGravy But how to actually do what is required eludes me at the moment 20:05
that is it passes a struct "flat" and not as a pointer 20:10
20:10 ptolemarch left 20:11 labster joined 20:13 yqt joined
geekosaur you'll need a C wrapper 20:13
20:13 itaipu left
geekosaur interafces based on the original BSD -ldbm interface pass structs around directly; NativeCall doesn't support that (nor do many other FFIs) 20:14
20:16 vendethiel left
RabidGravy I already knew all of the above 20:19
can't be bothered to make a wrapper 20:21
20:24 darutoko left 20:30 TEttinger joined 20:32 kjs_ joined
geekosaur I think trying to fake it is going to get into a rat's nest of nonportability 20:32
RabidGravy yeah, I think it's set it aside for another few months until I have the motivation 20:34
20:36 kjs_ left
RabidGravy people keep thinking they want it, but nowadays I'd probably just use an sqlite db with a very simple schema ;-) 20:37
geekosaur it's still useful, mostly for interfacing with existing (old) stuff 20:38
20:39 cdg joined
geekosaur (of course, being an (ex-) database type, I'd sooner reach for sqlite anyway >.> ) 20:39
masak likes ex-databases too! :P 20:40
RabidGravy it is actually quite amazing how many things still use dbm style things 20:41
masak they make up a very wide sweet spot 20:42
20:50 jameslenz left, jameslenz joined
skids m: multi sub f(4) { "four!" }; multi sub f(UInt:D $a) { "UInt" }; my UInt $a = 3; $a.say; f($a).say; 20:55
camelia rakudo-moar 81558b: OUTPUT«3␤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 block <unit> at /tmp/3FKxys2AT0 line 1␤␤»
skids m: multi sub f(UInt:D $a) { "UInt" }; my UInt $a = 3; $a.say; f($a).say;
camelia rakudo-moar 81558b: OUTPUT«3␤UInt␤»
20:56 musiKk_ joined 20:57 skids left 20:58 gtodd joined, kjs_ joined
gtodd is there a way to slide along a string or a list with returning a "window" of chars or items in perl6? 20:59
I mean in the "base" without adding List::Util ? 21:00
teatime you can iterate over N items at a time
RabidGravy rotor
gtodd oh right
teatime like doesn't `for @list -> $a, $b, $c {}` take items 3 at a time from th elist 21:01
gtodd ok so the window function from the module is not needed to make life simple .
RabidGravy my @a = 1 .. 20; for @a.rotor(3) -> $a { say $a }
m: my @a = 1 .. 20; for @a.rotor(3) -> $a { say $a }
camelia rakudo-moar 81558b: OUTPUT«(1 2 3)␤(4 5 6)␤(7 8 9)␤(10 11 12)␤(13 14 15)␤(16 17 18)␤»
RabidGravy teatime yes, you can do that as well 21:02
ilmari m: my @a = 1 .. 12; for @a.rotor(3 => -2) -> $a { say $a }
camelia rakudo-moar 81558b: OUTPUT«(1 2 3)␤(2 3 4)␤(3 4 5)␤(4 5 6)␤(5 6 7)␤(6 7 8)␤(7 8 9)␤(8 9 10)␤(9 10 11)␤(10 11 12)␤»
ilmari for sliding window
gtodd rotor is an odd name :-)
21:02 rindolf left
gtodd slide is better :-D 21:02
only because I'm used to outboard motors heheh
thanks 21:03
RabidGravy please feel free to invent a time machine and implement it with the name you would like ;-)
teatime I have had more fun playing with perl6 than I have had in years.
perl syntax has always felt natural and accessible to me. I guess I have whatever disease causes that. 21:04
gtodd ilmari: the 3 => -2 "grabs 3 and slides it back 2"
ilmari gtodd: the rhs of the pair is the gap between each chunk 21:05
negative gap means overlap
gtodd tried to do it with @array.rotor(5 , -4) ... got error ... 21:06
NICE ERROR!
error message ++ 21:07
ilmari arrow and comma are not synonymous in perl6 21:08
RabidGravy m: say ( f => 1).WHAT; say (1,2).WHAT
camelia rakudo-moar 81558b: OUTPUT«(Pair)␤(List)␤»
ilmari m: say (f => 1, g => 2).WHAT 21:09
camelia rakudo-moar 81558b: OUTPUT«(List)␤»
ilmari m: say (f => 1, g => 2).WHAT.of
camelia rakudo-moar 81558b: OUTPUT«(Mu)␤»
RabidGravy the of isn't formed by inspecting the contents, just from a declaration afaik 21:10
ilmari m: my Pair @a = (f => 1, g => 2); say @a.WHAT.of 21:12
camelia rakudo-moar 81558b: OUTPUT«(Pair)␤»
masak .oO( .WHAT.of.it )
21:15 kjs_ left 21:20 Sgeo__ joined 21:21 frithnanth joined
AlexDaniel .oO( do we have a bug report for time travel? ) 21:24
21:25 dvinciguerra joined 21:26 kaare_ left
AlexDaniel m: DateTime.now.travel 21:27
camelia rakudo-moar 81558b: OUTPUT«Method 'travel' not found for invocant of class 'DateTime'␤ in block <unit> at /tmp/URC38NO0bt line 1␤␤»
AlexDaniel .oO( this should probably say “Sorry, time travel is NYI” ) 21:28
21:34 frithnanth left
masak .oO( but will it having had been *being* invented? ) 21:40
21:40 domidumont left
masak .oO( Q: What do we want? A: Time travel! Q: When do we want it? A: It... doesn't really matter when ) 21:40
21:42 musiKk_ left
teatime "\na\n\n" ~~ token { ^ [ ^^ <[a]>* $$ ]* $ } <-- hrm, this seems to run forever. 21:52
so does this: "\na\n\n" ~~ token { [ <[a]>* ['\n'|$] ]+ } 21:59
gtodd m: my $a = "a b c d" ; $a.subst-mutate(/\s/, '', :g); $a.say
camelia rakudo-moar 81558b: OUTPUT«abcd␤»
gtodd why doesn't that work with vars assigned from a loop like: for @arr -> $a { } 22:01
are loops variables readonlly?
Cannot call subst-mutate(List: Regex, Str, :g); none of these signatures match ... (Cool:D $self is rw: $matcher, $replacement, *%named)
geekosaur gtodd, -> is read-only 22:02
use <-> to get the aliasing version
22:02 labster left
gtodd ok hehe well subst-mutate sounds weird :-) so I'm just going to assign to another var :-P 22:02
until I get used to it :)
22:03 Begi left
gtodd ahh wait so it works in the repl because the repl is less strict? 22:03
gtodd groks
22:06 nadim left
Timbus i wouldnt thinnk so 22:06
teatime non-mutating version: my @A = ['a b c d', 'x y z']; @A».subst(/\s/, '', :g) 22:07
timotimo oh hey timbus
Timbus hello
teatime mutating: my @A = ['a b c d', 'x y z']; @A».subst-mutate(/\s/, '', :g); say @A
Timbus teatime, matching a zero width regex with a + or * quantifier causes infinite loops, if you didnt know 22:09
the second one seems like it would have been safe? hmm
oh i guess the $ 22:10
so that would match the end of the string infinitely
22:12 ChristopherBotto left
teatime Timbus: oh, duh, that makes sense. 22:12
thank you.
masak a lot of those zero-width-with-quantifier regex fragments are statically discoverable 22:18
but I guess (as usual) there are arguments both for and against actually detecting them at compile time 22:19
22:19 wtw left, wtw joined 22:20 wtw left, wtw joined 22:21 wtw left, wtw joined
Timbus i have trouble triggering the same thing in perl5. im sure it can be done if i get fancy, but something like (.|$)+ is not an issue 22:23
masak that... rings a bell 22:24
well, because the other thing you can do is detect those loops and (instead of failing at compile time) just removing them
22:25 labster joined
Timbus yeah, i think this conversation has happened a few times in here. maybe we're stuck in a loop 22:25
timotimo Timbus: i'm interested in Net::Irc::Bot getting more stuff, especially getting ported to async sockets and such ... but sadly i'm not interested or needy enough to do it myself :\
masak $ perl -Mstrict -we'"foo" =~ /f(?:)+oo/'
(?:)+ matches null string many times in regex; marked by <-- HERE in m/f(?:)+ <-- HERE oo/ at -e line 1.
in this particular case, Perl 5 dies at compile time
Timbus timotimo, i ported it while you weren't looking 22:26
:P
timotimo is that true?
oh, wait
Timbus yeah, i just swapped in ::Async
timotimo does it also handle shooting back data to the irc from an async worker or something?
Timbus start() just calls start-async() and waits on the promise
ah 22:27
workers aren't async, but you can easily spawn a thread and return things top the socket
to* the socket
that wording still sucks. let's try again: you can use $e.say from another thread that your event spawned :P 22:28
timotimo OK, that's good
22:35 skids joined 22:37 ZoffixLappy joined
ZoffixLappy Hey. Are all hyper operators potentially use multiple cores or is it only the 􏿽xBB.method calls? Like, does this have a potential to be threaded: (1, 2, 3, 4) <<+>> (1, 2) 22:38
timotimo we want to turn those into multi-threaded stuff or vectorized calls 22:42
potentially operations with hypers could be turned into a OpenCL Compute Shader, too 22:43
ZoffixLappy Is that already planned or are you just thinking aloud? 22:44
ZoffixLappy points out he is currently at a bar... thinking is hard :P
22:44 mojca joined
ZoffixLappy I'm just writing my talk and wanted to know whether I should include stuff like (1, 2, 3, 4) <<+>> (1, 2) in the slide about multi-threaded ops, like the 􏿽xBB. method stuff 22:45
RabidGravy I was thinking about fiddling with getting some stuff to run on an FPGA then got distracted about something else 22:46
timotimo nobody has written it yet 22:48
and our implementation of .hyper and .race is currently a bit b0rked
ZoffixLappy Alright.
22:49 pmqs left 22:53 FROGGS left 23:00 Begi joined, mullagain left 23:04 tmch left 23:05 matiaslina joined
masak 'night, #perl6 23:09
ZoffixLappy night 23:13
dalek rl6-most-wanted: 585ad05 | Emeric54++ | most-wanted/modules.md:
Add a WIP
23:22
rl6-most-wanted: cd98fb2 | labster++ | most-wanted/modules.md:
Merge pull request #22 from Emeric54/patch-1

Add a WIP
c: 5c1c677 | (Simon Ruderich)++ | doc/Language/nativecall.pod:
nativecall: clarify C types and add unsigned variants

Also use int32 consistently for C's int and fix getpwuid(3) to take an uint32.
23:29
c: 07334fd | (Simon Ruderich)++ | doc/Language/nativecall.pod:
nativecall: use consistent indentation
c: 3d074ed | (Simon Ruderich)++ | doc/Language/nativecall.pod:
nativecall: consistently use { * } as function body
c: 6684f95 | (Simon Ruderich)++ | doc/Language/nativecall.pod:
nativecall: fix typos
23:30 wamba joined
ZoffixLappy :/ I'm struggling to find a good example that uses 􏿽xBB. even though I wrote chains using multiple of them many times :/ 23:31
23:32 RabidGravy left, pmurias left
rudi_s ZoffixLappy: What exactly do you need? The "iterate over hash keys in a sorted order" trick in the docs use » 23:34
23:35 guest666_ joined
ZoffixLappy rudi_s, just trying to find a good example for my talk explaining 􏿽xBB. I may have spent the last half hour figuring out a good example lol. 23:36
I'm not sure whether I should start panicing that I took too long a break from Perl 6 and will now sound like an idiot during my talk or.... to order another beer :) 23:37
rudi_s, "docs use".. Would you link me to those docs, please?
rudi_s ;-) - well I think at least as a simple example the iterate over hash keys should work. It's a nice trick and needs »
Sure.
23:38 Begi left
rudi_s ZoffixLappy: doc.perl6.org/type/Hash#Looping_ov...and_values 23:38
Last code block in this section.
(Sort returns pairs, so you need to use » to extract the key/value of each pair.) 23:39
ZoffixLappy Thanks!
rudi_s np 23:40
Will the slides of your talk be available somewhere? I'm always interesting in learning more stuff about perl6. 23:41
ZoffixLappy rudi_s, yes, they should be available at tpm2016.zoffix.com/ next Wednesday. 23:42
rudi_s Nice, looking forward to it (DNS doesn't resolve at the moment.) 23:44
ZoffixLappy Yeah. It will on Wednesday :)
23:45 kjs_ joined
rudi_s ;-) 23:45
guest666_ .sort: +* ascending; -* descending; ~* ascending lex; What I can use for descending lex instead of .reverse ? 23:47
23:54 spider-mario left 23:56 BenGoldberg joined, manchicken joined
manchicken Does anybody have experience deploying Perl6 apps in AWS? I'm trying to decide if an EC2 is my only option. 23:57