🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
jdv79 is there a terse Map construction form? 01:14
as in we have () for list and [] for array and {} for hash 01:15
AlexDaniel jdv79: not that I know of 01:16
jdv79 is there a way to bind a value in a {}? that could work also. 01:18
AlexDaniel m: my %e := Map.new(‘a’, 1, ‘b’, 2); %e<c> = 42; dd %e 01:20
camelia Map.new((:a(1),:b(2)))
AlexDaniel hmmm
shouldn't it like… complain?
6c: my %e := Map.new(‘a’, 1, ‘b’, 2); %e<c> = 42; dd %e
committable6 AlexDaniel, gist.github.com/09943cb4d55dc59ffa...23ef291df6
AlexDaniel bisect: my %e := Map.new(‘a’, 1, ‘b’, 2); %e<c> = 42; dd %e
bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=b9105f1). Old exit code: 1
AlexDaniel, bisect log: gist.github.com/c807602ef81cff6761...728e4e84b1 01:21
AlexDaniel, (2019-07-24) github.com/rakudo/rakudo/commit/2e...d8eb3b9fee
jdv79 i think only exists pairs are immutable
*existing
AlexDaniel R#3617 01:24
linkable6 R#3617 [open]: github.com/rakudo/rakudo/issues/3617 [regression] Modifying a Map no longer complains
jdv79 the last bits of docs.perl6.org/type/Pair#method_freeze look odd 01:32
what does "create a new Pair, with a decontainerized key/value" mean and the example looks borked 01:33
AlexDaniel github.com/Raku/doc/commit/41d2504...eebae1R308 01:36
yeah, no idea what was meant there
jdv79: I guess the example is trying to say “just call .Map.head” on it 01:37
jdv79 i think its implying that Map coercion is the only way?
yeah. lame.
cpan-raku New module released to CPAN! PDF::Class (0.4.3) by 03WARRINGD 06:30
Geth_ doc: e3d6e59274 | (JJ Merelo)++ | 2 files
Z with empty argument #2632
08:25
doc: fa11c36329 | (JJ Merelo)++ | doc/Language/operators.pod6
Reduce + with a single argument #2632
linkable6 DOC#2632 [open]: github.com/Raku/doc/issues/2632 [Hacktoberfest][RFE][big][docs][good first issue][help wanted][new][⚠ Top Priority ⚠] Checklist for 6.d
Link: docs.raku.org/language/operators
xinming_ releasable6: status 08:52
releasable6 xinming_, Next release will happen when it's ready. 4 blockers. 166 out of 307 commits logged (⚠ 3 warnings)
xinming_, Details: gist.github.com/1622753373769e8c97...c3319970cf
tbrowder .tell dwarring +++ excellent, david! 10:48
tellable6 tbrowder, I'll pass your message to dwarring
chloekek Is it possible to embed Rakudo in a C program? 10:54
I guess it would be similar to main.c but without the CLI part. 10:55
lizmat chloekek: in Perl, there's Inline::Perl6: you could argue that that's embedding Rakudo in a C program 11:01
chloekek Thanks, I’ll check how that works.
cpan-raku New module released to CPAN! Gnome::GObject (0.16.4) by 03MARTIMM 13:33
ParsonsNose Can anyone give some insight as to why this doesn't work? 13:38
p6: sub test(::T, T $foo --> T) { $foo } ; test Str, "foo"
camelia Died with X::TypeCheck::Return
in sub test at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat ParsonsNose: I think you have found a bug 13:50
temporary workaround would be to remove the return value (--> T) from the signature
ParsonsNose A wild bug! How exciting. Real use case is a bit more complex -- T has a LUB, so I'm specifying the constant LUB role as the return type instead, and that seems to work. I guess I should file a :bug: report then... 13:53
lizmat yes, please :-) 13:59
ParsonsNose Filed. Thanks for confirming that it was, in fact, a bug and not just me being an idiot 14:04
jdv79 why is there a short form for object hash construction but none for a map? 14:58
are obj hashes more used than a map? 14:59
Altai-man_ a quick simple regex question: how do I find last occurrence of something? e.g. 15:15
m: say 'if { if else } else {}' ~~ m{ << (else) >> } 15:16
camelia 「else」
0 => 「else」
Altai-man_ m: say ('if { if else } else {}' ~~ m{ << (else) >> }).from
camelia 8
Altai-man_ this but 15
modifying things outside of regex is cool, but I don't want to do something like "reverse the string" kind of things 15:17
m: say ('if { if else } else { else }' ~~ m:g{ [<< (else)]+ >> }).tail.from 15:20
camelia 22
Altai-man_ m: say ('if { if else } else { else }' ~~ m:g{ [<< (else) >> ]+ }).tail.from 15:22
camelia 22
Altai-man_ oh noe 15:24
AlexDaniel chloekek: any way I can use use CRAI instead of github.com/moritz/perl6-all-modules ? 15:25
AlexDaniel chloekek: for example, can I get a list of all latest tars so that I can download them? 15:26
chloekek: for example in json form
chloekek AlexDaniel: database.crai.foldr.nl/sqlite.sqlite3 then SELECT url FROM archives
AlexDaniel ouch sqlite 15:27
chloekek AlexDaniel: but there is no easy way to sort version numbers, I am working on a fix for that
AlexDaniel: alternatively you can scan github.com/chloekek/raku-nix/tree/.../ecosystem for url = "([^"]*)"; but this is not yet automatically updated. 15:28
AlexDaniel okay maybe next time… I'm not ready to introduce a dependency on DBIish
chloekek raku-nix sorts version numbers. 15:29
And has the latest version of each distribution.
I’m currently rewriting CRAI to be a lot simpler, I can add an endpoint that prints the latest version of each distribution in a machine-readable format. 15:31
m: say dirname('/a/b/c') 15:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
dirname used at line 1
chloekek AlexDaniel: do you mind running code yourself? 15:38
AlexDaniel: if not, I’ll hopefully finish p6c crawling today, and thatll be a standalone module (depending only on git) 15:39
It’s a single subroutine that returns a Seq of URLs
Oh well it depends on JSON::Fast I guess
And LibCurl, nevermind :sweat_smile: 15:40
chloekek brb 15:42
AlexDaniel chloekek: yes, I'm fine with running code myself. JSON::Fast and libcurl are fine 15:43
AlexDaniel chloekek: actually, I'll probably just change perl6-all-modules to use that instead of whatever it attempts to do currently 15:59
Geth_ doc/fix-test_files: 046d89fd4b | (Stoned Elipot)++ | lib/Test-Files.pm6
Also split TEST_FILES on newlines

