🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
rf "Missing serialize REPR function for REPR MVMContext (BOOTContext)" what did I do lol 03:49
Geth doc: 2colours++ created pull request #4198:
Making "our declaration" more accurately described
09:42
Guest53 lll 10:19
tbrowder .tell JRaspass i 13:24
tellable6 tbrowder, I'll pass your message to JRaspass
tbrowder .tell JRaspass i've asked for some help on irc #raku-land 13:25
tellable6 tbrowder, I'll pass your message to JRaspass
pingu is there a way to make this regex work with raku regex101.com/r/HCK9jC/4 16:23
when I read rakus documentation on regex its just code examples that I don't understand 16:24
guifa token number { … }; regex line { ^\h* $<linetype>=<[0..6]> \h+ $<color=number> \h+ $<xrot=number> … etc etc $<filename>=[\S+[.]\S+] $ } 16:38
guifa although you could probably make it cleaner by changing <ws> to be \h+ and declaring it a rule instead of a regex then you'd just do $<color=number> $<xrot=number> without any other changes (also in that case you'd want to do \S+? instead because IIRC a rule blocks backtracking 16:40
cfa o/ 16:42
rf .tell tonyo I may be missing something but I think fez init should take a name, and make the module inside of the directory rather than within the CWD 16:43
tellable6 rf, I'll pass your message to tonyo
rf .tell tonyo Besides that everything seems to be working fairly well, not exactly sure where cmd sources its commands from though. 16:46
tellable6 rf, I'll pass your message to tonyo
cfa hmm, this feels like a bit of a trap -- or surprising behaviour that should be documented at least: 16:47
m: module A {}; module B { class A::C {} }; A::C.say
camelia (C)
cfa here, because module A already exists, class C is created in module A, and is therefore referenced as A::C (rather than B::A::C). by contrast, when module A doesn't already exist, A is created as a package within B:
m: module B { class A::C {} }; B::A::C.say
camelia (C)
cfa in other words, nesting behaviour is very sensitive to imports (especially problematic when you're using 'unit'). for example, module A { class Text::Foo {} } might create A::Text::Foo... unless you've already imported Text::CSV, in which case you've just declared Text::Foo.
thoughts? 16:48
rf m: use Test; module A { class Test::Foo {} }; say Test::Foo; 16:50
camelia (Foo)
rf m: use Test; module A { class Test::Foo {} }; say A::Test::Foo;
camelia Could not find symbol '&Foo' in 'A::Test'
in block <unit> at <tmp> line 1
rf Hmm I could see where this could be confusing
Nemokosch This is very confusing, bluntly put 16:53
Disturbing, even
Anyway, I hope you didn't forget about the doc meeting 🥁 16:54
rf I'm struggling to get jitsi installed stand by 16:56
Nemokosch I'm painh to just use the browser
cfa Nemokosch, doc meeting? 16:58
Nemokosch Yep
rf What's the jitsi link, sorry :D 16:59
cfa oh, that was a comment to rf, sorry 17:00
Nemokosch meet.jit.si/raku-docs 17:01
cfa (back later) 17:13
Xliff \o 17:58
Does Raku have SFTP libraries?
Nemokosch Meeting was okay imo
whatnext Hello all... I am wondering how raku performance benchmarks are looking these days... is there a recent summary somewhere? :) 18:03
rf When you say these days, what time frame are you thinking? 18:14
whatnext I guess I'm just looking for the most recent update 18:17
rf .tell tonyo I also think the name field of META6 should be: Module::Bob instead of Module-Bob 18:28
tellable6 rf, I'll pass your message to tonyo
rf whatnext: There was a reddit post a little while back about it
whatnext rf do you have a link? :) 18:30
rf www.reddit.com/r/rakulang/comments...ments_and/ 18:33
whatnext: ^ 18:34
Nemokosch Actually ugexe made a good argument that it should indeed be Module-Bob, instead of Module::Bob 18:35
tbh no matter what a dependency is, a module or a dist 18:36
whatnext rf: ah that's great - very useful thank you :)
Nemokosch distinguishing the two can only be right
ugexe Ideally distribution names use characters safe on most file systems 18:38
It makes it easier to generate human readable file names for the tar gz files 18:39
rf Makes sense! 18:51
QhpAptyj9hj0RQwM Not really Raku related, but I'm looking for the a good web template system to make a site without client-end JS. Any suggestions? 19:11
rf Humming-Bird with Mustache or Cro with Cro templates 19:26
QhpAptyj9hj0RQwM rf: Nice, I didn't even think of using Cro for this project. Thanks a lot! 19:31
rf Is there a nice way to throw exceptions from nativecall? 22:01
rf Another question as well, is there a nice way to return a map from native call? 22:03
rf In Ruby if I wanted to return a map from a native-call it would be like rb_hash_new(); in C, is there a header I can pull in for Raku types? 22:04
p6steve ++ this ... fwiw I have used similar as a coercion method name : method Dan-DataFrame( Dan::Polars::DataFrame:D: ) { ... } 22:12
rf I'm wondering if I can use Moar types 22:17
Or imitate them
cfa o/ 22:35
rf p6steve: stackoverflow.com/questions/754238...ative-call 22:59
tellable6 rf, I'll pass your message to p6steve
rf Hopefully someone will come up with something
guifa_ rf: not sure if you can do it directly from within C, but if you can return an array of sorts, then I think you can fairly easy add a trait to the method to convert accordingly 23:13
It's obviously not exactly what you want, but might be able to save you some hassle: 23:17
m: sub trait_mod:<is>(Sub \s, :$hashy!) { s.wrap: anon sub :: (|c) { callsame.hash } }; sub foo is hashy { return <a b c d> }; say foo
camelia {a => b, c => d}
rf What happens when I need to embed maps though? 23:19
I can't express that in C very nicely.
guifa_ well, that's a bit more work ha. I didn't know how complex you were going 23:20
Like I said, it's not a do-it-in-C solution, so it wouldn't work for all use cases
rf Yeah I thought of using a list type but it gets super weird.
Basically I encode JSON in C then need to pass it up as a map to Raku 23:21
hythm m: say Attribute.^methods 23:26
camelia (The 'ForeignCode' class is a Rakudo-specific implementation detail and has no serviceable parts inside The 'ForeignCode' class is a Rakudo-specific implementation detail and has no serviceable parts inside The 'ForeignCode' class is a Rakudo-specific…
hythm How to get the methods list I can call on `Attribute`? 23:27
:m say Attribute.^attributes 23:30
m: say Attribute.^attributes
camelia (str $!name int $!rw int $!ro Mu $!required int $!is_built int $!is_bound int $!has_accessor Mu $!type Mu $!container_descriptor Mu $!auto_viv_container Mu $!build_closure Mu $!package int $!inlined Mu $!dimensions int $!box_target int $!positional_de…
hythm m: say Attribute.^methods.grep(*.name ne '<anon>') ## found it 23:53
camelia (compose apply_handles get_value set_value container readonly package inlined dimensions WHY set_why Str gist)