»ö« 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 Zoffix on 25 May 2018.
Geth p6-sake: AlexDaniel self-assigned Running `sake` without arguments should run task `default` github.com/perl6/p6-sake/issues/15
AlexDaniel self-assigned Dependency tree visualization with graphviz github.com/perl6/p6-sake/issues/14

Rename internal make_task to make-task
raschipi Perl 6 can convert one into the other anyway.
tobs ToddAndMargo: I can relate, but after some time of using perl, my usage of "unless" in conversational English went up (from zero), too. 00:02
00:03 kurahaupo joined
ToddAndMargo I usually hear "unless" in English as some part of an equivocation, so if I use "not" it is very direct 00:03
BUt as with all things Perl, there is always 1001 ways to do anything! 00:04
I thought I understood how to find how many arguments where on the command line. `if @*ARGS.elems > 0 ` throws "Dynamic variable @*ARGV not found" 00:06
docs.perl6.org/routine/args 00:07
jnthn Looks like you typed @*ARGV instead of @*ARGS
ToddAndMargo mumble, mumble, mumble 00:08
What is wrong with this one: `&::($RunSpecific)();` No such symbol '' 00:11
I don't see me using any single quotes
geekosaur it's an empty string, with the single quotes part of the error message to set off the symbol it's looking for? 00:13
ToddAndMargo I just found my typo. I am testing 00:14
geekosaur hm, actually it says that for any not found symbol, so that may be showing a bug 00:15
m: my $RunSpecific = 'glup'; say &::($RunSpecific)();
camelia No such symbol ''
in block <unit> at <tmp> line 1
geekosaur m: sub glup { 1 }; my $RunSpecific = 'glup'; say &::($RunSpecific)();
camelia 1
ToddAndMargo `::($RunSpecific)();` is the correct syntax. 00:17
geekosaur rakudobugged the bad error message 00:18
ToddAndMargo I am trying to side step EVAL and run the name of a sub I pick up from the command line.
`::("$RunSpecific")();` throws "No such symbol 'GetAWSCleaner'" (Get "GetAWSCleaner" was copied and pasted from the sub's name.) 00:20
raschipi You could declare MAIN subs and have literal strings as the first argument, and calling './program subcommand' would call one of those for you. 00:21
00:22 Khisanth left
ToddAndMargo &::($RunSpecific)(); Throws No such symbol '' 00:22
00:22 Actualeyes joined
geekosaur yeh, that's what I reported 00:22
that's not you doing it wrong (they should do about the same thing, same as you don;t need to precede sub names with & normally), that's the error message being wrong 00:23
00:23 thundergnat left
ToddAndMargo This is what I am trying to convert from Perl 5: `else { eval "$RunSpecific"; }` And get around the See No Monkey's pragma. Any workarounds 00:24
geekosaur m: sub glup { 1 }; my $RunSpecific = '&glup'; say ::($RunSpecific)(); 00:25
camelia 1
ToddAndMargo `::('&' ~ $RunSpecific)();` No such symbol '&GetAWSCleaner' I can't win. Sniffle! 00:26
raschipi Maybe it's telling you the truth, there's no &GetAWSCleaner. Where is it being defined? 00:27
ToddAndMargo I could have typo'ed it. Ahhh poop (not my exact word. I transposed two letters! 00:28
Thank you! 00:29
Converting from P5, when "index" can't find something, it return "-1". In p6 is it always a "nil"? 00:32
raschipi Yes 00:34
timotimo "with" and "index" is a good combo 00:35
ToddAndMargo Thank you! Me got a bunch of corrections to make!
timotimo with index $bloop, $bleep -> $found-position { say "found $bleep in $bloop at $found-position" } else { say "didn't find it" }
ToddAndMargo This is what I am converting `if ( index $Rev, "rc" ) > -1 {` and since I only want to know if "rc" is in the line, me thinks it would be more p6-ish just to ` if m/rc/` instead. Your thoughts? 00:37
timotimo i prefer .contains
ToddAndMargo oops `if $Rev ~~ /rc/` 00:38
timotimo if $Rev.contains("rc") { }
ToddAndMargo even easier! Thank you!
p6-sake: 4972a25408 | (Aleks-Daniel Jakimenko-Aleksejev)++ | lib/Sake.pm6
Rework `file` sub to allow body to accept a Task

This was an oops in 8102fcb173dd7e67b91d38609ec0a78f49e745ad.
00:40 HaraldJoerg left 00:49 Khisanth joined 00:58 hythm_ joined
hythm_ p6: my $ge = ">="; 6 $ge 7 # how can I use $ge here so the statement becomes "6 >= 7" 01:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my $ge = ">="; 67⏏5 $ge 7 # how can I use $ge here so th
expecting any of:
infix stopper
statement end
raschipi hythm_: Can't. 01:04
[Coke] well, EVAL 01:05
hythm_ I tried EVAL, got two terms ina row error
timotimo m: my $ge = &[>=]; say $ge(6, 7) 01:06
camelia False
MasterDuke m: my $ge = ">="; say "6 $ge 7".EVAL
camelia False
lookatme what is the &[] mean ? 01:10
m: say &[==];
camelia sub infix:<==> ($?, $?, *%) { #`(Sub+{is-pure}+{Precedence}|38542992) ... }
lookatme m: say &[|];
camelia sub infix:<|> (|) { #`(Sub+{is-pure}+{Precedence}|50844144) ... }
lookatme m: say &[.]; 01:11
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> 3say &[.7⏏5];
timotimo one way to name an infix operator
lookatme m: say &[!];
camelia 5===SORRY!5=== Error while compiling <tmp>
Negation metaoperator not followed by valid infix
at <tmp>:1
------> 3say &[!7⏏5];
expecting any of:
argument list
infix noun
infix stopper…
lookatme oh
01:13 sno joined
hythm_ I dont think EVAL would help in this case, I created a snippet to help explain what I want to do better: (the issue is in the last multi sub) 01:17
timotimo would it be okay to have my $condition = * => *; instead? 01:18
01:19 sno left
timotimo m: my $condition = ">=; say &infix:["$condition"](5, 6); 01:19
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use variable $condition in declaration to initialize itself
at <tmp>:1
------> 3my $condition = ">=; say &infix:["$7⏏5condition"](5, 6);
expecting any of:
double quotes…
timotimo m: my $condition = ">="; say &infix:["$condition"](5, 6);
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in code at <tmp> line 1
5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:…
timotimo ah, of course, that'd have to be begin time
hythm_ I dont understand * => * looks like a place holder to $condition args, but yeah that would be ok 01:24
timotimo * >= * is equivalent to -> $a, $b { $a >= $b } 01:25
i.e. it's a piece of code
hythm_ noted
timotimo we call those "WhateverCode" or refer to it as "whatever currying"
whatevercode can be more than just a single operator, and can be between one and as many placeholders as you want 01:26
so * >= 5 is also a valid WhateverCode
01:30 rindolf left
hythm_ makes sense, Thanks for clarification, I tried a few things with $condition set to * => * but still did not work for me (getting same two terms in a row error), will try more 01:32
timotimo you need to use $condition as if it were a sub 01:33
i.e. $condition($one, $other)
hythm_ hmm
timotimo also, i think for versions you might want "before" and "after"?
hm, though there's no "before or equal" word i don't think 01:34
maybe >= is fine
hythm_ ok, will try that. I appreciate the suggestions and help, thank you 01:36
timotimo you're welcome 01:37
02:04 Grrrr joined 02:06 Kaiepi left, hythm_ left
tbrowder_ in p5 i can have a hash element like “key => \$val” but how do i do that in p6? my goal is to deref the val upon key lookup to see the current value of $val. 02:11
raschipi You want to bind the value instead of asigning it, is that it? 02:14
geekosaur bind the container, sounds like
raschipi Yeah, the container. 02:15
lookatme m: my %foo; %foo{1} = %{1 => 2, 3 => 4}; %foo{2} := %{5 => 6, 7 => 8}; dd %foo; 02:20
camelia Hash %foo = {"1" => ${"1" => 2, "3" => 4}, "2" => {"5" => 6, "7" => 8}}
lookatme not much difference, seems like
02:21 kurahaupo_ joined
geekosaur I think you bind individual elements, rather than assigning Pairs? 02:22
02:23 kurahaupo left
geekosaur m: my %h; my $x = 1; %h<a> = 5; %h<b> := $x; dd %h; $x = 2; dd %h 02:23
camelia Hash %h = {:a(5), :b(1)}
Hash %h = {:a(5), :b(2)}
02:31 Kaiepi joined 02:37 MilkmanDan left 02:39 MilkmanDan joined
ToddAndMargo How do I do an array consisting of two elements per index? p6 'my @x; push @x= ["a", "1"]; push @x= ["b", "2"]; say @x;' [b 2] 02:45
joya array of arrays 02:46
in that code you gave, only the assignment is meaningful 02:48
think of it as: @x = ["a", "1"]; push @x
the push part is not doing anything
i think what you want is more like, @x.push( ["a", "1"] ) 02:49
then @x.push( [ "b", "2" ] )
ToddAndMargo checking 02:50
joya the square brackets are the internal arrays -- each one is an element of the array @x
also abbreviated as @x.push: ["a", "1"] 02:51
02:52 tuoneta joined
ToddAndMargo Thank you. And I do know better. Getting a bit tired. $ p6 'my @x; push @x, ["a", "1"]; push @x,["b", "2"]; say @x;' [[a 1] [b 2]] 02:52
joya 👍 02:53
02:55 tuoneta left 03:02 sno joined 03:12 arp34 joined 03:13 sno left 03:16 ToddAndMargo left 03:29 wamba joined 03:35 raschipi left
benjikun tyil: Sorry about LoneStar not being included, didn't know this was a thing 03:42
It's a little late to add an option, I'd say, but we'll definitely throw it in on the next survey
03:56 turdmonkey joined
turdmonkey Hello. 03:58
04:04 arp34 left
benjikun turdmonkey: Howdy 04:06
turdmonkey Does anyone find think it's funny how you can read Perl 6 almost exactly like English? 04:08
04:15 lizmat joined
benjikun turdmonkey: I like it when that's possible 04:18
it's surely not always with Perl6, but the option is there
turdmonkey Well yes, not always
04:18 sno joined
benjikun I know what you mean, though 04:19
turdmonkey Try reading all of those sigils and funny operators out loud haha
04:23 MasterDuke left
benjikun This is perhaps a stupid question, and is obvious for all of us 04:28
but how do newcomers know to use Zef as the tool to install modules
turdmonkey I got the book, "perl 6 fundamentals" and it said so in the beginning, when setting up the perl 6 environment 04:29
benjikun True, it is mentioned regularly at the beginning of books and beginner's guides 04:30
Well, it also does explicitly reference zef under the "Modules" page in the docs 04:31
turdmonkey I'm excited for "Learning Perl 6", which will probably demonstrate zef as well
benjikun Maybe we should put a reference to the modules docs page on the frontpage of modules.perl6.org
I'm trying to discover any things newbies might miss 04:32
turdmonkey Pointing newbies toward Rakudo-Star is useful
And always having a short and quick beginner tutorial that utilizes a cool module that requires zef. 04:33
benjikun Perhaps we could put a link titled "What next?" or some variation on that at the bottom of each of the installation instructions for rakudostar here: rakudo.org/files 04:34
or a link at the bottom that says "Learn more about what's included with Rakudo Star" 04:36
There's a box similar to that on the downloads page @ perl6.org 04:38
turdmonkey oh man I just discovered GTK::Simple 04:49
04:50 curan joined
turdmonkey pretty much the only thing I don't use perl 5 for is GUI stuff. Not that I do GUI stuff often(hardly ever), but Perl 6 supporting a real, high-quality GUI Framework would be sweet 04:50
benjikun turdmonkey: Were you the one that requested that in the survey? 04:51
04:51 skids left
benjikun I saw that, and I'd agree 04:52
04:52 jmerelo joined
benjikun jmerelo: Welcome back 04:53
turdmonkey benjikun, No, but it's been on my mind for a while now 04:54
jmerelo benjikun: hi. Checking out answers to the survey. Quite a lot! 04:55
turdmonkey What is something perl absolutely excels at? Data munging! What do people love? graphs!
benjikun jmerelo: Yeah, I'm quite pleased with them 04:56
turdmonkey: I'm planning on generating some custom charts for the survey questions a little after it appears on P6Weekly, so that everyone gets an opportunity 04:57
alongside considering a repository for the .csv and chart generators for each round of surveys we do
turdmonkey I think that a huge area where Perl 6 can shine is data visualization 05:00
jmerelo If you've got the time, please cast your vote in the hash declaration style poll github.com/perl6/doc/issues/2117#i...-399742781
El_Che benjikun: I bundle zef in rakudo-pkg (and a script to install it at home). 05:04
I think people discover zef soone enough 05:05
the only danger is them picking als variants like panda, ufo from older posts
05:05 kurahaupo_ left, kurahaupo joined
El_Che or start with rakudobrew becasue it sounds like perlbrew 05:05
05:06 sno left
turdmonkey $var.kv, kv is "key/value" method? 05:07
benjikun El_Che: good points, I know people who have done that with panda
jmerelo turdmonkey: right. 05:08
turdmonkey well that's quite nifty
jmerelo This question is still unanswered in StackOverflow: list of encodings that Perl6 understands stackoverflow.com/questions/414332...nderstands 05:10
turdmonkey How is Perl 6's speed now?
jmerelo turdmonkey: better ;-) 05:11
El_Che ymmv depending on what you do. Having easy concurrency helps on that area 05:12
benjikun jmerelo: About the hash debate, I'd agree with labster on consistency paralleling defining arrays (i.e. my @a = []; being similar to {}) 05:17
As for why {} is so much slower, can that be improved, or is that option inherently slower than the others
05:19 turdmonkey left
benjikun too bad there aren't more symbols on most keyboards, ha 05:25
El_Che benjikun: i.ytimg.com/vi/FVfiujbGLfM/hqdefault.jpg 05:29
benjikun El_Che: lol
jmerelo benjikun: it will probably be improved. Did you vote at the poll? 05:30
benjikun jmerelo: Yeah, I did 05:31
geekosaur benjikun, theres a bug open for it already
jmerelo benjikun: great! I'll leave it open for another 24 hours, and change documentation after that. 05:32
There are a bunch of Perl 6 unanswered questions in StackOverflow. You might want to take a look at them stackoverflow.com/unanswered/tagged/perl6 In some cases, they give you interesting insight on the working of the language 05:34
05:42 kurahaupo left, kurahaupo joined
El_Che jmerelo: quite a discussion about hashes :) 05:43
jmerelo El_Che: that's the kind of thing I love about Perl 6 and the community. It's also the kind of issues I hate. 05:44
El_Che herding cats?
jmerelo El_Che: herding butterflies. 05:45
El_Che cats are less fragile :)
jmerelo El_Che: precisely. 05:46
El_Che academics love precise language :) 05:47
jmerelo jmerelo: :-)
El_Che (and to talk to themselves it seems) :) 05:48
05:48 xtreak joined
jmerelo El_Che: we don't talk to ourselves, we mumble :-) 05:48
El_Che mumblemumblereferenceneededmumble 05:49
jmerelo El_Che: that's wikipedians. Almost, but not quite.
El_Che <this perl 6 doc is incomplete or has unresolved issues> 05:50
jmerelo El_Che: academics would be quite "You need to compare Perl 6 to every single language in town. The font you are using for code is too small, except when it's too big. You are not mentioning my Very Important Contribution to the realm of languages" 05:52
El_Che lol
train arrived
jmerelo El_Che: have a nice trip
05:55 wamba left 05:57 kurahaupo_ joined 05:58 kurahaupo left 06:02 kurahaupo_ left 06:11 kurahaupo joined 06:14 ufobat_ joined
El_Che jmerelo: just commute to work :) 06:20
06:23 Kaypie joined, Kaiepi left 06:26 domidumont joined 06:31 domidumont left 06:32 sno joined, domidumont joined 06:35 hami joined 06:38 jmerelo left 06:42 kurahaupo_ joined 06:45 kurahaupo left 06:48 lookatme left 07:18 hami left 07:21 jeromelanteri joined 07:22 jeromelanteri left 07:23 zakharyas joined 07:24 zakharyas left 07:27 zakharyas joined 07:28 zakharyas left, zakharyas joined 07:45 darutoko joined 07:50 joya left
tyil benjikun: dont sweat it 07:51
07:53 jmerelo joined
jmerelo .tell phdphil A lazy list could be infinite. Kind of hard to do combinations on that thing... 07:53
yoleaux jmerelo: I'll pass your message to phdphil.
08:05 dakkar joined 08:11 dogbert17 left 08:25 xtreak left 08:27 zakharyas1 joined 08:28 xtreak joined 08:29 zakharyas left 08:37 wamba joined 08:39 xtreak left 08:42 wamba left 08:43 wamba joined, pmurias joined
buggable New CPAN upload: App-Assixt-0.4.0.tar.gz by TYIL modules.perl6.org/dist/App::Assixt:cpan:TYIL 08:56
tyil neat
09:06 xtreak joined 09:09 zakharyas1 left, zakharyas joined
buggable New CPAN upload: cro-http-0.7.6.tar.gz by JNTHN modules.perl6.org/dist/Cro::HTTP:cpan:JNTHN 09:16
New CPAN upload: cro-core-0.7.6.tar.gz by JNTHN modules.perl6.org/dist/Cro::Core:cpan:JNTHN
New CPAN upload: cro-tls-0.7.6.tar.gz by JNTHN modules.perl6.org/dist/Cro::TLS:cpan:JNTHN
09:17 HaraldJoerg joined 09:20 domidumont left 09:24 domidumont joined, n1ge joined
buggable New CPAN upload: cro-0.7.6.tar.gz by JNTHN modules.perl6.org/dist/cro:cpan:JNTHN 09:26
New CPAN upload: cro-websocket-0.7.6.tar.gz by JNTHN modules.perl6.org/dist/Cro::WebSocket:cpan:JNTHN
New CPAN upload: cro-zeromq-0.7.6.tar.gz by JNTHN modules.perl6.org/dist/Cro::ZeroMQ:cpan:JNTHN
09:29 Kaypie left 09:31 xtreak left 09:34 haj` joined
buggable New CPAN upload: Geo-Coordinates-UTM-0.9.0.tar.gz by KJPYE cpan.metacpan.org/authors/id/K/KJ/...9.0.tar.gz 09:36
jmerelo Wow 09:42
09:43 scimon joined 09:45 rindolf joined 09:46 xtreak joined 09:49 Jon__ joined
Jon__ Hello:), i tried to install moose and when i run my perl program i get this error 09:49
Can't locate Moose.pm in @INC (you may need to install the Moose module) (@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at .\test.pl line 6. BEGIN failed--compilation aborted at .\test.pl line 6.
Can someoen tell me what i'm doing wrong?
09:54 Jon__ left 10:02 scimon left 10:03 scimon joined 10:09 margeas joined
Ulti you need to tell your perl where your cpan modules are installed try -I to manually do that on the command line 10:10
your second marginal error was asking a perl5 question on a perl6 chat, you might have more luck with #perl 10:11
though there are some p5 people on here too
scimon Jon__: sounds like you need to install Moose `cpanm Moose` should do the job. But as Ulti says the #perl chat might be a better place to ask. 10:16
jnthn I think they left :)
10:20 benjikun left
scimon Ah well. 10:23
10:43 wamba left 10:45 scimon left, scimon joined 10:46 Zoffix joined 10:47 wamba joined
Zoffix benjikun: but you don't define arrays with `my @a = [];` you just write it as `my @a;`. Same with hashes 10:50
10:53 sena_kun joined
Zoffix benjikun: and yeah, {} can be improved. If you write it explicitly as circumfix:<{ }> it becomes fast, so I suspect it's the left over block from when we're trying to guess whether we're making a hash or a block that's to blame. There's another issue where this form of guessing could be implemented better, so I think once that's done the speed loss will resolve itself :) 10:53
mmm... the "Recent blog posts" needs fixing: perl6.org/ 10:54
Right now it appears to shows comments from medium.com as new blogs... "Jo Christian Oterhals: Yes, you’re right." "Jo Christian Oterhals: Thanks for the response, Dave." 10:55
.tell benjikun you wanted to add links to rakudo.org The sauce is here: github.com/perl6/rakudo.org/ The templates are in templates/ Add [REAPP] (including brackets) to commit title to restart the app with your changes 10:57
yoleaux Zoffix: I'll pass your message to benjikun.
11:02 jmerelo left
Geth perl6.org: 4c84c5ea2b | (Zoffix Znet)++ | fetch-recent-blog-posts.pl
Get rid of comments on medium.com showing up as new blogs
11:20 raschipi joined 11:22 zakharyas left 11:33 xtreak left 11:58 scovit joined 11:59 Zoffix left 12:03 lizmat left 12:19 epony left 12:21 kurahaupo_ left
Geth perl6.org: e151ad1f3f | (Zoffix Znet)++ (committed using GitHub Web editor) | fetch-recent-blog-posts.pl
Explain more how the medium.com comment filter works
12:47 damnlie left 12:49 p6noob left, damnlie joined 12:53 mcmillhj joined, mcmillhj left 12:58 mcmillhj joined, mcmillhj left, notable6 left, notable6 joined 13:00 cosimo joined 13:03 wamba left, mcmillhj joined, mahafyi joined
pmurias the truffle backend now passes t/nqp/001-literals.t :) 13:04
moritz \o/ 13:07
13:08 kurahaupo joined
jkramer Would it make sense to add a divmod op to P6 or would that have no advantages over doing mod and div seperately? 13:09
stmuk hmm zeroturnaround.com/rebellabs/graal...es-on-jvm/ has helped my understanding 13:12
13:15 zakharyas joined
pmurias jkramer: does it offer any benefits rather then as an optimization aid? 13:17
jkramer pmurias: No, but isn't an optimization aid not a good reason for having it? :) I mean I guess div+mod are things that are often needed together and usually in situations where you do math stuff that you'd want to be fast 13:19
I'm doing some project euler tasks in P6 lately and this is something that I found would be useful on many occasions 13:20
pmurias jkramer: I'm not just not very convinced that it will make things faster 13:22
jkramer pmurias: Yeah that's why I'm asking. I guess rakudo is too high-level to make efficient use of CPU features/side effects 13:27
13:27 zakharyas left
raschipi Doesn't polymod do that? 13:28
m: say 25.polymod(3).reverse
camelia (8 1)
13:28 zakharyas joined
timotimo the thing is that when we divide, we already get both the div and mod results, at least from the bigint library 13:28
[Coke] raschipi++
timotimo we then throw away one of the two, recalculate, and throw away the other
at least i think that's what happens
AlexDaniel clickbaits docs.google.com/forms/d/e/1FAIpQLS...g/viewform 13:29
ilmari m: 37.divmod(5).say()
camelia No such method 'divmod' for invocant of type 'Int'
in block <unit> at <tmp> line 1
ilmari m: 37.polymod(5).say()
camelia (2 7)
ilmari isn't divmod just a special case of polymod?
[Coke] divmod isn't p6, I don't think. 13:30
raschipi Yep, it's the polymod case with a single argument.
jkramer Well divmod in other languages/libs that are more low-level make use of the fact that the machine opcode for division automatically stored the remainder in an extra register, so it's just one CPU op that does both at once
But that's probably not possible in Rakudo 13:31
raschipi jkramer: Why do you say that?
AlexDaniel m: say expmod(4, 2, 5);
camelia 1
ilmari s: Int, 'polymod'
SourceBaby ilmari, Sauce is at github.com/rakudo/rakudo/blob/e935...t.pm6#L105
timotimo the jit's optimizer could probably figure that out
jkramer raschipi: Well you'd need to do inline assembly with all the downsides :)
timotimo just gotta implement it ;)
13:31 epony joined 13:32 skids joined
raschipi jkramer: Rakudo generates assembler for x86_64 13:32
jkramer Oh really? I was not aware of that
ilmari well, it's really moarvm that does it
but yes, some ops are JITed
jkramer So I can compile P6 to binary?
raschipi Well, yeah, Moar does it.
It compiles it's own bytecode to binary 13:33
But not all of it, jkramer. 13:34
timotimo we only do JIT compilation, no AOT compilation here.
jkramer That's pretty neat :)
timotimo it's also only really a win because we observe the actual execution of the program to figure out what types are common where 13:35
pmurias all the Perl 6 backends (moar, jvm, js and truffle) do JIT compilation btw
timotimo 6guts.wordpress.com has many posts about our dynamic optimizer, and brrt-to-the-future.blogspot.com has posts about the jit
actually 13:36
jkramer: www.youtube.com/watch?v=3umNn1KnlCY - this could be very interesting for you: Jonathan Worthington (‎jnthn‎) - "‎How does deoptimization help us go faster" 13:37
13:39 Pheix joined
tbrowder_ g'day, #perl6 13:41
raschipi oi tbrowder_
tbrowder_ raschipi: o/ 13:42
13:43 molaf joined
tbrowder_ i need to bind a variable to a hash key so i can do something in p6 as is done in this gist: gist.github.com/tbrowder/e032014c6...61298e6c16 13:43
jkramer timotimo: Thanks, I'll watch it later, can't have sound right now :) 13:44
timotimo jnthn.net/papers/2017-spw-deopt.pdf - this is the slides pdf 13:45
raschipi m: my $b = 3; %h<a> := $b; $b = 4; say %h<a> 13:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%h' is not declared
at <tmp>:1
------> 3my $b = 3; 7⏏5%h<a> := $b; $b = 4; say %h<a>
raschipi m: my $b = 3;my %h; %h<a> := $b; $b = 4; say %h<a> 13:48
camelia 4
13:48 kurahaupo left 13:49 Pheix2 joined 13:50 Pheix3 joined
raschipi tbrowder_: Does that solve your problem? 13:50
13:50 lizmat joined 13:52 Pheix left
tbrowder_ it does, and i'm a dummy! i was focused on assigning it inside the original hash definition and didn't consider the direct binding. thnx! 13:53
13:53 Pheix2 left 13:54 curan left
tbrowder_ s/original/original total/ 13:54
ufobat_ did anyone work any further on perl6 and ldap? fyi: gist.github.com/FROGGS/bafc8454a14...0048dabf47
raschipi tbrowder_: geekosaur found the answer when you asked earlier, you must have not seen it. I just repeated it now. 13:57
It's not obvious at all when trying to translate the Perl 5 code. 14:00
14:00 kurahaupo joined
b2gills I think that if a NQP op for divmod was added, it might make it easier to optimize a div followed by a mod (or the reverse) as the optimization could be done in NQP. (note that this is just a guess) 14:03
14:03 zakharyas left
raschipi polymod is repeated divmod 14:08
14:09 turdmonkey joined
turdmonkey yay perl! 14:10
raschipi heya turdmonkey
turdmonkey Hello.
14:11 turdmonkey left, greppable6 left 14:12 greppable6 joined 14:16 wamba joined
raschipi Juerd: do you find it amusing or frustrating that everyone disagrees so strongly with your style recommendations? 14:22
tbrowder_ geekosaur: thanks for the answer to binding a var to a hash key!
buggable New CPAN upload: RDF-Turtle-0.0.1.tar.gz by BDUGGAN modules.perl6.org/dist/RDF::Turtle:cpan:BDUGGAN 14:26
14:36 wamba left
masak raschipi: what style recommendations are those? 14:41
14:43 wamba joined
raschipi Use 'hash' instead of '{ }' to create empty hashes in the docs and getting rig of '$' anonymous variables, requiring it to be declred 'state $'. 14:43
14:46 turdmonkey joined
b2gills `$` is actually `(state $)` as `$ = 1` always assigns a `1`. While `state $ = 1` only assigns it the first time through the block. 14:51
timotimo i prefer {} over hash, because {} is a term, whereas hash can take some more stuff after it. if you're not careful, what you intended to be "empty hash" turns into "hash with a bunch of stuff" 14:52
turdmonkey Why is {} confusing with a block? Isn't one of Perl
Perls greatest strengths context?
Geth doc: 77374a0a82 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
Document interpolation-of-anon-state-vars as a trap

Found 6 or 7 cases of this bug in the ecosystem
synopsebot Link: doc.perl6.org/language/traps
turdmonkey You should be able to tell based upon context, yes?
timotimo in that case it's based on content, not context
turdmonkey hm 14:53
timotimo if there's any reference to $_ inside the { } it'll be interpreted as a block instead of a hash
which can surprise you
especially because there's the .foo form which is short for $_.foo
turdmonkey so if you use $_ inside of {} then you must explicitly declare it a hash?
timotimo so you can have a $_ in there without seeing the $_
in that case you'll have to use %( ) syntax, or a call to "hash" or rename the variable outside of it 14:54
14:54 zakharyas joined
raschipi Well, it's not a problem in practice, you just need to know how to force Perl 6 to do what you mean. 14:54
14:55 Zoffix joined
timotimo aye 14:55
a type annotation here or there can help, too
m: my %foo = { hi => "goodbye", boop => .uc }
camelia Odd number of elements found where hash initializer expected:
Only saw: -> ;; $_? is raw { #`(Block|86150824) ... }
in block <unit> at <tmp> line 1
timotimo or, you know, the % sigil
Zoffix turdmonkey: more accurately, referring to any **parameters** will make it a block. And $_ is a default parameter in blocks. The path to this error is having stuff like `{ foo => $o.ber }` and then later changing `$o` to be aliased to `$_` in the outer construct, so you go and change the hash to `{ foo => .ber }` but that's now a param, so it becomes a block 14:56
14:56 molaf left
Zoffix And the second error is reducing `{ … some code … }` to just an empty `{}`, but depending on the context that could mean a hash instead, so you have to go back and change that to `{;}` 14:57
turdmonkey lol, wow 14:58
Zoffix :)
I don't know why people keep using initialization to argue against `{}`. You wouldn't use it there! :)
m: my %foo = hi => "goodbye", boop => .uc
camelia No such method 'uc' for invocant of type 'Any'
in block <unit> at <tmp> line 1
raschipi Zoffix: because they had their minds warped by computer science? 15:00
Zoffix I suspect it's because they're making up the problems that don't exist instead of reporting actual problems that happened :P
raschipi Well, it's got to be 'pure' and conform to some theory and all that, so every problem that can be made up must be solved, I think. 15:01
Zoffix Same with state vars. The original argument was that it's hard to search for, which proved false. However, I found ~6 modules in the ecosystem that weren't scoping them correctly
turdmonkey Zoffix, `boop => .uc` is really $_.uc ?
Zoffix turdmonkey: yes
turdmonkey :-O
Zoffix turdmonkey: same with .[0], .<foo>, and so on 15:02
turdmonkey Cool.
Zoffix Except for hypering, IIRC `.»lc with <a b c>` wont work
m: dd .»lc with <a b c>
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call (only alphabetic methods may be detached)
at <tmp>:1
------> 3dd .7⏏5»lc with <a b c>
Zoffix yeah, it really wants a `$_` in there
turdmonkey How do you use those unicode characters o easily?
Zoffix turdmonkey: on this computer, I use XCompose, so it's `RWin, >, >` to type » 15:03
raschipi Zoffix types with his mind directly.
turdmonkey Hahaha, that is so cool
Zoffix turdmonkey: on my home computer, I have 18 extra keys on the side and have some of them bound to the special chars
turdmonkey Well, aren't you mister fancy pants.
Zoffix And if you don't know how to type it, you can just write it as `>>` 15:04
turdmonkey Yes.
Zoffix m: say <a b c>».lc; say <a b c>>>.lc
camelia (a b c)
(a b c)
turdmonkey The 'infinity symbol' = * = Inf ?
Zoffix m: say <a b c>».uc; say <a b c>>>.uc
camelia (A B C)
(A B C)
Zoffix Yeah
turdmonkey Why are there three ways to represent infinity?
Zoffix turdmonkey: full list here: docs.perl6.org/language/unicode_ascii
turdmonkey: oh, sorry, the `*` is not Inf. It's the "Whatever" object. And in some methods it represents an `Inf` 15:05
15:05 comborico1611 joined
Juerd raschipi: Slightly frustrating, but not because the "recommendations" (they're not really recommendations, more suggestions) aren't followed. I'm mostly frustrated with the things that make Perl 6 hard to learn or work with. 15:05
raschipi Juerd: they don't make it hard, they aren't problems in practice. 15:06
Juerd raschipi: Regarding hashes, 'hash' was never my preference until the other two were deemed too confusing. Although 'hash' is ugly, I think it's better to use something that's consistently safe, than to switch between constructs based on what's safe for specific contents.
Zoffix m: multi pick-a-number(Whatever:D) { ^100 .rand }; multi pick-a-number(Int \n) { n.rand.Int }; pick-a-number 42; pick-a-number *
camelia ( no output )
Zoffix m: multi pick-a-number(Whatever:D) { ^100 .rand }; multi pick-a-number(Int \n) { n.rand.Int }; say pick-a-number 42; say pick-a-number *
camelia 30
Juerd raschipi: Regarding $, it may just be disagreement about whether hidden or hard-to-detect state is bad or not. 15:07
Zoffix turdmonkey: so ^ here, I made "Whatever" mean "100"
15:07 zakharyas left
El_Che Juerd: I agree with you if the argument is timtowtdi if it make sense and a sane default when doesn't 15:07
Juerd raschipi: But in general, I'm not pessimistic at all. A few of my suggestions have made it into the language, and I don't take the rejections personally :D
raschipi I don't see how the traditinal $i would make it any different than just $. 15:08
Juerd raschipi: $i can't be used without declaring it.
raschipi: $ can
Zoffix Juerd: but I can declare that state with `my $i` in outer block.