This allows multiple files to be set in TEST_FILES environment variable from a shell command substitution, hence with embedded newlines
16:10
Geth_ doc: stoned++ created pull request #3327:
Also split TEST_FILES on newlines
16:10
Altai-man_ m: sub a($a ;; $b) {} 16:19
camelia ( no output )
Altai-man_ so just what is... this? 16:20
Altai-man_ >To exclude certain parameters from being considered in multiple dispatch, separate them with a double semicolon. 16:20
tbrowder Happy Easter to all! 16:22
question about my local Raku compunits used by zef: 16:23
tbrowder are things like api keys "safe" relative to "normal" root privileges? 16:26
Geth_ doc: acb3067f63 | Coke++ | doc/Language/operators.pod6
fix typo
16:42
linkable6 Link: docs.raku.org/language/operators
Geth_ doc/fix-test_files: e6dfe0bfa3 | (Stoned Elipot)++ | lib/Test-Files.pm6
Fix previous, and while here, split TEST_FILES on any whitespace

thanks @coke!
16:49
sena_kun So now out of 317 examples we have, we can successfully parse (and potentially highlight) 237, nice. 17:36
m: say 237 / 317;
camelia 0.747634
Geth_ doc: 046d89fd4b | (Stoned Elipot)++ | lib/Test-Files.pm6
Also split TEST_FILES on newlines

