🦋 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.
00:00 reportable6 left 00:01 reportable6 joined
Geth ¦ problem-solving: vrurg assigned to codesections Issue Rakudoc in third-party modules and some related topics github.com/Raku/problem-solving/issues/373 01:02
01:22 abraxxa-home left 01:32 zapwai joined 01:41 MasterDuke joined, abraxxa-home joined 01:47 MasterDuke left 02:01 MasterDuke joined 02:07 rf left, rf joined 02:09 xinming joined 02:25 teatwo joined 02:26 teatwo left 02:27 teatwo joined 02:28 teatime left 02:32 zapwai left 02:59 silug left
[Coke] you could remove any precomp dirs and then only used things will come back. 03:02
(which I know isn't what you were asking specificially) 03:06
rf . 03:22
Also, evening folks :)
03:32 rf left 03:37 silug joined 04:33 snonux left, snonux joined 05:33 squashable6 left, evalable6 left, benchable6 left, linkable6 left, unicodable6 left, bisectable6 left, shareable6 left, greppable6 left, notable6 left, sourceable6 left, quotable6 left, tellable6 left, releasable6 left, committable6 left, reportable6 left, statisfiable6 left, coverable6 left, nativecallable6 left, bloatable6 left 05:34 committable6 joined, reportable6 joined 05:35 releasable6 joined, unicodable6 joined, bloatable6 joined, statisfiable6 joined, nativecallable6 joined, evalable6 joined, sourceable6 joined, notable6 joined, squashable6 joined 05:36 tellable6 joined, quotable6 joined, greppable6 joined, bisectable6 joined, coverable6 joined, benchable6 joined, shareable6 joined 06:00 reportable6 left 06:01 reportable6 joined 06:27 oodani left 06:28 oodani joined 06:34 linkable6 joined 06:43 gordonfish left 06:44 gordonfish joined 06:59 abraxxa-home left 07:05 euandreh left 07:08 euandreh joined 07:20 sena_kun joined 07:38 jpn joined 07:43 jpn left 07:47 Sgeo left 08:11 dakkar joined 08:23 jpn joined 08:58 aazza joined 09:00 aazza left 09:21 sena_kun left 09:57 derpydoo left 09:59 Essai joined 10:00 Essai left 10:18 Xliff joined
Xliff \o 10:18
Is it possible to add aliases to a parameter at runtime? If so, how?
Here's my last attempt:
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; $aliased.gist.say; p.^attributes[1].set_value(p, nqp::list_s) }; sub a ( :$b is aliased<bb bbb> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.elems.say }; a 10:19
camelia (bb bbb)
@!named_names
0
Xliff Nope.. not that one... 10:20
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; $aliased.gist.say; p.^attributes[1].set_value(p, nqp::list_s) }; sub a ( :$b is aliased<bb bbb> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.elems.say }; a
camelia (bb bbb)
@!named_names
0
Xliff Maybe this one? 10:21
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; $aliased.gist.say; p.^attributes[1].set_value(p, $aliased.List) }; sub a ( :$b is aliased<bb bbb> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say }; a
camelia (bb bbb)
This type (List) does not support elems
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1

