🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:06 reportable6 left 00:07 reportable6 joined
Geth Raku-Steering-Council/main: 26a1b2ec63 | (Geoffrey Broadwell)++ | minutes/20220416.md
Add RSC meeting minutes for 2022-04-16
00:17
00:49 rbt left 00:50 rbt joined 01:05 rbt left, rbt joined 01:10 rbt left, rbt joined, rbt left 01:11 rbt joined, epony left 01:43 linkable6 left, linkable6 joined 02:01 melezhik joined
melezhik Hi! I have written a small update on SparkyCI progress - www.reddit.com/r/rakulang/comments...ci_update/ 02:02
02:05 monkey_ left 02:06 melezhik left 02:53 [Coke] left 02:55 [Coke] joined 02:58 melezhik joined 03:03 melezhik left 03:25 Guest35 left 04:25 evalable6 left, benchable6 left, committable6 left, reportable6 left, shareable6 left, bisectable6 left, quotable6 left, releasable6 left, statisfiable6 left, sourceable6 left, coverable6 left, tellable6 left, greppable6 left, bloatable6 left, linkable6 left, nativecallable6 left, unicodable6 left, notable6 left 04:26 releasable6 joined, greppable6 joined, quotable6 joined, coverable6 joined, tellable6 joined, sourceable6 joined 04:27 statisfiable6 joined, evalable6 joined, benchable6 joined, bloatable6 joined 04:28 shareable6 joined, linkable6 joined, nativecallable6 joined, bisectable6 joined 04:29 committable6 joined, notable6 joined, reportable6 joined, unicodable6 joined 05:16 rbt left, rbt joined 05:51 rbt left 06:06 mexen joined 06:07 reportable6 left 06:10 reportable6 joined 06:16 [Coke] left 06:24 [Coke] joined 06:37 rbt joined 06:38 abraxxa joined 06:42 jjido joined 06:52 abraxxa left 06:53 abraxxa joined
El_Che weekly: Hi! I have written a small update on SparkyCI progress - www.reddit.com/r/rakulang/comments...ci_update/ 07:00
notable6 El_Che, Noted! (weekly)
07:29 Sgeo left 07:45 abraxxa left 07:46 dakkar joined 08:03 lichtkind joined 08:17 rbt left 08:35 sena_kun left 08:36 sena_kun joined 08:37 rbt joined 08:39 frost joined 08:42 rbt left, rbt joined 08:51 codesections left 08:52 codesections joined
lizmat weekly: vrurg.github.io/2022/04/18/will-complain-trait 08:59
notable6 lizmat, Noted! (weekly)
09:00 andrea[m] left 09:01 grondilu joined 09:02 rbt left 09:03 rbt joined
grondilu what's the correct way to test whether a string is parsed by a grammar? `so $grammar.parse($str)` or `$str ~~ /^<$grammar::TOP>$/` ? 09:03
or something else?
$str ~~ $grammar would make sense but I don't think that works 09:04
m: say "foo' ~~ grammar { rule TOP { foo } }
camelia ===SORRY!===
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> ay "foo' ~~ grammar { rule TOP { foo } }⏏<EOL>
Other potential difficulties:
Useles…
lizmat I'm not sure I understand the word "test" in that question
grondilu check, if you will 09:05
lizmat $grammar.parse is just a method accepting a Str
grondilu .parse it is then
lizmat feels like a rubber duck, but that's ok :-) 09:06
grondilu I thought it might be overkill or something
gfldex m: say 'foo' ~~ grammar { rule TOP { foo } }.new;
camelia 「」
gfldex I somehow feel this should work. 09:07
m: grammar { rule TOP { foo } }.new.HOW.say;
camelia Perl6::Metamodel::GrammarHOW.new
gfldex m: grammar { rule TOP { foo } }.new.WHAT.say; 09:08
camelia (<anon|1>)
09:08 rbt left, rbt joined 09:14 epony joined 09:26 Oshawott left, archenoth joined 10:11 rbt left 10:23 rbt joined 11:23 evalable6 left 11:24 evalable6 joined 11:26 discord-raku-bot left, discord-raku-bot joined 11:27 Altai-man joined 11:29 Util left 11:30 Util joined, discord-raku-bot left 11:31 discord-raku-bot joined, sena_kun left 11:33 rbt left 11:34 rbt joined 11:42 jjido left 12:02 jjido joined 12:06 abraxxa joined 12:08 reportable6 left 12:10 reportable6 joined 12:13 abraxxa left, abraxxa joined 12:29 frost left
p6steve drakonis: have you seen Math::Matrix - An interface to libgsl, the Gnu Scientific Library - Vectors and Matrices? 12:33
drakonis: and the Math::Libgsl:: family - search libgsl in the raku.land search box - there are 27 of these 12:35
drakonis: fwiw I am working on raku Dan and Dan::Pandas which is a data analytics library for raku github.com/p6steve/raku-Dan 12:37
drakonis: and then Dan::Polars is my follow on goal 12:41
El_Che For the comma devs, heads up that comma community is broken on IntelliJ IDEA 2022.1 (Ultimate Edition), Build #IU-221.5080.210, built on April 12, 2022 12:50
12:58 [Coke] left 12:59 timo left 13:00 [Coke] joined
Nemokosch do you know what zef uses to fetch raw files from github? 13:05
13:06 discord-raku-bot left
lizmat the first thing that works ? 13:06
13:07 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:08 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:09 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:10 discord-raku-bot left, discord-raku-bot joined 13:11 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:12 discord-raku-bot joined, discord-raku-bot left, timo joined, discord-raku-bot joined 13:13 discord-raku-bot left, discord-raku-bot joined 13:14 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:15 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:16 discord-raku-bot left, discord-raku-bot joined 13:17 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:18 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:19 discord-raku-bot left, discord-raku-bot joined 13:20 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:21 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:22 discord-raku-bot left, discord-raku-bot joined 13:23 discord-raku-bot left, discord-raku-bot joined, Sgeo joined, discord-raku-bot left 13:24 discord-raku-bot joined, discord-raku-bot left, Guest35 joined, discord-raku-bot joined 13:25 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:26 discord-raku-bot joined, discord-raku-bot left 13:27 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:28 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:29 discord-raku-bot joined, discord-raku-bot left 13:30 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:31 discord-raku-bot left, discord-raku-bot joined, discord-raku-bot left 13:32 discord-raku-bot joined, discord-raku-bot left 13:33 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 13:34 discord-raku-bot left, rbt left, rbt joined, discord-raku-bot joined, discord-raku-bot left 13:35 discord-raku-bot joined 13:44 rbt left, rbt joined 13:49 rbt left 13:50 rbt joined
grondilu m: role A { multi method new { samewith "foo" }; }; class B does A { multi method new(Str $s) { say $s } }.new 13:52
camelia Default constructor for 'A' only takes named arguments
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu can't samewith refer to a method from a derived class?
m: role A { multi method talk { samewith "hi" }; }; class B does A { multi method talk(Str $s) { say $s } }.new.talk 13:53
camelia hi
grondilu it does work for generic methods 13:54
but not for new?
I suppose the object is not yet fully constructed so it can't call downwards candidates or something? 13:55
14:05 rbt left, rbt joined 14:19 abraxxa left 14:20 abraxxa joined 14:45 rbt left, rbt joined 15:00 rbt left 15:01 rbt joined 15:11 japhb left, rbt left 15:17 japhb joined
Voldenet calling derived class methods from base class is not something I'd expect to work 15:17
m: role A { multi submethod new { samewith self, "foo" }; }; class B does A { multi submethod new(Str $s) { say $s } }.new 15:20
camelia foo
Voldenet you can use new as well
15:21 morte_ joined
Voldenet but it's somewhat confusing to read 15:24
15:48 morte_ left, morte_` joined 16:35 dakkar left 16:37 jjido left 16:59 morte_` left, morte_` joined 17:01 rbt joined 17:08 morte_` left, morte_``` joined 17:16 morte_``` left 17:21 rbt left, rbt joined
grondilu from the docs: "A Submethod is a method that is not inherited by child classes." 17:33
so I don't quite understand why the code above works as it does 17:34
17:34 euandreh left
grondilu shouldn't class B not know about the submethod defined in A? 17:34
lizmat it's a role, not a class 17:35
and they're both multis
so the submethod in B does not shadow the one from the role A 17:36
and you're calling without parameters, so that will call the one from the role A
m: class A { multi submethod new { samewith self, "foo" }; }; class B is A { multi submethod new(Str $s) { say $s } }.new
camelia Cannot resolve caller new(B:U: ); none of these signatures matches:
(B: Str $s, *%_)
in block <unit> at <tmp> line 1
lizmat grondilu ^^ 17:37
grondilu scraches his head
Voldenet >it's somewhat confusing to read 17:38
;)
grondilu m: role A { multi method subnew { samewith "foo" }; }; class B does A { multi method new(Str $s) { say $s } }.new 17:41
camelia ( no output )
lizmat grondilu: because your B.new is also a multi, the .new() will dispatch to Any.new 17:42
grondilu I see. the constructor in B can still be a method. I think that's what i want
lizmat A common idiom is e.g.:
m: class A { has $.foo; method new($foo) { self.bless(:$foo) } }; dd A.new(42) 17:43
camelia A.new(foo => 42)
17:44 euandreh joined
grondilu yeah I know that idiom 17:44
I write it quite a lot but I wanted a generic role with a default constructor. 17:45
using a submethod one might do the job 17:46
Voldenet Using factory method is other solution for this 17:51
m: sub new-something($type) { $type.new("foo") }; class B { multi method new(Str $s) { say $s; self.bless(); } }; new-something(B).say 17:52
camelia foo
B.new
Voldenet this massively reduces complexity, because custom constructor is decoupled from the class 17:53
grondilu I like roles, though. I like being able to write something that is very generic, and leave details to inheriting objects. 17:55
I see raku's roles like C++'s abstract classes, but maybe that's a wrong comparison? 17:59
s/like/as/
well maybe it is, after all the point of roles is composition, now that I think about it. 18:01
not inheritance.
lizmat it's my understanding that you could see it that way... but then I'm no C++ expert
grondilu m: class A { multi method new {...}; multi method new { samewith "foo" }; }; class B does A { multi method new(Str $s) { say $s } }.new 18:02
camelia ===SORRY!=== Error while compiling <tmp>
A is not composable, so B cannot compose it
at <tmp>:1
grondilu m: class A { multi method new {...}; multi method new { samewith "foo" }; }; class B is A { multi method new(Str $s) { say $s } }.new
camelia Ambiguous call to 'new(B: )'; these signatures all match:
(A: *%_)
(A: *%_)
(Mu: *%attrinit)
in block <unit> at <tmp> line 1
grondilu m: class A { multi method new { samewith "foo" }; }; class B is A { multi method new(Str $s) { say $s } }.new
camelia Default constructor for 'A' only takes named arguments
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu m: class A { multi submethod new { samewith "foo" }; }; class B is A { multi method new(Str $s) { say $s } }.new 18:03
camelia ( no output )
grondilu yeah now I see I had no reason to use a role. A class was good enough.
so long as the generic constructor is a submethod
ah I forgot to check A.new is called 18:05
18:05 morte_ joined
grondilu and in fact it isn't since there is no output 18:05
oh well
18:07 reportable6 left 18:10 reportable6 joined 18:19 linkable6 left 18:20 melezhik joined
melezhik .tell SmokeMachine - any success with SparkyCI? 18:21
tellable6 melezhik, I'll pass your message to SmokeMachine
18:22 rbt left, rbt joined, linkable6 joined 18:28 Altai-man left 18:30 sena_kun joined
Voldenet grondilu: the C++ analogy makes it all confusing – derived methods are not going to be called properly in constructors 18:37
so `struct B { virtual void x() {} B() { x(); } }; struct D : public B { void x() { /* not going to be called */ }};` 18:39
however it would work in methods
18:40 abraxxa left
[Coke] ended up writing his latest dumb script using proc::async wrapper around curl since that works on windows just fine. 18:40
18:44 jjido joined 18:47 rbt left, rbt joined
japhb [Coke]: I do appreciate you letting me know about the CBOR::Simple problem on Windows. Good catch. 18:51
[Coke] Sure, happy to be a canary 19:02
19:05 grondilu left
Nemokosch well, it won't be called if the call should take place in the base constructor 19:06
however, I think this is inherently a virtual method thing because virtual methods are "data" 19:10
(obviously it wouldn't even arise which function is called if x weren't virtual so there's that)
[Coke] ... ugh. this API restricts you to get the first X elements... so you can't use the API to get all the data out. It's already paged... wtf. 19:11
(so if I ask for page... 21 or so, *barf*)
Nemokosch anyway, I didn't quite follow and I barely know anything about Raku OO; I've never used the language that way 😄 19:17
19:19 discord-raku-bot left, discord-raku-bot joined 19:29 jjido left
[Coke] oh, it's elasticsearch. (but I'm really going for a data dump, not a search) 19:31
japhb (Having to work around "cleverness")-- 19:40
19:42 jjido joined
[Coke] on the plus side, I do feel clever now that I got this working. :) 19:45
japhb Heh 19:47
19:54 melezhik left 19:58 melezhik joined 20:06 Xliff joined
Xliff \o 20:06
m: my $a =- 0; while (True) { NEXT { $a++ }; last if $a > 5 } 20:07
camelia ( no output )
20:14 sena_kun left 20:16 sena_kun joined 20:22 melezhik left 20:32 rbt left, rbt joined 20:48 rbt left, rbt joined, [Coke]_ joined
Xliff Was there no RWN, yesterday? 20:49
20:50 [Coke] left
El_Che no 20:51
good weather
20:53 rbt left, rbt joined 21:01 n1to joined 21:34 slu joined 21:50 hhcryfqnut joined 21:53 rbt left, rbt joined, rbt left, rbt joined
hhcryfqnut what's the preferred place to ask questions about Raku's documentation? Stack Overflow? or should I open an issue in github.com/Raku/doc  ? maybe not --it's not really an issue i guess 21:57
22:04 sena_kun left 22:05 sena_kun joined 22:17 morte_ left 22:20 n1to left 22:38 Sub joined
Xliff hhcryfqnut: You can ask, here 22:41
22:54 rbt left, rbt joined 22:56 lichtkind left 23:14 rbt left, rbt joined
SmokeMachine . 23:15
tellable6 2022-04-19T18:21:03Z #raku <melezhik> SmokeMachine - any success with SparkyCI?
SmokeMachine .tell melezhik I'm trying... but it's odd: the build list says it has failed, but the report says all tests have passed 23:17
tellable6 SmokeMachine, I'll pass your message to melezhik
23:25 zmoment joined 23:28 melezhik joined
melezhik . 23:29
tellable6 2022-04-19T23:17:57Z #raku <SmokeMachine> melezhik I'm trying... but it's odd: the build list says it has failed, but the report says all tests have passed
melezhik SmokeMachine I see that, this is SparkCI bug
I am working on it
this is really weird, as this happens on and off and I can't nail it down )))
so meanwhile, just look at the repot log ))), sorry for the inconvenience caused ... 23:30
I changed build statuses in database manually to avoid confusion, but I need to figure out the cause ... 23:31
23:44 rbt left, rbt joined
SmokeMachine melezhik: thanks! :) 23:53
23:55 rbt left, rbt joined