»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Geth doc: b2367a396c | (JJ Merelo)++ | 2 files
Some reflow, also adds subtitle
00:57
ugexe gist.github.com/ugexe/2fa62c2d498f...47e4a231aa my polyglot variant of the hamming number challenge 02:58
guifa ugexe: is it possible to do an entire directory or wildcard matched resources include? 03:06
Or does each file need to be named individually? 03:07
ugexe they need to be named individually. the fact this isn't done for bin/ is something that will eventually change 03:08
guifa Alright, that’s what it seemed like when I was testing out foo/* and foo/ but wanted to check. 03:09
ugexe the reason is we want to be able to reason about what a distribution contains without having to even download the distribution
guifa That makes sense. I’m trying to limit memory consumption so I’ve started separating things out into per-language files so they can be loaded as needed rather than all at once 03:10
There’s just… 750 language files 🤦 03:11
hythm hello, When I add LAST phaser inside a sub body, looks like, every loop increment "$" var 03:24
p6: my @a = <1 2>; sub run { my $v = @a.first; loop { say $v; $v = @a[++$ mod 2]; LAST {} } }; run
p6: my @a = <1 2>; sub run { my $v = @a.first; loop { say $v; $v = @a[++$ mod 2]; } }; run # removing LAST {} works as expected 03:25
AlexDaniel m: my @a = <1 2>; sub run { my $v = @a.first; loop { say $v; $v = @a[++$ mod 2]; LAST {} } }; run
evalable6 (signal SIGHUP) 1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
hythm, Full output: gist.github.com/bd535af15c91bd9bb5...b8eff4f142
AlexDaniel ah… :)
AlexDaniel very nice of evalable6 to gist the whole thing 03:26
evalable6 (signal SIGHUP) 1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
03:26
AlexDaniel, Full output: gist.github.com/38ebc08f67ea1c2feb...eb42b3bebb
(signal SIGHUP) 1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
hythm in repl the version without LAST {}, shows 12121212...
evalable6 hythm, Full output: gist.github.com/dcbfc4dbc59e5f7395...79bc123e60 03:27
hythm if not inside sub block it works fine in both cases
AlexDaniel m: my @a = <1 2>; sub run { my $v = @a.first; for ^10 { say $v; $v = @a[++$ mod 2]; LAST {} } }; run 03:28
evalable6 1
2
1
2
1
2
1
2
1
2
AlexDaniel m: my @a = <1 2>; sub run { my $v = @a.first; for ^10 { say $v; $v = @a[++$ mod 2] } }; run
evalable6 1
2
1
2
1
2
1
2
1
2
AlexDaniel so that's only in `loop`?
hythm no 03:29
m: my @a = <1 2>; my $v = @a.first; loop { say $v; $v = @a[++$ mod 2]; LAST {} } # withput sub {} its working fine 03:31
if inside sub {} it shows 222222222, like the first one I pasted
evalable6 (signal SIGHUP) 1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
03:32
hythm, Full output: gist.github.com/ee0b825a4c2bf4387f...80e9e90268 03:33
hythm aaah, I see, yeah looks like inside loop only, since it worked fine with `for'
AlexDaniel m: my @a = <1 2>; sub run { my $v = @a.first; my $a = 0; loop { exit if $a++ > 10; say $v; $v = @a[++$ mod 2] } }; run 03:37
evalable6 1
2
1
2
1
2
1
2
1
2
1
AlexDaniel easier on the bot a bit :)
hythm yeah sorry about that, I should have added exit condition :) 03:39
hythm so is this a bug so I can report? 03:39
also using explicit var `$i` instead of `$` works fine without issue 03:42
discord6 <Tyler (Aearnus)> hey all, is it possible to define an operator as a method a la ruby? 03:46
lookatme_q I am afraid not 04:12
You can checkout how they implemented `[]` with AT-POS 04:13
moritz you can't, because an operator has lexical scope, but a method is scoped to the invocant 05:18
Elronnd I have an error of 'missing block' '<BOL>⏏<EOL>' - 'expecting any of: statement end' 05:51
how am I supposed to parse that?
moritz BOL stands for "begin of line", EOL for "end of line" 05:52
so, there's an empty line, where Perl 6 expects a statement end
Elronnd yes 05:53
ah, I forgot to close a brace
Xliff .tell sena_kun Where are all the types you have here coming from? github.com/Altai-man/cro-ldap/blob.../Types.pm6 06:13
yoleaux Xliff: I'll pass your message to sena_kun.
Elronnd you know what would be really nice? If the 'use of uninitialized value of type Any' error told you the name of the variable you were trying to access 06:21
moritz m: my $x; say "foo $x" 06:26
evalable6 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.
foo
in block <unit> at /tmp/1bn0TvBLvC line 1
discord6 <Tyler (Aearnus)> just watched Conway's "on the shoulders of giants" talk it was very good 07:13
sena_kun 08:32
yoleaux 06:10Z <Xliff> sena_kun: Where are all the types you have here coming from? github.com/Altai-man/cro-ldap/blob.../Types.pm6
sena_kun .tell Xliff they are generated and exported during precompilation, so technically from github.com/Altai-man/cro-ldap/blob...pes.pm6#L3 <- this line 08:35
yoleaux sena_kun: I'll pass your message to Xliff.
kawaii good morning :) 08:36
sena_kun o/ 08:37
kawaii AlexDaniel: got a nice big server for doing build/blin stuff, will kick off Blin later today 08:47
kawaii AlexDaniel: I have Blin questions, if you have time to answer them :) 09:54
AlexDaniel kawaii: what's the question? :) 09:55
kawaii So, testing modules from the ecosystem - I just ran a basic blin test for Cro::HTTP against 2019.03 and HEAD, which worked fine.... So should I be testing the entire ecosystem here? What about the modules with deps that need to be sourced and compiled manually? Sounds like a lot of work 09:56
Or are there a set of common modules I should always test
I don't know that it's our duty to check that everything in the ecosystem works all the time 09:57
especially when the language is 'new' and in constant rapid development
AlexDaniel kawaii: see this: github.com/perl6/ecosystem-unbitrot/wiki 09:58
kawaii: IIRC you might have a problem installing a package or two, but otherwise that list is correct
kawaii Yep, but take a module like Redis::Async for example, which requires a C library you need to download and compile yourself, there is no package for eredis
AlexDaniel kawaii: I don't see it in the list here: github.com/perl6/ecosystem-unbitrot/issues 09:59
===> Install [OK] for Redis::Async:ver<0.6>:auth<github:CurtTilmes> 10:00
kawaii wiki page might need updating www.irccloud.com/pastebin/wG2aFrq4/
AlexDaniel kawaii: libcurl4 is in debian testing/unstable 10:01
AlexDaniel kawaii: same for other packages in that ilst, actually 10:02
IMO it's ok to be unable to install deps for a few modules, especially if they require packages that are not readily available in debian yet 10:03
kawaii www.irccloud.com/pastebin/7hVHCXd0/ 10:05
AlexDaniel: ¯\_(ツ)_/¯
I guess this is okay
I assume it has no tests then that actually use the module
and just tests if it installs correctly
kawaii AlexDaniel: `⏳ 137 out of 1260 modules processed` 11:37
seems to be going well 11:38
holyghost is going to look into freecol.org for gigs and perl6 12:03
kawaii `⏳ 761 out of 1260 modules processed` 13:07
zzzz
AlexDaniel kawaii: if you get “/tmp/blah blah is locked” messages, that is fine 13:45
it's about two modules being bisected at the same time and hitting the same rakudo commit 13:46
one has to wait because that's a limitation in whateverable
it can be easily lifted now given that rakudo is relocatable
kawaii haven't seen it yet! we're just over 1000 modules tested niw 13:52
now**
AlexDaniel kawaii: how is it? :) 14:51
kawaii AlexDaniel: `⏳ 1156 out of 1260 modules processed`
nearly done :)
sena_kun I can't call ^compose on newly created type twice, can I? 15:41
timotimo you can; i'm not sure we guarantee it'll be fine, though? 15:43
kawaii a usercontent.irccloud-cdn.com/file/.../data.json 15:44
AlexDaniel: ^ done!
sena_kun well, I meant guarantees, as I am having weird behavior with attributes: they are present, but somehow when I am doing `.new(foo => 1)`, $.foo is still Int. 15:45
kawaii I think I may need to do this again, as I didn't have _all_ of the module deps, the ones from Debian unstable
sena_kun now trying to golf...
timotimo ah, the constructor may only be built once
sena_kun I wonder if it is too dark magic and I am already run out of Luck points...
timotimo we do compile custom code for that
at a certain point
sena_kun hmmm... 15:46
timotimo it's triggered in Mu.pm6 i believe
sena_kun well, mind if I describe a problem A instead of problem B?
timotimo and it lives in the compiler services part of rakudo
sena_kun ok, so... I am generating types using MOP, types can be nested(so a class has typed attributes) and, a lot worse, types can be recursive. So I wrote a simple detector for recursive cases and when I see that an inner type is the same as its parent, it doesn't try to generate it and loop, but sets a stub like "Here is a stub, it will be updated later" as the attribute value. Later I am checking my generated types and if it sees a stub, I 15:53
am re-generating it, given that the parent type is compiled already and the chain is un-tied. But if the parent type had another parent, this one will have the old version with stubs in its attribute type.
timotimo can always make things run-time type-checked 15:54
sena_kun So I was thinking "I can store not yet composed parent and then update it too, when recursive type will be un-tied", but apparently I cannot do anything with not yet composed types, I cannot say "Ok, here is a base, sometime in the future it will be composed".
I must use explicit typing.
I store ASN metadata this way, no other option. 15:55
timotimo mhm
melezhik Hi! How to pass perl6 inc when run perl6 under sudo? for example: perl6 -MFoo works fine , provided that Foo module is installed for the current user. However sudo perl6 -MFoo fails , because Foo is not installed into system path
sena_kun *it will be composed in the future, and when we will deal with its child, we will update the parent attribute type too
timotimo melezhik: you can use -I to put an inst# thingie in there 15:56
m: say $*REPO.repo-chain
evalable6 (file#/home/bisectable/git/whateverable/sandbox/lib inst#/home/bisectable/.perl6 inst#/tmp…
timotimo, Full output: gist.github.com/ad7e105036c0a73bc6...2864b2edf7
timotimo use this to find the right thing to pass
melezhik the workaround is sudo env USER=$USER perl6 -MFoo, but I don't like it for other reasons
unfortunately I can only tweak PELR6LIB or ether env vars , but have no control over options when run perl6 interpreter 15:57
timotimo ok, but that can also go in PERL6LIB i believe 15:58
AlexDaniel kawaii: looks about right, this is what update-issues.p6 script in ecosystem-unbitrot repo will do: gist.github.com/AlexDaniel/4117656...f67d7c196f
sena_kun please, never mind my issue...
melezhik I also think that
melezhik however sudo env PERL6LIB=~/.perl6 perl6 -MFoo does not work 15:58
AlexDaniel kawaii: you can check out the new ones to see if there's anything you can install for them 15:59
timotimo yeah, that's not correct 16:04
as i said, use $*REPO.repo-chain's contents to see what you have to pass 16:05
it has to be the right type, which is what goes in front of the #
BBL
atroxaper 16:11
melezhik ok, timotimo: what should I do ? I'm basically looking for the way through setting PERL6LIB properly ... 16:14
Geth doc: pmqs++ created pull request #2715:
Fix broken link for IO::Glob
16:22
ugexe melezhik: compare the output of `say $*REPO.repo-chain` with and without sudo. the difference will show you what path is missing/incorrect 16:26
Xliff . 16:31
yoleaux 08:35Z <sena_kun> Xliff: they are generated and exported during precompilation, so technically from github.com/Altai-man/cro-ldap/blob...pes.pm6#L3 <- this line
melezhik ugexe: thanks, will try 16:32
well, it's (inst#/home/melezhik/.perl6 inst#/opt/rakudo-pkg/share/perl6/site inst#/opt/rakudo-pkg/share/perl6/vendor inst#/opt/rakudo-pkg/share/perl6 ap# nqp# perl5#) for user 16:33
and is inst#/root/.perl6 inst#/opt/rakudo-pkg/share/perl6/site inst#/opt/rakudo-pkg/share/perl6/vendor inst#/opt/rakudo-pkg/share/perl6 ap# nqp# perl5# for sudo
the question is what value should I add to PERL6LIB for sudo? 16:34
Xliff sena_kun: No such method 'tc' for invocant of type 'ASN::RawType' 16:36
sena_kun Xliff, I am in the middle of super-huge refactoring, so don't bother. Sorry.
AlexDaniel kawaii: I'm surprised that none of the modules were bisected… weird
Xliff sena_kun: Awww. 16:37
AlexDaniel kawaii: is it really possible that there are no regressions found in modules during this month?
Xliff sena_kun: Commit has before the refactor started?
AlexDaniel I have never seen that in a year
sena_kun Xliff, though I hope that I am closer to the end of it, because it is a third day of straight hell already... You can install ASN::Grammar with latest commit removed. 16:38
Xliff, but better to wait until I'll push everything.
Xliff Well, I was hoping to try something to help clean up Cro::LDAP
sena_kun Xliff, can you wait a day or two? :) 16:39
Xliff Sure! I will continue to peck though. ;)
sena_kun Xliff, roger. 16:40
kawaii AlexDaniel: it certainly seems that way?
AlexDaniel kawaii: maybe double check the ones that have ZefFailure but no timeout in the output 16:41
ugexe melezhik: its pretty clearly a shell expansion issue 16:48
give the full path instead of ~/ which might point at the root home or user home depending on how you invoke it
nothing related to perl6
ugexe so you'll want something like 16:53
PERL6LIB=inst#/home/melezhik/.perl6
timotimo does rakudo actually home-expand paths in perl6lib?
ugexe no
timotimo OK
ugexe but the shell does
although it cant in the above example
inst#~/.perl6 wouldnt expand for instance 16:54
timotimo right
MasterDuke Xliff: what module is 'Color'? 16:59
Xliff MasterDuke: That was Zoffix's 17:00
MasterDuke ah, thanks
Xliff np
melezhik ugexe: does not work - gist.github.com/melezhik/2151efe82...9810c6c52e 17:51
timotimo why do you have PERL6LIB=PERL6LIB= there? 17:52
Geth ecosystem: petrkol72++ created pull request #447:
Add vCard::Parser
17:55
melezhik sorry. typo . sudo env PATH=$PATH PERL6LIB=inst#/home/melezhik/.perl6 perl6 -MJSON::Tiny did the trick!
yeah. thanks
so it's just a shell expansion error
thanks to all 17:56
((
guifa Ooh! So this is cool 17:57
Normally when you dump a has it uses { key => val, key => val }
But if the key is RTL, it uses { val <= key }
AlexDaniel ? O_o 17:58
guifa Well, it’s not consistent, but it did for one of my print outs
timotimo hahaha 17:59
guifa {, ;%-+E׉∞NaN: => 2, ,.;%-+E·‰∞NaN: => 0, … ٫٬؛٪؜؜-؜+اس×؉∞ليس رقم: => 0}
jmerelo hi! 18:06
Xliff m: %h = ( 1 <= a, 2 <= b ); %h.gist.say
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/OPB6PJsrMS
Variable '%h' is not declared
at /tmp/OPB6PJsrMS:1
------> 03<BOL>08⏏04%h = ( 1 <= a, 2 <= b ); %h.gist.say
Xliff m: my %h = ( 1 <= a, 2 <= b ); %h.gist.say
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/P5ynGkhXRg
Undeclared routines:
a used at line 1
b used at line 1
Xliff m: my %h = ( 1 <= 'a', 2 <= 'b' ); %h.gist.say
evalable6 (exit code 1) Cannot convert string to number: base-10 number must begin with valid digits or '.' in '03⏏04a' (indicated by ⏏)
in block <unit> at /tmp/evjIaSNyFl line 1
Xliff OK... guifa got me. :P
guifa I don’t think it works for defining them in code, just for printing out 18:08
<= is others just less than or equal to, so ‘a’ can’t convert to a number 18:09
Geth ecosystem: f7f522a8e4 | petrkol72++ (committed using GitHub Web editor) | META.list
Add vCard::Parser
ecosystem: a1891be8ef | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #447 from petrkol72/patch-1

Add vCard::Parser Thanks!
guifa oh! It actually isn’t perl’s doing. It’s from the bidi print out. The <= is actually sequenced internally as equals followed by less than 18:10
err a greater than
But because the text is RTL, it flips it to <= just like it would do a question mark 18:11
ugexe m: my %h = "value1" R=> "key1", "value2" R=> "key2"; say %h 18:15
evalable6 {key1 => value1, key2 => value2}
guifa m: my %h = ("\x661" => "\x6F1\x6F2\x6F3","\x664" => "\x6F4\x6F5\x6F6"); say %h; 18:16
evalable6 {١ => ۱۲۳, ٤ => ۴۵۶}
guifa hrm, that didn’t trigger it
m: my %h = ('ح' => '۴۵۶', 'د' => '۱۲۳',); say %h; 18:17
evalable6 {ح => ۴۵۶, د => ۱۲۳}
El_Che insights.stackoverflow.com/survey/2019/ 18:46
grep for Perl if you want to be sad 18:47
Als je het helemaal wilt maken, moet je een Perl 5 IPV6 module schrijven :) 18:49
moritz let's say that when I tink about long-term employment prospects, I'm not mad that I learned python at $work 18:52
El_Che my work skills are kind of compensated by devops and go, but it's sad that Perl 5 is not even on the dreaded list 18:53
aka bad publicity is publicity
oops (ignore the dutch) 18:56
El_Che moritz: I am pretty much having a confirmation bias on the name and infighting thingy :) 19:05
AlexDaniel “almost 70% of respondents say they are above average” hehe 19:13
El_Che AlexDaniel: Fake it until you make it, baby
moritz this could be either classical Dunning-Kruger effect, or selection bias 19:19
sena_kun Xliff, ping? 19:20
.tell Xliff I have finished patching ASN::META, so now everything should just work(at least travis and my machine both satisfied with tests). Not sure what you want to look at, but if you want to, it's the time. :) 19:23
yoleaux sena_kun: I'll pass your message to Xliff.
Xliff . 19:25
yoleaux 19:23Z <sena_kun> Xliff: I have finished patching ASN::META, so now everything should just work(at least travis and my machine both satisfied with tests). Not sure what you want to look at, but if you want to, it's the time. :)
Xliff \o/
sena_kun: That was fast. I haven't even finished lunch, yet! :) 19:26
sena_kun: Getting error "No such method 'type' for invocant of type 'Str'. Did you mean any of these? 19:27
"
No other information specified.
sena_kun Xliff, well, the amount of mind bending I had to do in order to make recursive types work consistently was extreme for my petty programming skills, so I wasn't sure how fast it'll be.
Xliff Hehe.
sena_kun Xliff, I think you want to un-install all modules if any installed: ASN::Grammar, ASN::META, ASN::BER, Cro::LDAP. 19:28
Xliff I know the feeling. I have a test for GTKSourceView that isn't working as well as the C version. Appears that I was porting an older version and now I have to go back over everytrhing.
sena_kun and then just `zef install Cro::LDAP`.
Xliff OK.
sena_kun and, by the way, it isn't really ready yet 19:29
so you might be more interesting in getting the sources
Xliff Nope. Zef can't get it.
sena_kun :(
that's odd 19:30
travis is ok: travis-ci.org/Altai-man/cro-ldap
aaaaah
sena_kun I know why zef doesn't know about it: it is not in the ecosystem yet. :) 19:30
Xliff I am installing from git
sena_kun so you have to checkout sources. 19:30
right
Xliff Figgers.
Xliff OK. Installs clean. 19:31
sena_kun \o/ 19:32
not now sure what you can do with it
are you interested in something particular? maybe I can focus on bringing this features first. 19:33
and thanks for testing the installation - at least this insane precomp thing works for someone else than me. :)
Xliff OK. Gotta /query you
sena_kun nods
Xliff OK. There is a serious problem with compile times with recent rakudos. 21:26
I have a module GTK.pm6 which is full of need statements.
If I change a file that would force a recompile in one of these need statements, it acts like all of the need statements in this module are recompiled, however there are no spawned process that would indicate this is happening until the module that is actually recompiled is reached. 21:27
The issue is that it takes way too long to reach that point.
Changing this one module should not take 30 minutes to recompile. 21:28
Xliff OK. Now finally hit the module that needed to be recompiled. Took 5 minutes, not 30. 21:29
timotimo i think we might actually be doing multiple precomps in one process nowadays? 21:30
the RAKUDO_MODULE_DEBUG env var could give insight
Xliff timotimo: OK. Next time I make a change, I will preserve the log.
Stage parse : 393.504 21:31
Wow! PROGRESS! :) 21:35
Still... it now SEGVs at the end.
I think I will take a break, for now. BBL
timotimo OK
SmokeMachine m: say((‘fizz’x$_%%3)~(‘buzz’x$_%%5)||$_)for ^20 22:06
evalable6 fizzbuzz
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizzbuzz
16
17
fizz
19
22:07
ugexe if you are working with a distribution, and not a single file, then changing 1 file currently requires all files o be recompiled because the sha1 of the distribution itself has changed
the checksum of the entire distribution is essentially used to seed the precomp files path 22:08
ugexe i'd almost bet there is no difference in compile times when using -I. instead of -Ilib (-Ilib being fast because it was severely broken) 22:19
e.g. you would have had the longer compile time in older rakudos when using -I.
which was doing the right thing unlike -Ilib
timotimo oooh 22:20
ugexe it might be possible to now fix compile times by determining if/how to replace the sha1 fast lookup bits for precomp to not be based on the entire distribution contents. and not in a fundamentally broken way like before (when using -Ilib each file/module was its own distribution by itself) 22:23
timotimo yeah, sounds tricky 22:24
ugexe to oversimplify: when you reinstall a distribution with an identical version (using :force, which is CUR api, not zef specific) it reinstalls all the files not just whatever is different 22:54
i will give an alternative (but flawed solution) to help outline what happens: github.com/rakudo/rakudo/blob/e6cb...em.pm6#L45 23:03
if -- instead of slurping that file -- we do something like CURI and use a namespace like ":file<{$_}>:ver<{$distribution.meta<ver>}>" 23:06
it will only work if you change your meta6.json info every time you change any file 23:07
but -Ilib (i.e. -I $doesnt-pount-at-authoratative-meta6) is :ver<*>:api<*>:auth<>
since we cannot know what those things are
Xliff Does rakudo properly work with multi subs and nativecall? 23:38
I tried something like this recently, and I think the answer was "No"
ctilmes_ Xliff: You can make multi subs with different but compatible arguments each be 'is native is symbol()' to the same nativecall routine 23:47
(or multi methods on a CPointer or CStruct) 23:48
Xliff Yeah. Did that and it turned out to not work so well. 23:54
Probably because the only argument that was different was the &handler. 23:55
The signature was the only difference and I think that confused rakudo.