@!named_names
Xliff There it is!
lizmat Xliff: trait_mods are compile time, not runtime 10:22
m: sub trait_mod:<is>($a, :$foo!) { say "trait" }; my $a is foo; INIT say "INIT" 10:24
camelia trait
INIT
Xliff lizmat: So is there no way to assign an alias to a parameter via trait?
The current method is.... LTA
lizmat could you gist what you mean it to do *exactly* ? 10:26
11:18 linkable6 left, evalable6 left 11:19 evalable6 joined, linkable6 joined 11:55 tonyo left 11:56 tonyo joined, Guest37 joined 12:00 reportable6 left 12:01 reportable6 joined 12:09 merp left 12:14 jpn left 12:15 merp joined 12:18 Guest37 left 12:23 jpn joined 12:27 jpn left 12:43 lucs left, lucs joined
Xliff lizmat: OK, I'd like to do something like this: "sub a (:$b is aliased<bb bbb>) { say $b }" which is syntactical sugar for "sub a (:bbb(:bb(:$b))) { say $b }" 12:43
lizmat wouldn't that be just setting the @!named_names attribute on the Parameter object ? 12:46
Xliff Yes, but since it's private, how can that be done?
In my example (above) I tried doing it using .set_value and it threw an error.
"This type (List) does not support elems" 12:47
lizmat nqp::bindattr(p,Parameter,'$!named_names',my str @ = <foo bar>)
Xliff Er...
nqp::bindattr(p,Parameter,'@!named_names'...) # ???
Will try that in a sec. Thanks.
lizmat yeah, it expects a native str array 12:48
Xliff WTF.... 12:49
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; $aliased.gist.say; p.^attributes[1].set_value(p, $aliased.List) }; sub a ( :$b is aliased<bb bbb> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say }
camelia (bb bbb)
Xliff It's working now!?
lizmat even better :-) 12:50
Xliff m: $*RAKU.compiler.version.say
camelia v2023.05.151.g.3.d.0.b.32228
lizmat you can lose the "use nqp" then :-)
even better still!
Xliff m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { $aliased.gist.say; p.^attributes[1].set_value(p, (p.name.substr(2), |$aliased).List) }; sub a ( :$b is aliased<bb bbb> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say } 12:52
camelia (bb bbb)
12:55 jpn joined
Xliff m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { p.^attributes[1].set_value(p, (p.name.substr(2), |$aliased).List) }; sub a ( :$b is aliased<bb bbb> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say }; a 12:55
camelia @!named_names
This type (List) does not support elems
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff lizmat: Nope... not calling a() ^^
lizmat try storing $aliased in a native str array, and setting that 12:56
also: less fragile would be .^attrbutes.first(*.name eq '$!named_names') ? 12:57
Xliff lizmat: Close... 13:00
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; nqp::bindattr(p,Parameter,'@!named_names', my str @ = (p.name.substr(1), |$aliased).Array ) }; sub a ( :$b is aliased<bb bbb c> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say }; a( bb => 2 )
camelia Unexpected named argument 'bb' passed
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff This works though...
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; nqp::bindattr(p,Parameter,'@!named_names', my str @ = (p.name.substr(1), |$aliased).Array ) }; sub a ( :$b is aliased<bb bbb c> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say }; a( )
camelia @!named_names
(b bb bbb c)
13:00 dg left 13:01 dg joined
Xliff But only if... 13:01
m: sub trait_mod:<is>(Parameter \p, :$aliased is required) { use nqp; nqp::bindattr(p,Parameter,'@!named_names', my str @ = (p.name.substr(1), |$aliased).Array ) }; sub a ( :$b is aliased<bb bbb c> ) { my $p = &?ROUTINE.signature.params.head; $p.^attributes[1].name.say; $p.named_names.say }; a( b => 0 )
camelia @!named_names
(b bb bbb c)
13:04 jpn left
dakkar oh, as we're talking about MOP and attributes: thoughts on `attributes()` vs `attribute_table()` ? 13:16
Xliff So that error is emitted in BOOTSTRAP.c - and BOOTSTRAP scares me, sooo.... 13:18
lizmat Xliff: it should :-)
fortunately, RakuAST has a completely new bootstrap 13:19
dakkar so it will be *differently* scary 😜
Xliff Looks like the aliases have already been added to where they are expected by the time my trait is run, so the extras are not known to nqp::capturenamedshash
lizmat well, then I guess you will have to wait until RakuAST :-( 13:20
Xliff Heh. And how will RakuAST fix the problem?
Looks like the problem is in nqp, and isn't nqp -before- RakuAST? 13:21
Seems like this is something the parser might be doing.
lizmat well, you should be able to change the RakuAST::Paramater object before the Parameter object is created 13:22
Xliff Ah, OK. That sounds good. 13:26
13:27 jpn joined
Xliff So will there be a COMPILE phase where RakuAST objects are serialized into QAST? 13:28
The best time to do what I need will be then. Would be curious to know how the tree can be exposed before that happens.
lizmat: Has that mechanism been spec'd out, yet?
13:34 jpn left, teatwo left 13:40 jpn joined
lizmat Xliff: not entirely, but in my RakuAST blog posts you can see how you can walk the tree with .map 13:53
in the CHECK phaser
13:58 zmoment left 14:40 phogg left 14:41 phogg joined 14:49 ProperNoun left, ProperNoun joined
Xliff OK, so in my example, maybe I can just create a CHECK phaser via RakuAST and perform my modifications that way? 14:55
tbrowder__ [Coke]: i'll take you up on yr offer to find yr windows cookbook draft when you get a chance. thnx. 14:58
lizmat Xliff: that'd be the idea, yes 15:08
Xliff lizmat: OK, thanks. Do you think there will be a better access mechanism than $*CU? If I only want to change a Parameter object, it would be nice to go directly to its AST representation and work from that. 15:14
Thoughts?
lizmat Xliff: none sofar... $*CU is the only way "in" at the moment 15:15
15:22 Sgeo joined
[Coke] tbrowder__: gist.github.com/coke/f6488d106d4a5...3e69b553f5 was the WIP 15:22
Notably missing: the way I build on windows, which uses nmake & the microsoft compiler. 15:23
15:38 teatime joined 15:49 nmaster joined, nmaster left, zups left 15:50 zups joined 15:51 RonaldR34g4m left 16:01 Vyrus joined 16:36 dakkar left 16:37 dakkar left 17:12 rf joined 17:40 sena_kun joined 17:47 tg57 joined
tg57 Does anyone know good job boards for startups that are hiring? 17:52
17:57 jpn left, rf left 18:00 reportable6 left, Sgeo left 18:01 reportable6 joined
tonyo . 18:10
18:16 tg57 left 18:21 RakuIRCLogger left, RakuIRCLogger joined 18:22 molotov joined
molotov Why raku crashes on this code 18:32
use NativeCall;
sub NtQuerySystemInformation() returns Pointer is native('ntdll.dll') {*};
class SYSTEM_BASIC_INFORMATION is repr('CStruct') {
tellable6 2023-06-20T20:27:37Z #raku <tonyo> molotov: what do you mean by bitfields?
molotov   ...
}
my $tempo = NtQuerySystemInformation();
my &query = nativecast(:(uint32, SYSTEM_BASIC_INFORMATION, uint32, uint32 is rw --> int32) , $tempo);
my SYSTEM_BASIC_INFORMATION $info .= new;
my uint32 $rets = 0;
my $ntstatus = query(0, $info, nativesizeof($info), $rets); #this crushes
What I miss defining parameters of NtQuerySystemInformation dynamically?
tellable6 I mean something like this 18:35
struct todo {
   uint16_t a : 1;
   uint16_t b : 15;
}
[Coke] molotov: please use a pastebin service, or github gist, etc. for multi-line code samples
molotov [Coke] I cant 18:36
18:37 jpn joined 18:38 zapwai joined
molotov There's no good point in the official documentation about native call interface (I mean my trouble) 18:40
18:42 jpn left 18:45 samizdat joined 18:47 jpn joined
molotov Understood, nobody knows. 18:54
lizmat nobody currently online knows, indeed
18:54 Sgeo joined
tbrowder__ [Coke]: thanks for the gist 18:55
molotov miserable raku 19:00
awful documentation
lizmat molotov: it can only become better if we know what's wrong: github.com/Raku/doc/issues/new/choose 19:02
"awful" doesn't cut it 19:03
19:04 Sgeo left
molotov lizmat damn raku! Better go back to Python. 19:07
19:07 molotov left, Sgeo joined
El_Che I am sure the Python people will love his presence there 19:27
jast or it will go the other way there: "this is so much better than raku!" - "uh, what is raku" :-) 19:28
CIAvash I don't know if anybody wants, this but I created a Raku organization on Zulip(zulip.com/) to discourage use of Discord and encourage use of Libre Software. Also it is good for people working as teams on Raku projects(it also has video and voice chat). And I requested for sponsorship so that the organization gets upgraded to the "Standard" plan(one of its benefits is that you can make "streams" viewed by anyone, not just logged in users), so 19:33
they accepted my request and the plan got upgraded("Your organization's request for sponsored hosting has been approved! You have been upgraded to Zulip Cloud Standard, free of charge. :tada: If you could list Zulip as a sponsor on your website, we would really appreciate it!"). You can view the organization here(no content yet! of course), just streams: raku.zulipchat.com/
lizmat CIAvash++ 19:34
weekly: raku.zulipchat.com/
notable6 lizmat, Noted! (weekly)
jast FWIW the docs for NativeCall seem to make immediate sense to me, the only thing I couldn't find from a simple read-through is how to define c structs with bit fields, or if it's possible in the first place.
CIAvash if anyone on the core team or other teams are interested, let me know so I make you admin/...
jast (that's not a real question from me btw, I'm not doing any NativeCall things nor, in fact, any Raku things right now :)) 19:36
19:43 samizdat left 20:00 tg57 joined 20:08 vrurg_ is now known as vrurg 20:11 jpn left
tonyo lol 20:32
i do know, if it doesn't just work then use the work around by either doing the thing i said or reading about how bitfield works 20:33
coleman Zulip is mindbending; it's such a unique chat paradigm 20:48
20:50 rf joined
coleman The IETF uses it for some dev projects. JMAP, for one. 20:52
20:52 sena_kun left, zapwai_ joined 20:57 zapwai left
librasteve fwiw I think we need a more closed group with tighter moderation 20:58
(even if that means dropping Discord)
which i now voluntarily do 21:00
21:02 p6steve joined
rf @tg57 jobs.perl.org/ 21:02
[Coke] I was spoiled by a MUD that someone wrote at my uni because everyone hated IRC. 21:12
used it for probably 20 years. (it's still in use, but because it was gated, the community shrank every few years) 21:13
coleman API looks nifty zulip.com/api/send-message 21:28
A lot of times the default/flagship GitHub integrations for these sorts of things waste too much vertical space per post (imo) 21:30
CIAVash: would you mind dialing the public visibility back on the infra stream in Zulip? Maybe just to "needs org membership" 21:34
21:40 zapwai_ left, rf left 21:45 zapwai_ joined 22:00 rf joined 22:07 jpn joined 22:08 zapwai_ left
[Coke] .seen rawley 22:09
tellable6 [Coke], I haven't seen rawley around, did you mean valley?
22:14 jpn left 22:30 nicole left 22:35 tg57 left 22:37 jpn joined
rf Hey [Coke] 22:39
rf === rawley
or I should say `rf eqv rawley` 22:40
coleman he mentioned you in #raku-doc, rf 22:43
22:45 jpn left
rf Ah didn't auto-join that channel since my last install whoops 22:49
22:57 jpn joined 23:02 jpn left 23:34 jpn joined 23:37 ProperNoun left 23:49 sftp joined