🦋 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.
cpan-raku New module released to CPAN! LogP6 (1.6.2) by 03ATROXAPER 06:28
Geth ¦ problem-solving: Altai-man assigned to jnthn Issue Current Rakudo (possibly MoarVM as well) development process hinders releasing github.com/Raku/problem-solving/issues/206 08:18
Geth ¦ problem-solving: lizmat unassigned from jnthn Issue Current Rakudo (possibly MoarVM as well) development process hinders releasing github.com/Raku/problem-solving/issues/206 09:06
antoniogamiz o/ 09:13
can node or perl be included as dependencies in the META6.json file? 09:14
Altai-man_ antoniogamiz, you mean the intepreter itself? 09:15
antoniogamiz, I guess you can start from github.com/niner/Inline-Perl5/blob...6.json#L15
antoniogamiz Altai-man_, I will check that 09:16
mm, but those are ecosystem modules 09:17
Altai-man_ "perl:from<native>", 09:18
?
antoniogamiz Altai-man_, I think that's it, thanks 09:19
fluca1978 hi, I'm a little more confused than the compiler: having a function defined as 'sub is-power( Int:D :$what = 100, Int:D :$base = 10 ){...}', when I invoke it as 'my $power = is-power: :what( $N ), :base( $_ );' I got 'Confused my $power = is-power:⏏ :what( $N ), :base( $_ ); 09:43
expecting any of:
colon pair'
dakkar isn't the colon-at-the-end caling style only for methods? /me also confused 09:44
fluca1978 dakkar: it could be, since 'is-power( :what( $N ), :base( $_ ) );' works. Thanks! 09:45
dakkar and of course you can omit the parentheses altogether 09:46
ShimmerFairy join #raku-dev 10:33
lizmat / ?
ShimmerFairy yep 10:34
gfldex dakkar: it's actually meant for calling operators as in %foo<some-string>:exists 10:54
dakkar I was talking about `$object.method: @args`, not the colonpair 10:55
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/06/22/wat-freeness/ 10:56
gfldex I would like to add that I feel a lot less negative as this blog post might make it sound. 11:19
jjmerelo gfldex: pointer?
lizmat gfldex.wordpress.com/2020/06/22/wat-freeness/
jmerelo gfldex: not too angry. Seems about OK. 11:39
veesh much nicer critique than we get on the mailing list 11:47
Geth doc: f5e1bd3224 | (JJ Merelo)++ | doc/Type/Rational.pod6
Adds Rat.Bridge, refs #2632
11:55
doc: 4edb7e5fbe | (JJ Merelo)++ | doc/Type/Int.pod6
Adds Int.Bridge, refs #2632
doc: 2ae243b547 | (JJ Merelo)++ | doc/Type/Num.pod6
Adds Num.Bridge, refs #2632
linkable6 Link: docs.raku.org/type/Rational
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/type/Int
Link: docs.raku.org/type/Num
jmerelo m: class C is Real { method Bridge { return self*2 } }; my C $num = 3.Num; say $num 11:57
camelia Type check failed in assignment to $num; expected C but got Num (3e0)
in block <unit> at <tmp> line 1
jmerelo m: class C is Real { method Bridge { return self*2 } }; my $num = .new(3) ; say $num
camelia Default constructor for 'Any' only takes named arguments
in block <unit> at <tmp> line 1
jmerelo m: class C is Real { has Real $.r; method Bridge { return $!r*2 } }; my C $num = .new(:3r) ; say $num + 1e0 11:58
camelia Type check failed in assignment to $num; expected C but got Any (Any.new)
in block <unit> at <tmp> line 1
jmerelo m: class C is Real { has Real $.r; method Bridge { return $!r*2 } }; my $num = C.new(:3r) ; say $num + 1e0 11:59
camelia 7
Geth doc: f00ec04769 | (JJ Merelo)++ | doc/Type/independent-routines.pod6
"say" guaranteed to call .gist #2632
12:09
doc: 8307183ab0 | (JJ Merelo)++ | doc/Type/independent-routines.pod6
"note" guaranteed to call .gist #2632
linkable6 Link: docs.raku.org/type/independent-routines
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
jmerelo Only 8 to go... github.com/Raku/doc/issues/2632 And we'll be over documenting new 6.d features... 12:11
gfldex is there a place where plush Camelia is readily awailable?
jmerelo gfldex: you can try and ask lizmat... 12:12
ShimmerFairy Can anyone try installing JSON::Fast? I tried installing Pod::To::HTML and it died on that package due to a "double free or corruption (fastop)" 13:33
Altai-man_ ShimmerFairy, is it reliable?
ShimmerFairy Yeah, tried installing Pod::To::HTML twice 13:34
Altai-man_ Testing [OK] for JSON::Fast:ver<0.10>
ShimmerFairy it died during testing specifically, I should mention 13:36
[Coke] realizes he hasn't seen camelia in a while, freaks out a bit--- oh, there she is. 13:37
lizmat ShimmerFairy: installs ok for me on HEAD on MacOS 13:40
ShimmerFairy I'll see if I can get any more detailed info. (I don't think my rakudo is very out of date, my first guess is that maybe my gcc or some library is too new.) 13:42
lizmat ShimmerFairy: it *does* remind me of a bug that was fixed about a week before MoarVM's release 13:45
ShimmerFairy Ah, that could well be it then.
lizmat that was introduced about 10 days before that (if I remember correctly)
so if your version is from that timeframe, then yes 13:46
ShimmerFairy "This is MoarVM version 2020.05-77-gb9fa480ad built with JIT support" 13:47
lizmat ShimmerFairy: probably :-) 13:55
gfldex is .hyper eager?
lizmat gfldex: yeah, think so 13:59
moony what's the quickest way to, say, fill an array with 1024 0s 14:07
vrurg m: my @a = 0 xx 1024; say @a.elems; 14:11
camelia 1024
vrurg moony: ^
moony vrurg: possible to one-liner that? (thanks btw) 14:12
need it as am argument
[Coke] ... I thought he did just one liner it
moony as in, put it into an argument
[Coke] then don't assign it if you just need to create & pass it. 14:13
moony sorry, i'm still trying to remember how this all works :p
[Coke] but even if you did need to assign it, you could foo( (my @a = 0 xx 1024), $thing)
vrurg m: sub f(@a) { say @a.elems }; f(0 xx 1024);
camelia 1024
vrurg moony: everything is an object. xx generates a List instance. You then pass it whenever you may need it. 14:14
[Coke] you could also create an array that defaults to 0 for values instead (not the thing you asked for, but similar)
vrurg Whenever and wherever. 14:14
[Coke]: default is better be avoided until well understood. Could cause big confusions sometimes. 14:15
lizmat m: my @a is default(0); say @a[875769] # an infinite number of 0's in an array 14:17
camelia 0
lizmat moony ^^
moony neat. not what i'm after tho, thanks 14:18
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/06/22/2020-25-on-time/ 14:33
sjn yay!
vrurg lizmat++ 14:33
sjn lizmat: did you mean to write (==) in the section about ≡ ? 14:38
lizmat yes 14:39
maybe reverse the order ?
m: dd (1,2,3) (==) (3,1,2) 14:40
camelia Bool::True
lizmat m: my %h = a => 42, b => 666; dd <a b> (==) %h
camelia Bool::True
sjn ok. My failing memory says says something about ≡ being ===, but I might be confused 14:42
lizmat well... a === b is basically a.WHICH eq b.WHICH, which is the same semantics that QuantHashes use 14:45
but we didn't have a unicode equivalent for that
since this is early in the release, still up for an alternative 14:46
but the PR sat there for 25 days without any comments...
a (==) b is basically the same as a.Set eqv b.Set 14:47
lizmat but with short-circuiting 14:47
lizmat so in the case if "<a b> (==) %h" it never builds a Set object anywhere :-) 14:48
rbt Does nxadm hang out here? If so, I'd really like a rakudo-pkg with 2020.06 :) 15:43
tellable6 2020-06-21T17:43:23Z #raku <melezhik> rbt I recall having the same issues with IO::Socket::Async::SSL even on older Rakudo versions, when I test modules with RakuDist
El_Che hi 16:00
I am building it atm
there were some problems with older gcc that I am patching 16:01
^-- rbt
everthing builds except debian 8 and centos 7
sena_kun is sure there will be 2020.06.1 16:02
rbt Awesome. Thanks! 16:03
El_Che I moved relocatable builds for i386 and amd64 to ubuntu 16.04, if there is a dot release Iĺl lower it to 14.04 16:04
rypervenche When would one use a code block in a .grep() and when would one not? For example when doing a grep on strings and wanting to match those strings against a regex. 16:43
sena_kun rypervenche, if can, just go for a regex, if need something more complex or wordy, then a block. 16:48
ShimmerFairy If you were writing some kind of AI to play hangman, you might start with my @possibles = @dict.grep({$_.chars == $spaces})
MasterDuke rypervenche: if you need to refer to $_ multiple times. e.g., grep({$_ .chars == 3 && $_.starts-with("a")}). you can't use `*` multiple times 16:53
rypervenche Ahh ok, so for there the code block would be necessary. I see. Thanks. 16:53
[Coke] easy way to get combinations from a list of values that allows duplicates? so given 0,1,2,3, asking for combinations of 2 at a time, allow 0,1 but also 1,1 ? 17:10
is it crossing .combinations(1) with the original list and adding .combinations(2) ? 17:11
Altai-man_ [Coke], permutations? 17:13
hm, not really 17:14
[Coke] finds rosettacode.org/wiki/Combinations_...tions#Raku 17:24
oddp Yeah, ruby/crystal has repeated_combinations for that. Would an optional named :repeated be a valid addition to combinations? 17:45
Altai-man_ The native solution takes one line of code, hardly something to add to the core if you ask me. 17:46
oddp Why do we have .sum then?
Altai-man_ No idea. I don't see "We have X in core" as an argument for "We should also add A, B, C, D, E...". It is not like it is a "all or nothing" case. 17:48
oddp Isn't the fact that two competent programmers needed to pause and think about how to implement combination repetition at the very least an indication that this might be a bit more involved and thus justified for considering an inclusion for the smooth brains like me not quite comfortable with that linked cryptic one-liner? 17:55
Altai-man_ Well, knowledge about :repeated argument does not appear in one's head immediately it is added. I mean, IDE can suggest you the option, but not everyone like that. So you still have to look it up to use and there is not so much difference if you are looking up an argument or the code to do the same. Looking up a solution is as cheap as looking up an option, but having huge core is not free for implementations, the users pay the price with memory and 18:00
such. I am just a grumpy old man, though, so don't pay me any attention, but that's how it feels.
Altai-man_ You had to pause and think about it, because you don't have even a hazy solution in your memory for what to write/where to search. How many months (or years) ago this task was needed previous time? 18:05
oddp "Looking up a solution is as cheap as looking up an option" - But this shifts the maintenance burden to the users who have to, two months down the line, pause once again after encountering: for [X](@S xx $k).unique(as => *.sort.cache, with => &[eqv]). "Isn't perl/raku about shifting that burden to the language/stdlib implementors? 18:06
[Coke] In general, happy to have stuff like this live in a module to start. 18:22
(and the it's core worthiness can be decided later)
*then its
rypervenche Is there perhaps a better way of doing this script that doesn't make me run out of RAM? I'm currently wanting to create an array of about 18 million elements. Should I be writing it to a file/database instead, or is it possible to do this in memory? Also, I also realize that my for loops are a bottleneck. gist.github.com/rypervenche/9e1dd4...fc79dac4e0 18:39
sena_kun rypervenche, can you try using native int and str? 18:41
rypervenche Same thing. I haven't let it hit my 16G limit, but I'm assuming it won't slow down. 18:44
Kaeipi what happens if you change my Link @links/my Str @sentences-grepped/etc. to my Seq $links/etc.? 18:49
you would need to find some other way to build them than with .append though 18:51
rypervenche Oh, I guess I never let the RAM get too high. It seems to hover around 11G of RAM. My bad. :/
SmokeMachine Will rakudo run on the new apple?
lizmat SmokeMachine: probably, but as it stands, without a JIT 18:52
and assuming libuv will be ported 18:53
SmokeMachine I hope it will 18:54
MasterDuke rypervenche: if you're looking to speed things up and don't mind making the code a little uglier, `.grep: *.contains(/:r \t ('eng'|'cmn') \t /);` would be faster as `.grep: {$_.contains("\teng\t") or $_.contains("\tcmn\t")};`. i.e., regexes are slow right now 19:02
rypervenche MasterDuke: Ah yes, I moved to .contains for that reason, but yeah. I wasn't sure how to get past the regex. Thanks :) 19:03
MasterDuke probably won't do anything for memory use
rypervenche It seems that my .split("\t") on a list my have been the cause. I've change it to doing the split on the variable inside the loop instead. 19:17
Yep, that worked, although that first loop took about 10 minutes to complete >< 19:19
Nasrudin What is the preferred method of finding memory leaks in Raku? 20:16
Geth ecosystem/finanalyst-patch-1: 8e9417bfb6 | (Richard Hainsworth)++ (committed using GitHub Web editor) | META.list
Add Pod::From::Cache to ecosystem

Pod::From::Cache was written to replace Pod::To::Cached, which tries to do too much and has some problems. PFC only relies on standard Precomp Modules and stable API. Dependence on JSON::Fast is removed. Enumerates files with given extensions in a directory, eg. pod6, pm6, rakumod, under docs/ and if a file has been changed since last time cache was instantiated, adds new version. Returns compiled Pod from that file.
21:01
guifa Whoa. Talk about a difference between making something work and needing to optimize it 21:22
the <local-alpha: ‘zh’> is slow as molasses, because it’s basically several thousand strings in an array plopped into a regex token
MasterDuke Nasrudin: you can do `--profile=foo.mvmheap` to get a heap snapshot, which will give you info at the raku level. if it's moarvm that's leaking, valgrind and heaptrack have both proved useful before 21:25
Nasrudin not really familiar with raku's internals enough to benefit from that... I was looking for something at the raku script level to see if it was my bad first 21:26
Thanks for the response though! :D 21:27
MasterDuke even a regular profile could prove helpful if you look at the allocations tab
guifa Nasrudin: is it a simple enough script we can take a look at? We might be able to help out there too 21:28
Oh, also more random… is there any danger in pulling submodules out and putting them in new github projects? For one that change the name, it seems simple enough: add in a warning/die under the old project to encourage changing the reference or even passing through the newer one. But for ones with the same name, I dunno. Thoughts? 21:29
Nasrudin It's not so simple. It's using Matrix::Bot and Matrix::Client. I'd be happy to provide a redacted pastebin (it's got credentials in it that should not be public) if you are willing but I warn you that I did some "architecture" on it trying to learn more about Raku. 21:30
raku-bridge <DataKinds> wouldn't be the first time that there were similar memory leaks -- didn't we have to reboot the IRC bridge daily for a while because it wouldn't stop leaking memory? 21:31
Doc_Holliwood m: say 5 div -2 22:12
camelia -3
Doc_Holliwood that's counter intuitive as hell
raku-bridge <DataKinds> m: say 6 div 3 22:29
<DataKinds> oh yeah. discord. lmao
<DataKinds> that's not counterintuitive to me
rypervenche Does anyone have any suggestions for getting this loop to work on multiple cores? I changed it to a map, but I get a "double free or corruption (!prev)", I'm guessing from a race condition when trying to .append to the array. Any ideas on how to make this work? Or something similar? gist.github.com/rypervenche/fba3f6...60d709f217 22:30
raku-bridge <DataKinds> it's the solution to m = bq + r where d > 0. that's just the mathematical definition for Euclidian division Doc_Holliwood 22:31
<DataKinds> ** r > 0
<DataKinds> rypervenche: you can create the @links list directly by returning your Link.new call from map, instead of appending like that 22:32
Doc_Holliwood well i'd expect 2 22:33
tobs I thought we got evalable6 to work over the bridge once...
Doc_Holliwood or -2 rather
raku-bridge <DataKinds> Doc_Holliwood: 5 div -2 is asking for the solution q where 5 = (-2)q + r with r > 0 22:34
tobs @DataKinds the bridge name was hardcoded and changed, feel free to PR :-) github.com/Raku/whateverable/blob/...le.pm6#L27
raku-bridge <DataKinds> wait -- you're right
<DataKinds> wait no
<DataKinds> now I'm confused haha 22:35
AlexDaniel` hmm evalable doesn't work over the bridge? why? 22:37
tobs AlexDaniel`: the nick is hardcoded to an old bridge
discord6 it was called
AlexDaniel` okay, fixing
timotimo rypervenche: the map already returns a list of results from your block 22:38
AlexDaniel` tyil: which nickname does raku-bridge take if raku-bridge is taken?
tellable6 AlexDaniel`, I'll pass your message to tyil 22:39
timotimo rypervenche: so you could literally just $links-file.IO.lines.race(...).map({Link.new(...) }) and store the result in @links
@links = $links-file.IO.………;
Geth whateverable: 78011e826a | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
Fix handling of bridged messages

The name of the bot changed, so we have to adjust it here too.
22:40
AlexDaniel` I guess it's raku-bridge1
tobs I've been trying to go to bed for an hour but the world does not stand sufficiently still. Thanks for the quick fix, AlexDaniel` :) 22:41
raku-bridge <DataKinds> haha, sorry for bringing this bug up at such an inopportune time 🙂 22:42
AlexDaniel` DataKinds: can you try again please?
ah hold on the bot is not back yet…
raku-bridge <DataKinds> lmk when 22:43
MasterDuke rypervenche: fwiw, it's not safe to modify an array or hash from multiple threads (e.g., your `.append` inside the `.race`) 22:47
raku-bridge <DataKinds> m: given "Hello, Discord!" { .say } 22:49
evalable6 Hello, Discord!
raku-bridge <DataKinds> ^^
AlexDaniel` thanks :)
almost all bots should work over the discord bridge, although some will only work after they restart by themselves some time soon 22:50
docs here: github.com/Raku/whateverable/wiki
AlexDaniel` thank you, evalable! 22:51
hmmmm
thank you, evalable6?
evalable6 AlexDaniel`, It's my pleasure!
rypervenche DataKinds: timotimo: MasterDuke: Ahhh, thanks all of you. That did the trick. From 660 seconds to 160, haha. 23:12
timotimo phew. how many lines are that? 23:36
rypervenche Almost 18 million. 23:38
timotimo i wonder if perhaps the batch size of 1024 is like 10x or 100x too small for optimal performance 23:41
rypervenche Oh. I don't know. I can test it. Right now I'm adding promises to the mix, since I've got two files that I'm doing this too, but it's actually taking a bit longer with them. 23:52