🦋 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.
00:00 cpan-raku left, cpan-raku joined
raku-bridge <DataKinds> ruby -e 'loop { puts "hello"; break }' 😛 00:02
00:03 sena_kun joined 00:05 Altai-man_ left 00:14 quester_temp joined 00:25 flossy left 00:26 flossy_ joined
AlexDaniel still doesn't hurt to tell that it's valid Raku code too :P 00:34
00:39 pecastro joined 00:44 reach_satori left, reach_satori joined 00:55 quester_temp left
raku-bridge <DataKinds> could I bother y'all to help me understand what's going on here? modules.raku.org/dist/Cro::HTTP::S...Pg.pm6#L66 01:02
<DataKinds> what's Capture? I read the docs and it doesn't feel any clearer 01:03
<DataKinds> ahh I found it docs.raku.org/type/Mu#method_Capture 01:05
<DataKinds> that's cute
01:39 lichtkind left 01:41 oddp left 01:55 molaf left 01:57 yuplushi left 01:58 yuplushi joined 02:02 Altai-man_ joined 02:05 sena_kun left 02:07 molaf joined 02:16 schlaftier left 02:30 schlaftier joined 02:34 Zero_Dogg left 02:35 Cabanossi left 02:39 pecastro left 02:43 xinming left 02:44 xinming joined 02:46 Zero_Dogg joined, Cabanossi joined 02:48 vike left 02:55 softmoth left, hungryd48 joined 02:56 vike joined
rypervenche Is it possible for a map block to know if the variable it is working on is the last element of the list? 02:58
02:59 hungrydonkey left
raku-bridge <DataKinds> rypervenche: does the LAST phaser work? 03:55
rypervenche Oh, I just figured out a much better way to do what I'm trying to do. 03:56
03:59 evalable6 left, linkable6 left
vrurg weekly: vrurg.github.io/arfb.html 03:59
notable6 vrurg, Noted! (weekly)
04:01 linkable6 joined, evalable6 joined 04:03 sena_kun joined 04:05 Altai-man_ left 04:11 xinming left 04:12 xinming joined 04:27 hungryd48 left 04:28 OpenZen left 04:34 JRaspass left 04:43 orinthe left, orinthe joined 04:46 sivoais left 04:49 xinming left 04:50 xinming joined, brtastic joined 04:57 sivoais joined 05:00 m_athias left 05:04 molaf left 05:06 zacts joined 05:14 xinming left 05:18 xinming joined 05:24 rindolf joined 05:25 rindolf left 05:49 wamba joined 05:51 Cabanossi left 05:54 notandinus left 05:58 andinus joined 06:01 zacts left 06:02 Altai-man_ joined, Cabanossi joined 06:04 sena_kun left 06:12 JRaspass joined 06:32 brtastic left 06:40 dolmen joined 06:41 rindolf joined, dolmen left 06:43 flossy_ left 06:50 sarna joined 06:53 JRaspass left 06:58 aluaces joined, aluaces is now known as alberto, alberto is now known as Guest17178 07:09 dolmen joined 07:31 dakkar joined 07:43 leont joined 07:49 xinming left 07:53 xinming joined 07:54 Cabanossi left 08:03 sena_kun joined 08:04 aborazmeh joined, aborazmeh left, aborazmeh joined, Altai-man_ left 08:22 pecastro joined 08:29 stoned75 joined 08:30 wamba left 08:42 xinming left 08:44 xinming joined 09:02 sarna76 joined 09:03 sarna left, sarna76 left, sarna joined 09:05 synthmeat left 09:08 synthmeat joined 09:09 synthmeat left 09:12 antoniogamiz joined, synthmeat joined
antoniogamiz o/ 09:12
is there a module to make end to end testing in web pages? 09:13
09:15 aborazmeh left 09:23 wamba joined 09:24 vike left 09:26 flossy joined 09:31 vike joined 09:33 Guest17178 is now known as aluaces, eseyman left 09:34 oddp joined 09:38 eseyman joined
samebchase- What's the best way to pipe the output of program into a Raku script for further processing? Want to use it in a shell pipeline 09:43
antoniogamiz >?
09:45 stoned75 left
antoniogamiz samebchase-, idk if this can help you: stackoverflow.com/a/4643808/8849071 09:45
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/07/06/unrecursing/ 09:46
samebchase- I have been able to call external programs from Raku using `qqx`, but I want to do something like: "cat file | ./script.raku"
gfldex samebchase-: I'm actually working on the best way right now. May take another few weeks.
09:46 stoned75 joined
samebchase- gfldex: yes, I liked that blog post! 09:46
What variable should I use in Raku to refer to the piped in data?
gfldex samebchase-: docs.raku.org/language/variables#i...$*ARGFILES 09:47
antoniogamiz samebchase-, maybe docs.raku.org/type/IO::Pipe
samebchase- Thanks gfldex, and antoniogamiz for all the help! This is what I need. 09:48
antoniogamiz though ARGGILES is better I think
gfldex samebchase-: there is also docs.raku.org/type/IO::Handle#routine_lines 09:49
sjn o/ 09:50
09:50 Black_Ribbon left
samebchase- gfldex: Can I use $*IN directly? 09:51
sjn I seem to remember there once was a list of "low-hanging fruit" tasks somewhere. Does anyone here remember if this still exists somewhere, of if I remember wrong? :-)
gfldex samebchase-: yes
raku: .say for lines;
evalable6 ♥🦋 ꒛㎲₊⼦🂴⧿⌟ⓜ≹℻ …
gfldex, Full output: gist.github.com/6a29eb382ab6c7b7a5...65d425b704
09:53 flossy left
samebchase- awesome, `lines` is doing the trick! 09:56
AlexDaniel sjn: depends on what you want to work on 09:57
sjn: if you want to work on rakudo, then maybe try this: github.com/rakudo/rakudo/issues?q=...resolve%22
10:02 Altai-man_ joined 10:05 sena_kun left
Geth doc: 56b42ef062 | Antonio++ (committed using GitHub Web editor) | 2 files
fix: rename doc-generation.json to documentable.json, refs Raku/Documentable#62
10:08 rir left 10:11 xinming left 10:13 xinming joined 10:14 MasterDuke left 10:16 sarna left 10:17 veesh left, veesh joined 10:19 sarna joined
codesections I suspect the answer to this may just be, "no, it's not possible" and that's fine. But I figure it's worth a shot: when building a CLI with Raku's built-in arg parser, is there a way to get it to accept options with a space (--length 42) instead of just with an equals (--length=42) ? 10:28
antoniogamiz hum, good question 10:29
El_Che codesections: I wrote a module for that 10:33
codesections: github.com/nxadm/SuperMAIN
no extra syntax or semantics 10:34
Manifest0 Getopt::Long will also allow to do that
[ptc] m: say sort(["\c[CHICKEN]", "\c[EGG]"])
camelia (🐔 🥚)
codesections cool, I'll check both of those out. Thanks
El_Che have fun
[ptc] bummer, doesn't appear on my terminal :-/ 10:35
codesections ptc I guess you'll never know
[ptc] codesections: www.babelstone.co.uk/Unicode/whatisit.html shows the result :-) 10:36
codesections :)
[ptc] python seems to agree with the ordering as well: twitter.com/bencbartlett/status/12...87393?s=20 10:37
El_Che codesections: both modules have a very different scopes, I think. Getopt::Long is feature-rich and with semantics and syntax close to the Perl module with the same name. SuperMAIN just enables a few features (named everywhere, spaces between param names and values and auto alias) with changes in your code 10:38
depending on what you need, one may be more appropiate than the other
codesections Yeah, I'm looking at the READMEs now. Looks like SuperMAIN is just what I'm looking for at the moment – I like the built in syntax 10:41
El_Che codesections: feel free to ping if something does not work. 10:42
codesections thanks :)
sjn AlexDaniel: thanks! I'm actually talking with another person who found that the idea of "easy to resolve" issues (low hanging fruit) was something worth adopting, so he wanted an example of it (thanks for the url! :-)) 10:50
AlexDaniel sjn: well, as you can see, most of these tickets are pretty old. Nobody is really marking the tickets actively 10:51
antoniogamiz what is the difference between xt/ and t/? 10:52
AlexDaniel one easy to resolve issue would be to mark tickets easy to resolve :)
antoniogamiz: usually xt/ is for tests that you shouldn't normally run. For example, if they take too long to finish, or something like that 10:53
antoniogamiz: they're still tests and are likely used by the maintainers of the project
for example, all tests in whateverable are xt tests: github.com/Raku/whateverable/tree/master/xt 10:54
because I don't think anybody wants the test suite to start up an IRC server, run hundreds of tests per each bot, download all the required builds, etc.
antoniogamiz oh it makes sense
thanks :)
has anyone made end to end testing for a webpage with raku? 10:55
AlexDaniel I wanna know too
antoniogamiz well, I gotta go, .tell me if someone appears :D 10:56
10:56 antoniogamiz left
dakkar El_Che: thank you for writing that module! I just sent you a bug report ☺ 11:04
11:05 stoned75 left 11:07 stoned75 joined 11:10 rbt left
El_Che dakkar: great catch 11:10
it should be an easy fix, and I'll add the tests
11:11 rbt joined
El_Che I naively use split and join to eagerly 11:11
dakkar command line option parsing is harder than it looks! 11:14
(I once sent a bug report to Damian because one of his opt-parsing p5 modules got confused by whitespace!)
El_Che dakkar: it certainly is 11:26
dakkar: I try to document the cornercases in my tests
dakkar: but we'll find most of them only when enough people use it 11:27
11:32 hungrydonkey joined
codesections El_Che: I believe I found another corner case for you :) 11:34
(and thanks for the module!)
El_Che hehe :)
I know what to do :) 11:35
11:49 hungrydonkey left, wamba left 11:50 wamba joined 11:55 rindolf left 12:03 sena_kun joined 12:05 Altai-man_ left 12:55 hungrydonkey joined
rypervenche What's the difference between my Str @array and something like my @array = Array[Str].new; ? 13:03
I may have the syntax wrong on that last one.
13:05 titsuki joined
moritz the first one is a type constraint on the variable @array 13:05
the second one is an initiliazation
but the second allows you to to write: @array = (1, 2, 3); 13:06
without a type error
m: my Str @a; @a.push: 'a'; say 'OK'; @a.push(42)
camelia OK
Type check failed in assignment to @a; expected Str but got Int (42)
in block <unit> at <tmp> line 1
moritz m: my @a = Array[Str].new; @a.push: 'a'; say 'OK'; @a.push(42)
camelia OK
moritz m: my @a := Array[Str].new; @a.push: 'a'; say 'OK'; @a.push(42) 13:07
camelia OK
Type check failed in assignment to ; expected Str but got Int (42)
in block <unit> at <tmp> line 1
moritz m: my @a := Array[Str].new; @a.push: 'a'; @a := Arry.new(); say 'OK'; @a.push(42)
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Arry used at line 1. Did you mean 'array', 'Array'?
moritz m: my @a := Array[Str].new; @a.push: 'a'; @a := Array.new(); say 'OK'; @a.push(42)
camelia OK
13:14 hungryd10 joined 13:17 hungrydonkey left 13:25 hungrydonkey joined 13:27 hungryd10 left 13:36 hungryd50 joined 13:37 hungrydonkey left 13:41 hungrydonkey joined 13:42 orinthe5 joined 13:43 orinthe left, orinthe5 is now known as orinthe 13:44 hungryd50 left 13:45 hungryd88 joined 13:48 hungrydonkey left 13:52 hungrydonkey joined 13:55 hungryd88 left 13:56 hungrydonkey left 13:57 hungrydonkey joined 13:59 sarna left 14:02 Altai-man_ joined 14:05 sena_kun left 14:07 hungryd15 joined 14:10 hungryd76 joined, hungrydonkey left 14:12 hungryd15 left, hungrydonkey joined 14:15 stux|RC left, hungryd76 left 14:16 stux|RC joined 14:18 OpenZen joined 14:23 rindolf joined 14:25 skids joined 14:50 angelds joined 14:51 JRaspass joined 14:56 aborazmeh joined, aborazmeh left, aborazmeh joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/07/06/2020-...beginning/ 14:58
15:01 aborazmeh left 15:03 hungryd38 joined 15:05 hungrydonkey left, natrys joined 15:12 orinthe left 15:13 angelds left, orinthe joined 15:14 natrys_ joined, natrys_ left 15:18 natrys left 15:28 rbt left, rbt joined
ensamvarg m: $a = 2; 15:30
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3<BOL>7⏏5$a = 2;
ensamvarg m: my $a = 2; 15:31
camelia ( no output )
ensamvarg m: my $a = 2; print $a;
camelia 2
AlexDaniel m: my $a = 2; say $a²; 15:33
camelia 4
AlexDaniel m: my $a = 2; say $a³²
camelia 4294967296
15:33 molaf joined
ensamvarg m: my $a = 2; say ¼$a; 15:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my $a = 2; say ¼7⏏5$a;
expecting any of:
infix stopper
statement end
statement mod…
ensamvarg m: my $a = 2; say $a¼;
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus postfix
at <tmp>:1
------> 3my $a = 2; say $a7⏏5¼;
expecting any of:
infix stopper
statement end
statement modifier…
AlexDaniel ensamvarg: hmm what do you want to happen? 15:37
ensamvarg: maybe try with a × (or *) sign? 15:38
m: my $a = 2; say $a × ¼;
camelia 0.5
AlexDaniel m: my $a = 2; say $a * ¼;
camelia 0.5
ensamvarg AlexDaniel: Thank you, AlexDaniel. 15:40
m: my $a = 2; say $a * ¼; 15:41
camelia 0.5
codesections I have a question about the semantics of Raku lists. Here's what is confusing me: 15:42
sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"}
m: sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"} 15:43
camelia ( no output )
codesections m: show-capture(:foo)
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
show-capture used at line 1
AlexDaniel m: sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"}; show-capture(:foo)
camelia list:
hash: foo True
codesections thanks
AlexDaniel codesections: that's just how Captures work 15:44
codesections m: sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"}; show-capture(do if True {:foo} )
camelia list: foo True
AlexDaniel m: sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"}; show-capture(|do if True {:foo} ) 15:45
camelia list:
hash: foo True
15:45 brtastic joined
codesections yeah. That's the bit that I'm not following. Why is the slip operator needed? 15:45
AlexDaniel m: sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"}; my $pair = :foo; show-capture($pair)
camelia list: foo True
AlexDaniel m: sub show-capture(|c) { say "list: {c.list}"; say "hash: {c.hash}"}; my $pair = :foo; show-capture(|$pair)
camelia list:
hash: foo True
AlexDaniel codesections: it's like this ↑
codesections So, does `do` create a pair? 15:46
AlexDaniel if you pass an object as an argument it just takes it as a positional argument
codesections: no, `:foo` is a pair
codesections oh, right. `:foo` is already a pair, but is being destructured when passed in literally! 15:47
AlexDaniel yeah
codesections Ok, thanks. That was tripping me up for quite a while.
A little more magic than I was expecting, but I get it now
AlexDaniel codesections: actually it's hard to make it work any other way 15:48
codesections: otherwise you won't have any predictability as to whether an argument ends up being positional or named
for example
foo($bar) – what does it do?
right now it's simple, it's passing $bar as a positional arg, that's very clear 15:49
if it slipped pairs and hashes automatically the answer would've been “nobody knows, we have to figure out what $bar is first”
codesections Yeah. I mean, the language could just *not* destructure a literal `:foo` (and make everyone type `|:foo` every time). That would be the more explicit/less magic way, but would also be really annoying.
but yeah, I agree it couldn't slip pairs and hashes automatically – all it could do is *not* slip them when passed literally 15:50
AlexDaniel you have an interesting point
codesections: wanna have a heart attack? 15:51
codesections sure 15:52
AlexDaniel m: sub foo(:$bar) { say “bar is $bar” }; foo():42bar
camelia bar is 42
AlexDaniel m: sub foo(:$bar) { say “bar is $bar” }; foo:42bar
camelia bar is 42
AlexDaniel jnthn: ↑ I wonder if this would surprise you :)
lizmat m: foo:42bar; sub foo(:$bar) { say “bar is $bar” } 15:53
camelia bar is 42
AlexDaniel you can also do this if you want:
lizmat now, *that* surprises me
AlexDaniel m: sub foo(:$bar, :$baz) { say “bar is $bar, $baz” }; foo:42bar:43baz
camelia bar is 42, 43
lizmat AlexDaniel I'm pretty sure that's all intentional 15:54
AlexDaniel lizmat: almost everything in Raku is intentional
but I still have to pick up my jaw from the floor every time :P
lizmat nah, most of it just naturally falls out of its foundation :-) 15:55
codesections Yeah, AlexDaniel's examples don't surprise me – but probably because I just saw that syntax in the docs when I was trying to figure my issue out
lizmat AlexDaniel: it's the same mechanism that allows s:i:g/foo/bar/
AlexDaniel lizmat: I wouldn't call it same, I don't think it always worked 15:56
6c: sub foo(:$bar, :$baz) { say “bar is $bar, $baz” }; foo:42bar:43baz
committable6 AlexDaniel, Sorry kid, that's not my department.
AlexDaniel uhh poor bot
oh I think I know 15:58
actually, no, I don't… given that it was unable to gist the error it's probably a precomp bug again :( 16:00
bisectable6: sub foo(:$bar, :$baz) { say “bar is $bar, $baz” }; foo:42bar:43baz
bisectable6 AlexDaniel, Will bisect the whole range automagically because no endpoints were provided, hang tight
AlexDaniel, Sorry kid, that's not my department.
AlexDaniel yeaah…
bot spam incoming, sry 16:01
16:01 bisectable6 left, quotable6 left, shareable6 left, evalable6 left, squashable6 left, statisfiable6 left, notable6 left, committable6 left, greppable6 left, sourceable6 left, reportable6 left, tellable6 left, bloatable6 left, unicodable6 left, releasable6 left, nativecallable6 left, linkable6 left, benchable6 left, coverable6 left
lucs Wow, that's a lot of bots. 16:02
16:02 guifa2 joined
lucs Is their usage publically documented? 16:02
AlexDaniel lucs: of course: github.com/Raku/whateverable/wiki
lucs Thanks
16:03 sena_kun joined 16:05 Altai-man_ left 16:10 rbt left 16:11 rbt joined
codesections m: multi p(:$foo, *% where $foo == 0) { 0 }; multi p(:$foo, :$bar) { 47 }; say p(:foo(42), (do if True { :bar })); 16:14
camelia Cannot resolve caller p(bar => True, :foo(42)); none of these signatures match:
(:$foo, *% where { ... })
(:$foo, :$bar)
in block <unit> at <tmp> line 1
codesections that was the error message that caused me such trouble
m: multi p(:$foo, :$bar) { 47 }; say p(:foo(42), (do if True { :bar })); 16:15
camelia Cannot resolve caller p(Pair:D, :foo(Int)); none of these signatures match:
(:$foo, :$bar)
in block <unit> at <tmp> line 1
AlexDaniel lizmat: ↑ the error message is wrong here?
codesections Not the second one -- that one's fine
AlexDaniel it doesn't show that `bar => True` is a positional
yeah, the one before
lizmat Pair:D, ? 16:16
that's a positional?
codesections But the first msg doesn't say `Pair`. It just has `bar => True` 16:17
AlexDaniel “Cannot resolve caller p(bar => True, :foo(42))”
lizmat hmmmm
maybe make an issue for it, so it won't fall through the cracks ?
AlexDaniel codesections: please :) 16:18
codesections Will do. Would this be for the doc repo or the Rakudo repo? 16:19
16:19 nativecallable6 joined, unicodable6 joined
AlexDaniel codesections: rakudo 16:19
16:19 shareable6 joined, tellable6 joined, coverable6 joined, evalable6 joined 16:20 squashable6 joined, reportable6 joined, bisectable6 joined, benchable6 joined
oddp Thank you for yet another edition of the weekly, liz! 16:20
16:20 notable6 joined, sourceable6 joined
lizmat oddp: yw 16:20
16:21 bloatable6 joined, committable6 joined
AlexDaniel bisectable: sub foo(:$bar, :$baz) { say “bar is $bar, $baz” }; foo:42bar:43baz 16:21
bisectable6 AlexDaniel, Will bisect the whole range automagically because no endpoints were provided, hang tight
16:21 linkable6 joined
bisectable6 AlexDaniel, Output on all releases: gist.github.com/ffc7fbd362d91488c4...be3cc88b86 16:21
AlexDaniel, Output on all releases and bisected commits: gist.github.com/6ef4a5291e3b37936e...b00ff6e5cd
16:21 greppable6 joined
AlexDaniel hmmm 16:21
16:21 quotable6 joined, statisfiable6 joined 16:22 releasable6 joined, brtastic left
AlexDaniel I think I ran out of space but actually didn't 16:22
it's weird
guifa2 lizmat: I was looking at making LanguageTag a value type because it seems a natural fit. But do you think it would be necessary for it to be inmutable for that to work realstically?
lizmat yes, it should be immutable, that's really the definition of a value type :-) 16:23
guifa2 *sigh* I kind of figured. Arg, I really liked the beauty of being able to say "$langtag.language = $foo" to edit the language, but maybe it wouldn't be terrible for it to be immutable especially if I have a robust clone method 16:24
16:29 softmoth joined
gfldex AlexDaniel: I can help you with your imagined space problem. My next blogpost will explain. :-> 16:41
16:47 dakkar left 16:49 patrickb joined 17:00 aindilis left
rypervenche guifa2: I saw your talk recently. Very cool to see the progress that you've made with Intl-CLDR :) 17:01
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/07/06/sp...g-up-sort/
17:02 natrys joined
guifa2 rypervenche: thanks! it's been slow but steady progress, but I'm hopeful by this time next year it'll be really powerful 17:03
17:04 aindilis joined 17:11 nightfrog left, tejr left 17:16 tejr joined
AlexDaniel gfldex: I ran out of inodes! 17:17
gfldex Sorry, cant help you with that first world probem. :-> 17:18
AlexDaniel okay back to 60% inode use… 17:19
17:23 tejr left
lizmat afk for a few hours& 17:26
17:30 tejr joined 17:33 titsuki left, wamba left 17:34 dolmen left 17:35 dolmen joined 17:42 brtastic joined 17:45 hungryd38 left 17:49 aindilis left 18:02 Altai-man_ joined
gfldex AlexDaniel: If you run out of inodes again, you might give btrfs a try. It got a limit of 2^64 inodes. 18:02
18:05 sena_kun left
El_Che use ZFS? dynamic all the way 18:05
docs.oracle.com/cd/E19253-01/819-5...#6n7ht6qtm 18:06
18:08 aindilis joined 18:13 aindilis left 18:20 Sauvin left 18:24 hungrydonkey joined 18:25 softmoth left
guifa2 (jnthn | sena_kun)++ on a minor detail I just noticed with Comma. When you open a project for the first time, it defaults to the README.md (yet another reason for a fancy banner image ha, my module had teh pwetty™ in Comma) 18:29
18:29 m_athias joined 18:34 aindilis joined
Zero_Dogg Does a rakumod file automatically create its own private namespace? Ie. when I "use" something above the "unit class" line, what kind of namespace is that actually being declared in? 18:37
rypervenche When trying to use raku from the command line to grep out some things from stdin, I'm unable to add a :g to my regex. Curious what I might be doing wrong. 18:38
| raku -e 'say $*IN.lines ~~ /\" (<-["]>+ mp3) \"/'; This grabs one instance, but if I add :g before the / it gives; Unexpected closing bracket at -e:1 ------> say $*IN.lines ~~ :g/\" (<-["⏏]>+ mp3) \"/ 18:39
guifa2 Zero_Dogg: so by default, if the rakumod is declared as a package of some sort, then the namespace will be whatever that package is called. 18:41
But if the package exports things, they will end up in the current name space 18:42
(that's a fairly simplistic overview but hopefully it helps)
Zero_Dogg guifa2: okay, so even if that use statement is before the actual unit declaration, it's actually imported into that namespace then
guifa2: nod, just trying to wrap my head around it :) 18:43
guifa2 If you've got a specific example, I'm happy to take a look at it. 18:45
18:47 molaf left
Zero_Dogg not really, I'm doing something rather basic. just "use App::Base;" followed by "unit class App::Backend::Foo is App::Base;" 18:48
guifa2 ah, well in that case you don't actually need to use the use statement 18:57
Zero_Dogg I don't?
It implicitly does it? 18:58
18:59 xinming left, xinming joined 19:04 wamba joined
AlexDaniel gfldex: no no… no… 19:06
gfldex: already gave it a try and regretted so many times that I didn't use something as stable as ext4
19:06 brtastic left
gfldex you need a fairly recent kernel. Or at least used to. The fairly recent kernel back then are not not so recent anymore. 19:07
AlexDaniel last time I had issues was like half a year ago 19:08
I'm using debian unstable so the kernel is as recent as it can be
gfldex well …
guifa2 Zero_Dogg: actually, I may have spoken too soon, as I'm testing out the structure you're using. You may need to have a "use Foo::Bar" after all 19:09
19:10 MasterDuke joined
gfldex AlexDaniel: Linux 5.4.0-4-amd64 GNU/Linux that is Debian/unstable. Mainline is at 5.7.7. 19:10
AlexDaniel gfldex: then how can I have 5.7.0
gfldex not without pain :) 19:11
Zero_Dogg guifa2: oh well, what I have now works, I just want to make sure I understand why correctly :)
guifa2 Zero_Dogg: I've always found the module loading / symbol export a bit confusing. One of these days I should probably investigate it much further and write up a guide (in the typical "learn by teaching" methodology haha) 19:12
AlexDaniel gfldex: are you sure? packages.debian.org/sid/linux-image-amd64
Zero_Dogg guifa2: haha, looking forward to it :P
gfldex AlexDaniel: oh, that one is quite new. I don't fancy booting my machine tho. I didn't have problems with btrfs because I'm cheating. I use bcache with an ssd to make sure that metadata is always on some permanent storage. 19:14
AlexDaniel hmm
gfldex: my last issue was that I was trying to figure out why it is so slow, so I tried to run the rebalance operation on the metadata
gfldex Also I use a mirror for metadata and data. That way scrubbing can actually help
AlexDaniel and it segfaulted…
gfldex ouch 19:15
AlexDaniel so, basically I asked the filesystem to do something and it segfaulted halfway through
I was prepared for the worst but folks on #btrfs said “ah you're probably alright, take a chance and reboot”
and yeah, it was fine
but omg…
gfldex You belly shouldn't feel like that. :) 19:16
19:17 Geth left, Geth joined
ShimmerFairy rypervenche: You can't put adverbs there, you'd need to type m:g/my regex/ (that is, using the m// form) 19:18
gfldex ShimmerFairy: does the adverb go to ~~ or to say in this case?
AlexDaniel I started using it initially thinking that I'll be using cow snapshots
rypervenche ShimmerFairy: Ahh, that changes things. It gives me the output of False now. I suppose I need to reread the regexes page since I'm likely not doing what I really want to be doing.
AlexDaniel but I just don't, so I'm not sure what's the point of having worse performance… just for the shininess? :) 19:19
gfldex AlexDaniel: did you have plenty of free RAMs? btrfs likes those. It can slow down quite a bit machines with little RAM. 19:20
ShimmerFairy gfldex: I think it's seen as the RHS of the ~~, and then gets confused by the funny-looking code between the // (remember, you can do things like $filehandle ~~ :e to do the same thing as $filehandle.e)
AlexDaniel sorry Raku eats all my ram :P
gfldex No wonder Camelia can grow to a wingspan of 10 foot. 19:22
ShimmerFairy To put it another way, I think in that case it's not seen as an adverb in the first place, but as a Pair. 19:24
19:31 rbt left, rindolf left, rbt joined
Zero_Dogg aside from using modules and thus getting precompilation, is there anything else I can do to speed up raku compilation overhead? I've split what I can into modules, what's left is basically a MAIN and USAGE, but it's still taking over 1 second to display --help or --version 19:34
El_Che Zero_Dogg: normally, just the first time 19:35
Zero_Dogg El_Che: This is subsequent runs, so two "app --help" after each other each take 1s+ 19:36
El_Che that looks problematic indeed. Is the filesystem read-only? 19:37
Zero_Dogg nope, and it has built a load of stuff in lib/.precomp 19:38
El_Che maybe someone with more knowlegde of precom will have an idea. nine? lizmat? 19:39
lizmat does the module have "no precompilation" in it?
Zero_Dogg stubbing out MAIN and removing the import of modules reduces it to 0.7s, which is fairly long for an essentially empty script
nope. I think module precomp is working as intended, actually 19:40
lizmat does --profile give any hints?
rypervenche How can I get this to match both a1.mp3 and b1.mp3?; echo 'blah:"a1.mp3", then:"b1.mp3", end' | raku -e 'say $*IN.lines ~~ m:i/ <?after \: \"> <-[":]>+ \. mp3 <?before \">/;' 19:43
Using m:i:g/ doesn't give what I would expect.
Zero_Dogg lizmat: can't say it's telling me much, no. It's not spending that time in *my* code, it's in the interpreter/vm
lizmat hmmm 19:44
El_Che Zero_Dogg: recent rakudo? 19:45
Zero_Dogg This might be expected, I'm just trying to figure out if I can somehow optimize it, since it's very noticeable with command-line apps. My perl apps use 0,06s for --help, while my raku app uses 1,25s 19:46
El_Che: 2020.02
19:46 cpan-raku left
AlexDaniel rypervenche: but this does work: raku -e 'say $*IN.slurp ~~ m:i:g/ <?after \: \"> <-[":]>+ \. mp3 <?before \">/; 19:46
El_Che 1,25 is noticeable and thus annoying, indeed
19:47 cpan-raku joined, cpan-raku left, cpan-raku joined
AlexDaniel Zero_Dogg: on which architecture is that? 19:47
Zero_Dogg AlexDaniel: x86-64
rypervenche AlexDaniel: Ahh I wasn't sure if .lines was the right tool for the job. That does the trick. Thanks! 19:48
AlexDaniel could it be that there's too much stuff in the precomp folders?
rypervenche: well, your input has only one line… 19:49
19:49 rindolf joined
AlexDaniel rypervenche: so $*IN.lines[0] ~~ also works 19:49
rypervenche AlexDaniel: I'm doing a curl from a website, but I did the echo as a test. but still. I didn't care about going through each line. I needed it to run across the entirety of the data. slurp works perfectly :) 19:50
Zero_Dogg AlexDaniel: maybe? I tried stubbing out almost everything (including imports) but it's still slow. "raku -e 'say "Hello"'" is fast though, so I'm a bit confused. I'm using MAIN and USAGE subs
lizmat lines.head # AlexDaniel
AlexDaniel lizmat: #huffmancodinggonewrong ? :) 19:52
guifa2 haha
MasterDuke Zero_Dogg: try --profile-compile
AlexDaniel Zero_Dogg: if nothing else works, do try wiping all of your precomp folders and trying again
I had this issue once
although it's still unclear to me as to why it'd cause slowness 19:53
lizmat lines defaults to $*IN, .head is faster than [0] on a Seq, as it doesn't need to set up caching
AlexDaniel lizmat: well, that's kinda the point. .[0] is shorter, more readable and just more versatile (e.g. for non-0 indices you need some .skip combination) 19:54
lizmat then by all means, use [0]
I thought this was about getting the first line only 19:55
AlexDaniel yeah but it turns seqs into what can be best described as arrays
Zero_Dogg MasterDuke: That gave me a 12M html file that my browsers are really struggling with :P 19:56
19:56 xinming left
Zero_Dogg Removing precomp's didn't change anything 19:56
MasterDuke that's not normal, so something probably isn't getting precomped 19:57
i'd suggest creating a sql profile and using moarperf to view it
19:57 hungrydonkey left
AlexDaniel actually, why indexing with [] does some sort of action at a distance at all, instead of just working? 19:59
for 0..10 { say $seq[$_] } # this can just work without any issues
19:59 xinming joined
AlexDaniel for everything else it's fair to fail with “You're iterating your Seq backwards, dum dum!” 20:00
20:03 sena_kun joined
AlexDaniel that is, this would just work: 20:03
m: my $s = ‘foo bar baz’.words; say $s.head; say $s[2]
camelia foo
The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
AlexDaniel also, notice how caching behavior just happens not to help you in this case
lizmat m: m: my $s = ‘foo bar baz’.words; say $s[2]; say $s.head; 20:05
camelia baz
20:05 Altai-man_ left 20:11 xinming left 20:14 xinming joined 20:21 molaf joined
Zero_Dogg MasterDuke: anything in particualr to look for in there? 20:23
20:29 kensanata joined
lizmat www.flickr.com/photos/wendyga/5008...ed-public/ # a clear message ? 20:39
20:42 rindolf left 20:43 xinming left
[Coke] ... not really, no. :) 20:46
20:47 xinming joined
[Coke] ... I haven't collected comics in a while... is that the beyonder? 20:48
20:49 dolmen left, wamba left
timotimo perl7 died so raku could change the world? 20:49
honestly, i'm not educated about the comics, so i don't know what that character is 20:50
is it a villain that's as big as a skyscraper?
AlexDaniel “claimed to be omnipotent being who kidnapped the heroes and villains of the Marvel Universe and had them do battle on another planet called Battleworld” “The character later appeared in a more antagonistic role in the 1985 sequel Secret Wars II, in which he took human form, and threatened to destroy the Marvel multiverse.” 20:54
timotimo thanks AD
AlexDaniel actually it's the first time I hear about it 20:55
my point is that it doesn't depict a good image of Raku 20:56
timotimo well, all three of these are kind-of villains, but iron man is framed quite heroic at least on a surface level - only refering to the recent movies, of course
[Coke] AlexDaniel: if that's even him. 20:57
AlexDaniel there's more than one Beyonder?
timotimo to infinity, and the beyonder! 20:59
[Coke] I was only guessing that was him in the image.
El_Che "The Beyonder is an infinite-dimensional,[26] or beyond-dimensional,[2] entity" <-- maybe he want to work on raku arrays
AlexDaniel xD
[Coke]: well, the description says so
[Coke] AlexDaniel: OH 21:00
AlexDaniel: I didn't even see there was a description. And I got it! woo!
AlexDaniel good for you, but I still don't get it :P 21:01
[Coke] oh, me either. :)
lucs How can I set environment variables that will be visible to a program that I 'run'? 21:10
21:10 rbt left 21:11 rbt joined
AlexDaniel lucs: run accepts an :env or :ENV (?) named arg 21:11
lucs: by default it's set to %*ENV I think, so you can change %*ENV directly