🦋 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:18 jpn joined 00:23 jpn left 00:25 jjido left 01:15 jpn joined 01:20 jpn left
ugexe librasteve: i dunno about deprecating it, but I'd say you almost never want to `use lib ...` in a file contained in a distribution. if the code containing `use lib ...` wouldn't otherwise be distributed (i.e. private code) then it can make sense 01:48
01:50 jpn joined
ugexe imagine a `bin/foo` with a `use lib "lib"`. when the distribution containing `bin/foo` is installed and the user executes it, they likely won't be in the directory of that distribution so the `use lib "lib"` is not only pointless (the modules are being provided from the installation), its actually a potential security issue in that a malicious user could create a lib directory somewhere they have 01:54
permissions hoping that a high priv user will run bin/foo from the parent of the malicious lib
01:55 jpn left 02:10 Manifest0 left, sdfgsdfg joined 02:12 antim0d3s left 02:20 hulk joined 02:21 kylese left
ugexe use lib $?FILE.parent.absolute or some such gets around the security issue, but it still would be pointing to a library path that doesnt exist when whatever module/file using that is loaded from an installation repo 02:36
03:01 AlexDaniel left 03:15 hulk left, kylese joined 03:38 jpn joined 03:43 jpn left 04:14 epony left 04:15 epony joined 04:33 jpn joined 04:38 jpn left 04:45 jpn joined 04:50 jpn left 05:46 jpn joined 05:50 jpn left 06:34 teatime joined 06:47 jpn joined 06:51 jpn left 07:11 stnick joined 07:12 stnick left 07:16 derpydoo joined 07:48 jpn joined 07:53 jpn left 08:21 jpn joined 08:33 epony left 08:35 epony joined 09:23 epony left 09:24 epony joined 09:42 sena_kun joined 09:55 jpn left 09:56 jpn joined 10:06 jjido joined 10:35 Manifest0 joined 10:37 epony left, jpn left 11:19 jjido left 11:23 epony joined 11:28 randomname12345 joined 11:30 randomname12345 left 11:38 lizmat_ joined 11:41 jpn joined 11:42 lizmat left, lizmat_ left, lizmat joined 12:00 derpydoo left 12:19 jpn left 12:21 Sgeo left 12:30 xinming left 12:32 xinming joined 12:53 jpn joined 12:58 jpn left 15:23 jpn joined 15:32 jpn left 15:36 jpn joined 15:47 jpn left 16:19 jpn joined 16:26 jpn left 16:35 rjhb joined 16:36 rjhb left 17:07 Xliff joined
Xliff \o 17:07
librasteve thanks for the explanation…
Xliff Can you decompose a hash in a signature?
m: sub a (%a (a => True ) ) { %a.gist.say }; a; 17:08
camelia ===SORRY!=== Error while compiling <tmp>
Invalid typename 'a' in parameter declaration.
at <tmp>:1
------> sub a (%a (a⏏ => True ) ) { %a.gist.say }; a;
Xliff m: sub a (%a { a => True } ) { %a.gist.say }; a;
camelia ===SORRY!=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> sub a (%a ⏏{ a => True } ) { %a.gist.say }; a;
librasteve Xliff: my small brain thinks that "decomposing a hash in a signature" is just another way of saying "named arguments" ... the example you give is composing the hash in the signature afaict 17:12
Xliff Yeah, but I want to use a slurpy and assign defaults.
librasteve oh - I see ... let me think 17:13
Xliff Thanks!
librasteve m: sub fn( :$a = 1, :$b = 2, *%h ) { say $a, $b; say %h; }; fn( |%(a=>1, b=>2, c=>3) ); 17:20
evalable6 12
{c => 3}
Raku eval 12 {c => 3}
librasteve so that's what I have in mind when you say decompose a hash in a signature with defaults and with a slurpy ... sorry I this is a pretty dumb answer likely I do not understand what you are asking 17:21
17:23 abraxxa-home joined
oh, maybe you want to pass in a single hash and have the signature set value defaults for some of the hash items 17:24
sorry don't know how to do that ;-( 17:29
ugexe you can't defaults on the hash itself, but you can on named parts of it 17:38
m: sub foo(%_ [:$foo = 42, *%]) { say %_.raku; say $foo }; my %x; foo(%x) 17:39
camelia {}
librasteve m: multi sub fn(:$a=1,:$b=2,*%r) {samewith %(|%r, :$a, :$b)}; multi sub fn( %h ) {%h.say}; fn( |%(a=>1,c=>3) ); 17:40
evalable6 {a => 1, b => 2, c => 3}
Raku eval {a => 1, b => 2, c => 3}
librasteve ^^ just an idea with multis
17:45 abraxxa-home left 18:20 jpn joined
Xliff librasteve: That is close, but the extra multi makes it difficult for my use case.... I would need to reorganize a LOT of code. 18:50
librasteve++: Thanks, anyways! 18:51
librasteve no problem 18:55
19:38 jpn left 20:26 merp left 20:31 merp joined
guifa Assuming the answer is no but.... do we have compiler hooks yet for RakuAST mischief? 20:43
I'm in an analysis class right now and realizing how nicely I could most of this in LLVM analysis could apply to RAST 20:44
antononcube @guifa Interestingly, right now I am considering how too use LLMs instead of RakuAST. 20:46
20:53 jpn joined
Xliff LLM? Large Language Models? 21:20
21:29 Sgeo joined 21:51 jpn left
antononcube @Xliff Yes. 22:05
Xliff How would you use LLMs in place of RakuAST? 22:12
Or is it just that you are putting more effort into LLMs? 22:13
22:47 jpn joined 22:52 jpn left
antononcube @Xliff What is the mission of RakuAST? I assume it is better Raku code generation. (Faster generation, more reliable and maintainable, easier to read.) 23:25
Well, that is the main RakuAST mission, then Raku generation can be delegated to LLMs using the related reliable, easier to manager workflows. 23:26
Ideally, the transition of NQP code to RakuAST should be supported by LLMs. (Or event completely outsourced to them.) 23:27
lizmat antononcube there is no NQP code to be transitioned to RakuAST? 23:36
23:47 jpn joined
Xliff antoncube: Actually, RakuAST is also used as output for the parser. 23:50
Parse the code, you get a RakuAST tree. Walk the tree you can either get the Raku code back, or something akin to bytecode. 23:51
At least that's how I understand it.
23:53 jpn left