This allows multiple files to be set in TEST_FILES environment variable from a shell command substitution, hence with embedded newlines
17:45
doc: e6dfe0bfa3 | (Stoned Elipot)++ | lib/Test-Files.pm6
Fix previous, and while here, split TEST_FILES on any whitespace

thanks @coke!
doc: 370d238f68 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | lib/Test-Files.pm6
Merge pull request #3327 from Raku/fix-test_files

Also split TEST_FILES on newlines
chloekek Ugh, private repos in p6c source-urls. 17:47
AlexDaniel chloekek: hahaha 17:50
chloekek Git asks for password when I run the CRAI cron job.
;_;
chloekek GIT_ASKPASS=false GIT_TERMINAL_PROMPT=0 does the trick. 18:03
Really nice that you can use temp with hash assignments! temp %*ENV<GIT_ASKPASS> = 'false';
chloekek p6: my %h; { temp %h<a> = 1; say %h<a> }; say %h<a> 18:04
camelia 1
(Any)
Geth_ doc/xt-recent: 0b4f443b71 | (Stoned Elipot)++ | util/xt-recent.sh
Do not use a local(?) git alias

while here simplify pipeline
18:17
Geth_ doc: stoned++ created pull request #3328:
Do not use a local(?) git alias
18:17
AlexDaniel chloekek: you can?! 18:18
chloekek Holy shit yes you can. 18:19
AlexDaniel that's amazing
moritz p6: my %h; { temp %h<a> = 1; say %h<a> }; say %h<a>:exists 18:20
camelia 1
True
moritz that's the downside 18:21
%h<a> returns a writable container, which is why assigning to it works, and which is why temp can temp it
so when the scope ends, temp resets the container the value it had before (Any), but it doesn't even know there's a hash, so it cannot remove the key
AlexDaniel p6: my %h; { temp %h<a> = 1; say %h<a> }; dd %h 18:22
camelia 1
Hash %h = {:a(Any)}
AlexDaniel riight
chloekek p6: { temp %*ENV<GIT_ASKPASS> = 'false'; }; run('sh', '-c', 'echo $GIT_ASKPASS') 18:25
camelia
chloekek p6: { temp %*ENV<GIT_ASKPASS> = 'false'; }; run('env') 18:26
camelia HOME=/home/camelia
MAIL=/var/mail/evalbot
PATH=/usr/bin:/bin:/usr/sbin:/sbin
XDG_SESSION_ID=c681
SUDO_COMMAND=/home/camelia/rakudo-m-inst/bin/perl6-m --setting=RESTRICTED <tmp>
GIT_ASKPASS=
USERNAME=evalbot
XDG_RUNTIME_DIR=/run/user/1017…
chloekek Oops lmao.
chloekek AlexDaniel: I now have two fairly standalone modules that can retrieve archive URLs from CPAN and p6c, you can use those if you want. 18:44
Dependencies are LibCurl, JSON::Fast and git.
AlexDaniel nice
how? link?
chloekek github.com/chloekek/crai/blob/v2/c...an.rakumod and github.com/chloekek/crai/blob/v2/c...6c.rakumod
POD is at the end.
AlexDaniel hm 18:45
so github understands ```raku but not .rakumod ?
chloekek I guess :þ 18:46
It annoys me too
I’m wondering if Git archive URLs should use tags instead of commits. 18:47
Problem is tags can be rewritten, so probably no.
AlexDaniel chloekek: maybe use tag-commit format, or something like that? 18:51
then it's both readable and unique
chloekek I prefer not to clone each repo.
ls-remote lists all refs on a remote.
AlexDaniel tbh I'm not sure what you're referring to :D
Too few positionals passed; expected 1 argument but got 0 in sub list-p6c-sources 18:52
my code: use Crai::P6c; .say for list-p6c-archives;
using crai in v2 branch 18:53
chloekek lol huh
AlexDaniel the code is taken from the example in one of the files you provided :)
chloekek: heh, ==>, I see you're really having fun with the language :) 18:55
chloekek Ah yeah you have to pass a LibCurl::Easy instance.
I updated the module. 18:56
chloekek AlexDaniel: Particularly proud of { !$++ || .[1] ne 'HEAD' } 18:56
Skips the HEAD line unless it’s the first line. 18:57
AlexDaniel chloekek: I really enjoyed code-golf.io but even I have no idea :P
chloekek: what's next, fff? :) 18:58
chloekek ff is great.
State variables being properties of the surrounding block, rather than being globals, is one of my favorite Raku design decisions.
melezhik I've written a short post announcing a Web UI for RakuDist - sparrowdo.wordpress.com/2020/04/12...te-web-ui/ 18:59
AlexDaniel it's really interesting, there are so many features that you don't see in most code bases. Then you stumble upon a project that does use them, and it's kinda refreshing and scary at the same time :)
chloekek I write Python at work, I get tired of “boring code”.
AlexDaniel I see :) 19:00
chloekek weekly: sparrowdo.wordpress.com/2020/04/12...te-web-ui/ # melezhik++ 19:01
notable6 chloekek, Noted! (weekly)
AlexDaniel chloekek: see, just bombard that API ↑ and you'll have test stats in CRAI :D 19:03
chloekek I wish you could put comments in URLs.
Like you can put comments in email addresses.
Hmm wait, you can put fragments in URLs, I wonder how various tools treat them, such as Nix and curl. 19:04
AlexDaniel raku.org/#sule,why-not? ?
sure*
chloekek Because having github.com/owner/repo/archive/comm...gz#tagname 19:05
That would be amazing.
AlexDaniel shareable6: HEAD#test-test
shareable6 AlexDaniel, whateverable.6lang.org/HEAD#test-test
AlexDaniel dat works
chloekek Yeah, curl seems to ignore it. But Nix complains. :( 19:06
Well, I suppose tools that croak can just filter them out themselves. :)
AlexDaniel chloekek: ok, it's running. Sloow. 19:08
chloekek Yep, GitHub is slow. 19:09
melezhik chloekek: thanks 19:10
Geth_ doc/str-index-i_m: 9d04f32134 | (Stoned Elipot)++ | 2 files
Document Str.index ignorecase/ignoremark

while here:
  - Str.index is a method: adjust section heading and use it in examples
  - revisit Cool.index description
19:14
doc: stoned++ created pull request #3329:
Document Str.index ignorecase/ignoremark
Geth_ doc/str-starts-with-i_m: befa0cedd3 | (Stoned Elipot)++ | doc/Type/Str.pod6
Document Str.starts-with ignorecase/ignoremark

XXX Should Cool.starts-with be documented ?
19:18
chloekek AlexDaniel: What’s fun is that downloading most archives is faster than just finding them.
AlexDaniel chloekek: I have a question… do you treat these .tar.gz's from github as if they're immutable? 19:19
I mean, that fetching them again will result in the same file 19:20
chloekek Yes, that’s very important. 19:23
AlexDaniel chloekek: okay. Well, oops? :)
I don't think that's the case
chloekek Unfortunately GitHub sometimes changes these.
AlexDaniel yeah
chloekek It’s very annoying but I don’t know a good solution.
Other than mirroring them, I guess.
I also don’t know exactly what the difference is. 19:25
Perhaps order of files or something silly like that.
AlexDaniel you can also normalize them somehow
or whatever you'd call that
chloekek Hash the extracted files.
chloekek Mirroring is probably easier, but also more expensive (financially, not computationally). 19:27
AlexDaniel yeah, unfortunate. Storing individual tars is wasteful, but how else can you guarantee that they stay exactly the same. 19:32
chloekek AlexDaniel: How did you observe that it’s not consistent? 19:42
AlexDaniel chloekek: not now, I just stumbled upon the issue in the past, don't remember why 19:43
chloekek Ah yeah. 19:44
chloekek There is already one package on CRAI that suffers from this. 19:44
MIME::Base64
chloekek AlexDaniel: I have an idea: first download from GH, only if the hash doesn’t match, download from the mirror. 19:55
Then the load on the mirror should be minimal.
melezhik AlexDaniel: chloekek: if you start "bombard that API ↑ " there could performance issues, as the VM resources is limited and API itself is not optimized
but ... please let me know I'd more then happy to help 19:56
chloekek AlexDaniel: Though, I have never looked at things like CDNs, maybe they’re very cheaps.
S3 is out of the question for me because of ethical concerns, but there are probably good alternatives. 19:57
Wouldn’t mind paying a few € each month, already do so to host the app (Hetzner). 20:00
El_Che github immutable = it should be if you only download tags and tags aren't moved around 20:13
Doc_Holliwood m: sub f() returns (Bool) { 1 }; say f()
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed trait
at <tmp>:1
------> 3sub f() returns7⏏5 (Bool) { 1 }; say f()
Doc_Holliwood m: sub f() returns Bool { so 1 }; say f()
camelia True
Doc_Holliwood fine 20:14
chloekek p6: print '%23'.subst(/'%'(<xdigit>**2)/, { chr(:16($0)) }, :g); 20:16
camelia This call only converts base-16 strings to numbers; value Match.new(:orig("\%23"), :from(1), :pos(3), :hash(Map.new((:xdigit([Match.new(:orig("\%23"), :from(1), :pos(2)), Match.new(:orig("\%23"), :from(2), :pos(3))]))))) is of type Match, so cannot be…
AlexDaniel melezhik: I'm kidding, of course, but it's an interesting opportunity in general :) 20:33
El_Che: yeah! Wrong
El_Che: and those who tried signing release tars provided by github learned it the hard way :) 20:34
melezhik AlexDaniel: chloekek: An idea. I could adjust RakuDist to test Nix Raku packages, something could be useful for CRAI test? to see if packages get broken, etc
AlexDaniel El_Che: we don't do that and we never did, but then there's another problem: people occasionally download the wrong tar… 20:35
which btw you cannot disable on github
chloekek melezhik: That would be neat.
raku-nix is still in its infancy though, many things break. 20:36
melezhik so rakudist/sparrow are ;-) 20:37
chloekek Currently I have CI, but it only tests precompilation, does not run tests.
github.com/chloekek/raku-nix/actions
AlexDaniel weekly: It's all about the modules! :) melezhik is working on RakuDist and chloekek is working on CRAI. Pretty cool.
notable6 AlexDaniel, Noted! (weekly)
chloekek Lol that CI is extremely broken. 20:38
melezhik chloekek: let me check that 20:39
chloekek Because I don’t currently generate default.nix, so most packages are missing from it.
I’ll fix that immediately.
melezhik if you brief me what exactly this CI does?
github.com/chloekek/raku-nix/runs/...focus=true 20:40
melezhik looks like just build nix pakages for raku ecosystem? 20:41
melezhik oh, and I see that - github.com/chloekek/raku-nix/blob/...ows/ci.yml 20:43
chloekek It precompiles each distribution listed. 20:44
Using a Nix derivation (package description) generated from META6.json.
melezhik yeah ... where packages are published to, aftewards?
chloekek They aren’t. People can use raku-nix and build themselves, using Nix. They will hopefully get the same build output. 20:46
At some point I want to set up a Nix cache, and then Nix will automatically pull from there.
For instance, I use raku-nix to build CRAI, so when I build CRAI, Nix will fetch all dependencies, build them from source if necessary. 20:47
melezhik yeah, what is CRAI?
is it a nix repo? 20:48
chloekek It’s an app, and I build it with Nix.
melezhik sorry I need to go, ttl
chloekek Nix is a package manager, but also a build system.
melezhik yeah. I am interested how sparrow/rakudist could be useful in building / testing nix based Raku distribution 20:49
could send me a link to CRAI as well? 20:51
chloekek Pretty much all you have to do is install Nix, clone raku-nix, then nix build -A $PACKAGE. It will then write to stdout the path to the build output.
github.com/chloekek/crai computes hashes of packages (Nix requires hashes to check integrity)
I generate the Nix package descriptions from the information collected by CRAI 20:52
Goodbye for today, brain = fried. 21:01
cpan-raku New module released to CPAN! Data::Record (0.2.3) by 03KAIEPI 22:54