🦋 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.
Xliff_ Yeah, but would need nqp to get @!candidates. 00:06
roguerakudev It seems like I keep running into issues with type parameterization and typed parameters... is there an alternative to sub foo(SomeType @args) that allows me to pass a Positional that isn't explicitly created to be Positional[SomeType] but is nonetheless made up only of that type? 00:09
I kind of get why this is the way it is, because in general arrays can be heterogenous, but it's rather annoying that the compiler can't "just figure it out" when everything inside is a literal of a known type 00:10
Xliff_ roguerakudev: Try sub foo(@args where *.all ~~ SomeType) 00:11
If you use that a lot, you might want to create a subtype. 00:12
our subset SomeTypeArray of Positional where *.all ~~ Sometype
roguerakudev Hm, now I'm getting Constraint type check failed in binding to parameter '@logging-methods'; expected anonymous constraint to be met but got List ((Logging::Method.new...) 00:16
Just going to go with my real type names now lol
For reference this is with sub initialize-logging(@logging-methods where *.all ~~ Logging::Method) and the call looking like initialize-logging((Logging::Method.new(...),)) 00:17
vrurg Xliff_: why would you need it? Why &meth.candidates doesn't suite you? 00:25
I don't even see why would you need them in first place. Once you register an alias with add_multi_method the rest would happen automatically. 00:27
roguerakudev I think this may be a bug actually, because the same thing with a direct check is fine, e.g. (Str.new,).all ~~ Str returns True 01:05
but then sub foo(@args where *.all ~~ Str) { say 'yep' } and foo((Str.new,)) fails with expected anonymous constraint to be met but got List (("",)) 01:06
Xliff_ vrurg: Actually, I was able to make it work. 01:07
roguerakudev Decided to create an issue for it. We'll see if I'm just doing something silly now :) github.com/rakudo/rakudo/issues/5313 01:20
vrurg Xliff_: congrats! 01:34
tbrowder__ SmokeMachine: i looked at today Red after a long time since its early days, and it looks like it may be almost ready to use in othrer modules. Voldenet and others are saying sqlite or another db would be best for fast access for individual data storage as the next natural move after using a hash. so i was looking for opinions on whether Red is ready for real use. 02:10
*Red today
tbrowder__ not rushing, just looking 02:11
sacomo hi all, is there a way to have all modules install to a custom (non default) path, and then always use that path when running raku? 02:12
Voldenet I didn't use it but zef has install-to option 02:16
paired with ZEF_INSTALL_TO env var 02:17
sacomo Voldenet, thanks. Do I use ZEF_INSTALL_TO=new/custom/path raku script.raku to use that new path when running scripts? 02:18
Voldenet ZEF_INSTALL_TO only controls zef 02:20
RAKULIB path is used by raku to locate modules iirc
sacomo I have been testing the --install-to option and RAKULIB, but raku doesn't seem to find the modules installed in the --install-to custom path.... 02:22
Voldenet sacomo: use the format described here github.com/ugexe/zef#custom-instal...-locations 02:39
sacomo Voldenet: thanks 02:52
Voldenet: the info you shared (custom-installation-locaitons) worked for me. thanks again. 03:17
Voldenet I wish it was controlled by a single variable at some point 03:18
RAKUENV or something
sacomo yeah, that would be convenient 03:32
Xliff_ .tell vrurg Have an issue with method add_multi_method: "Type check failed in binding to parameter '$obj'; expected Any but got C (C)" -- Why am I getting this when core has the same signature: "($obj, $name, $code-obj)" 04:29
tellable6 Xliff_, I'll pass your message to vrurg
nemokosch @roguerakudev my suspicion was correct, it seems 09:02
this is not an inherent constraint check problem, merely a whatevercode anomaly 09:03
if you write { .all ~~ Str } instead of *.all ~~ Str, it will work
xinming_ tbrowder__: as a Red user, I can tell you, if you prevent cocurrent access to the db, Red works pretty fine when it works. and you may encouter some small bugs when you doing project, Red is usable. But IMO not production ready yet. 12:10
Also, your projects may need tests to ensure everything work as expected. 12:11
xinming_ I personally still uses DBIish for small utilites, I will choose Red for long term projects, as I believe it'll finally be production ready 12:13
vrurg . 13:25
tellable6 2023-07-14T04:29:51Z #raku <Xliff_> vrurg Have an issue with method add_multi_method: "Type check failed in binding to parameter '$obj'; expected Any but got C (C)" -- Why am I getting this when core has the same signature: "($obj, $name, $code-obj)"
vrurg Xliff: You get this because C isn't composed at the time and it passes no type matching yet. $obj has to be Mu to accept anything. 13:26
tbrowder__ xinming_: thanks 14:03
Xliff vrurg: OK, then there is a further problem with signature matching because the "callsame" in your example no longer matches what's in the parent. 14:23
So the callsame goes nowhere.
I have examples that sort of confirm this. I will attach them to the issue. 14:24
vrurg Xliff: callsame must re-dispatch to the upstream add_multi_method which is in the metamodel code. 14:36
Xliff vrurg: Yes, but that has signature ($obj, $name, $code-obj)
vrurg: Doesn't the lack of "(Mu $obj" have an effect on callsame? 14:37
A bit busy for the next few hours so I will update the issue with my findings.
roguerakudev Very strange… certainly counts as a “wat” 14:44
Oh, I bet it has something to do with Mu vs Any 14:45
Junctions inheriting straight from Mu so they don’t have Any-ish behavior
At any rate I have a workaround now, so thanks 14:46
Xliff rogueerakudev: Mind sharing?
roguerakudev Referring to Nemokosch’s comment above, using a block for the type constraint issue I was having yesterday (eg where { .all ~~ Type }) 14:48
Xliff Ah.
roguerakudev Discord has a reply feature, but obviously that doesn’t translate over the bridge :^) 14:50
Oh never mind, in the linked issue it explains the issue is smartmatch doesn’t get sucked up into the whatevercode, which I’m sure has some@good reasoning behind it… but as suggested, a specific warning would be nice 14:53
nemokosch well, as far as I understand, the reason has something to do with the "thunkiness" of the smartmatch operator 14:58
you know how && is short-circuiting? That makes it a pretty weird and impure operator 14:59
if you want to model it purely, you need to conclude that its right handside is in fact a piece of inline code
~~ works on the same principle: it evaluates the left handside, then it evaluates the right handside as a piece of code, having $_ set to the LHS value, and ultimately it calls .ACCEPTS($_) on the obtained value 15:01
I would optimistically think that there is no inherent reason why ~~ and && couldn't whatever-curry; perhaps it was just too complex, due to this special meta-nature of these operators 15:03
Now, from RakuAST point of view, I don't think these calls will be anything special, and therefore I'd hope that they can be generated as the right thing 15:05
roguerakudev Yeah, I can’t think of a scenario off the top of my head where you’d actually want those not to curry 16:12
So perhaps great things are ahead with RakuAST 16:13
nemokosch like of course these operators need special attention to be codegenned right - but I'd hope the extra complexity of paying attention to whatever-currying as well would be manageable 16:39
jdv what is going on 20:24
m: $*RAKU.compiler.version 20:26
camelia ( no output )
jdv m: $*RAKU.compiler.version.say
camelia v2023.06.98.g.34.a.1.a.5.da.5
guifa is back from TPRC 20:54
I only had like 3-4 typos in each presentation this time haha 20:55
guifa Also, Sawyer X's talk should be obligatory viewing for everyone. While he's talking about the Perl community in specific, much applies to our community as well 21:04
youtu.be/Q1H9yKf8BI0 21:05
gfldex I feel obligated to watch that talk! 21:11
guifa: Sadly, I have to repote that video to be rather boring to me. I work in customer service and I must presume that Sawyer X wouldn't last a week on the phone. You lot have no idea how lucky you are. I have "unpolite" pricks throwing abuse at me every single day and consider being able to deal with that as a rather important part of what it means to be an adult. 21:40
nemokosch this would be very well said if it didn't come from you of all people, lol 21:57
anyways, I also watched that video and it did try to present an understanding point of view 21:59
you don't have to empathize with me or anything but at least hear me out when I say: you cannot push a sonda into a person to check how they feel, so you will always have to decide based on their reactions 22:01
the more somebody reacts to any sort of discomfort, the more protection they will induce, and vice versa 22:02
and if you actually train people to be very stressed about any sort of discomfort they might suffer, it's quite possible that they might even overreact 22:03
www.youtube.com/watch?v=umJ7XtJuFLY another "obligatory viewing" - honestly, I hoped it would be more about the solution; it turned out to be so depressing it could be me venting 22:08
guifa demokosch: IIRC from that talk, it's just an initial bit of survey data and analysis, that's going to be part of a larger project 22:23
well, "initial bit" it's the completed survey with analysis, but the project had a limited scope as a piece of a larger project 22:24
nemokosch That sounds interesting 22:31
Of course it only applies partially to Raku but I think the "loyalists" part is accurate 22:34
guifa I would be wiling to bet that numbers for the two communities would be fairly similar. 22:35
also one thing to point out because there was some confusion during the talk that got clarified inQ&A
social norms == "my best friend told me perl sucked so I'm not gonna use it" or "Perl is badass 1337 hacker shit so I really want to learn it" 22:36
nemokosch Oh right that wasn't clear at all lol
There is a pretty important difference: Perl has been shrinking in popularity for quite a long time by now, Raku isn't lucky enough on its own to afford that 22:38
For Perl, a solid conservation plan might do it, for Raku, the barrier of visible presence still needs to be broken in many regards 22:41
roguerakudev let's be nice, now 22:50
leont gfldex: haven't seen it yet so I may be making assumptions, but I think manners within a community are an entirely different thing from dealing with people from outside a community. 22:53
nemokosch Let's just say that we have a history and I can't stand when somebody is openly hypocritical 22:57
It's not a right to get away with dishonesty and hypocrisy, damn it 22:58
japhb tbrowder__: App::SerializerPerf:ver<0.0.5> uploaded; are those README changes sufficient? 23:36
tbrowder__ thnx, checking now... 23:57