Raku Conference Day 2 on Youtube: www.youtube.com/watch?v=BL9-XdC9WYI 🦋 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 14 August 2022.
SmokeMachine I like having one class on each file and let a EXPORT decide what to do… 00:21
Xliff \o 00:23
I can't seem to get Inline::Perl5 to install on my Mac Mini. Any ideas?
Is anyone alive? 00:38
guifa_ is alive 00:39
Let me give it a try, I've got a mini, but not an M[12] 00:40
Xliff Thanks, guifa!
guifa_ [Inline::Perl5] p5helper.c:1:10: fatal error: 'EXTERN.h' file not found
Xliff Aha. 00:41
How are you showing the error? Let me see if I get the same.
guifa_ zef spit it out for me
Xliff guifa: gist.github.com/Xliff/c78fb770c8b1...bdb007e9c6 00:45
guifa_ ooooooh 00:47
Xliff :> !
guifa_ That's an interesting (ab)use of declarator pod
Xliff I know
Should I feel dirty? 00:48
guifa_ No
Xliff :)
guifa_ Because you can make it ultra clean very shortly
I actually am about to release a module that finally puts us in sight of the holy grail
Xliff Really?
Xliff Please share 00:48
guifa_ grammar Foo { ecma-regex foo { …interpreted as javascript regex… } } 00:49
will be 100% valid Raku code
Xliff OK. How does that relate to the SQL use case?
guifa_ So if I allow literal Javascript-style regex code in between the brackets 00:50
Xliff BTW - I tried writing a grammar for SQL.
guifa_ there's nothing stopping me from putting any other kind of grammar there
like, say, SQL code :-)
Xliff OK. One problem...
github.com/Xliff/perl6-Parser-SQL [I've already tried that... not yet finished] 00:51
guifa_ Did you hit a major roadblock or just need more time to refine stuff ? 00:52
Xliff Nah. It's just time consuming getting all of the tokens defined, tested and integrated. 00:56
That and the fact that p6-GLib took over my life! 00:57
This was one of my first Raku (then Perl6) projects.
I actually like how my DB modules work now. I have them integrated into a Cro-based App-Server I'm writing for $dayJob. 00:58
guifa_ If you could do a dummy grammar enough to detect when the final } is, that would probably be enough 01:06
In the meantime, I legit like your hack :-)
Also consider you could still write it "in" the block 01:07
method foo (…) is query { #= sql-code }
Xliff Ah. Thanks! I didn't know that. 01:13
Also note that my hack supports parameters... 01:17
#| SELECT id FROM lightsail_instances WHERE data->"$.name" = ?
method getLightsailInstanceByName ($n)
So the .prepare and the .execute($n) are handled ....
guifa_ nice 01:30
guifa_ Alright yay it's been posted 01:52
Although right now for some reason fez isn't liking it. Keeps saying that the auth needs to be "zef:" but... it is 01:53
tonyo ugexe ^^ any ideas on that one? (checkbuild doesn't report any errors) 01:55
Nm, I *think* it's related to me needing to reset password. After the password reset, fez thinks it's logged in properly, but it doesn't seem to be in a perfect state. I did fez login again, and now it seems to be okay 01:58
Xliff: github.com/alabamenhu/PolyglotRegexen
tellable6 guifa_, I'll pass your message to Xliff
SmokeMachine guifa_: it seems you committed the .precomp 08:18
guifa_ SmokeMachine yeah, I don't know how that happened, esp since .precomp is in the .gitignore 09:19
is deleted now. I'm assuming (hoping?) fez strips out the precomp 09:30
El_Che listening to lizmat atm :) 11:02
lizmat oh dear :-)
El_Che there will be manu frobs in the ecosystem :) 11:04
El_Che salve's suggestion about shell autocomplete is a good idea 11:22
I used to use docopt in go
it's nice, but it can be too much or too little on your usage 11:23
lizmat I understand that docopt allows you to create code from an interface description, right ? 11:27
El_Che it creates the cli interfaces from the documentation
lizmat but you still need to fill in the actual working bits, right ? 11:28
El_Che let me peek in my code 11:31
it has been ages
it autoparses the cli params and creates help, verbose, debug etc 11:32
I use it to fill a Params struct with all the options and take it there in main 11:33
so it works the other way round as raku 11:34
instead of generation usage from signatures, it handles signatures from usage 11:35
(or at least, that's how I used it)
they have plenty of documentation and an org that accepts implementations for other languages 11:36
SmokeMachine At some point will we need something like: `my %SUB-MAIN-OPTS = do-all-the-right-things()`? 11:37
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/08/15/2022-...succeeded/ 11:38
El_Che well, I had similar frustation with the builtin go cli param handler (flag) as with raku's: the non gnu way of parameters and the strict order between params and arguments/cmds
(raku's params handler is way nicer than go's, by the way) 11:39
Nemokosch yey 🥳 11:42
El_Che Nempkosch: I watched your talk too, what a journey :) 11:43
(for me Nemokosch == the discord guy)
Nemokosch haha 😄 11:45
I'm curious about you as well. One of the names that don't have a face to them in my mind... 11:46
El_Che we'll met at real live conference in the future :) 11:48
Nemokosch letsgooo 12:01
can't promise to go to the US though :DD
El_Che NemokoschM: I am EU based, not so far from lizmat (another country, though) :) 12:02
Nemokosch 🧐 gonna catch you 12:13
MasterDuke lizmat: doesn't the race example in that SO question need to be 'race for <…>.race {' ? 12:15
leont El_Che: yeah I think you're closer to lizmat despite me being the one living in the same country 😛 12:22
El_Che hehe, true 12:25
Anton Antonov At this point it seems <@297037173541175296> that -- judging by talks and comments at TRC-2022 -- knows Raku better than me. (I started using Raku "intensively" in 2019.) 13:30
Nemokosch well well, that's flattering on one hand, but yes, the trick is that what I know I know pretty well, and then what I don't know well, I might not know to any useful extent 13:42
like OO
also, you know, I wish there were more people like you around Raku 13:46
The expertise part of Leon's talk
melezhik o/ 15:37
tellable6 2022-07-26T22:42:55Z #raku <jjatria> melezhik: about the Tomtit profile, I don't think I really understand what those "profiles" are yet. But sure, knock yourself out :)
2022-08-04T19:05:47Z #raku <AlexDaniel> melezhik: thanks for letting me know, I think it works now and it's fixed for good
melezhik .tell @AntonAntonov SmokeMachine sparkyci queue got stuck, so no new builds are triggered right now, I am planning to fix this, but no sooner then probably next week 15:38
tellable6 melezhik, I cannot recognize this command. See wiki for some examples: github.com/Raku/whateverable/wiki/Tellable
melezhik .tell SmokeMachine sparkyci queue got stuck, so no new builds are triggered right now, I am planning to fix this, but no sooner then probably next week 15:39
tellable6 melezhik, I'll pass your message to SmokeMachine
SmokeMachine melezhik: 👍
melezhik I just left my laptop with my family with the only ssh public available on it, he-he ))) 15:40
so once I get the one ... I'll fix the issue
I enjoyed the conference, it was good one, I liked it 15:41
lizmat ++ for your rak talk, was interesting to hear
Nemokosch haven't forgotten to return to your talk 🙂 16:15
Actually I have time to watch it right now, as things turned out 16:21
Anton Antonov I have to Melezhik's talk too. (Missed it on Saturday...) 16:28
I have to watch Melezhik's talk too. (Missed it on Saturday...)
Altreus Are the videos up or are you scanning through the VOD from the stream? 16:29
lizmat afaik, the separated videos are not up yet 16:39
pretty sure Andrew would have tweeted about that 16:40
Altreus ya I guessed :) I will keep an eye out
Anton Antonov @lizmat I consider proposing an (OOP) pipeline design for the App::Rak functionalities / intents. For example, `my App::Rak $rk .= new; $rk.find-files(rx/.../).find-lines(rx/.../).grep(...).sort(*.size)` . 16:49
@lizmat Probably granularity can be generalized to be not just "files" or "lines", but also "directories" and "code blocks/subs". 16:50
lizmat hmmm.... per-dir interesting thought 16:51
Xliff Did the ":from<Perl5>" argument for use get taken away? 16:54
I have old unchanged code that has stopped working after the Sunday upgrade.
raku -e 'use Inline::Perl5; use Email::Sender:from<Perl5>' 16:56
===SORRY!=== Error while compiling -e
Too many positionals passed; expected 1 argument but got 2
lizmat yeah, that's something that will need to be fixed by an update to Inline::Perl5 nine 16:58
HEAD and Inline::Perl5 are not compatible atm :-(
Xliff lizmat: What changed with traits? 17:47
lizmat nothing 17:48
Inline::Perl5 just doesn't work, the trait tries to do thta
*that 17:49
FWIW, the "use Inline::Perl5" in that case isn't needed
Inline::Perl5 just needs to be installed to make :from<Perl5> work (well before vrurg made changes in the mop :-) 17:50
Nemokosch is it possible to override an existing operator for an existing type? I want % (or mod) to return positive moduli for negative divisors as well 18:34
and div work accordingly
so for example 5 div -2 would be -2 in my file and 5 mod -2 would be 1 18:35
the whole thing is only useful if the polymod method can take that into account, otherwise I have to reimplement that in my code directly 18:36
moritz_ you can lexically override any operator, but the built-in operators will still use the original 18:42
the original design said the built-ins should also use your version, but so far there hasn't been any even remotely efficient implementation of that behavior 18:43
Nemokosch Yes, that makes sense unfortunately 18:44
there is another way to go about it: I could replace the negative digits to their value in the given negative base 18:47
but I don't know if this has an elegant way
> 13289110.polymod(-4 xx *)
(-2 -2 -3 -3 -2 -2 0 -3 -2 -3 0 -3)
so this is LSD to MSD
and I know that -2 is 12 in base -4, for example 18:48
usually they are 2-digit numbers in base -4, actually all of them but 0 18:49
is ther a way to turn this array into something properly overlapping so that I can sum them?
like -2 -2 is 1 | 2 1 | 2, where the middle digits go into the same slot and therefore should be summed
El_Che gbj's sound needs to be fixed 18:59
lizmat gbj? You mean japhb ? 19:12
lizmat m: "the original design said the built-ins should also use your version" I'm doubtful about this ever working, as it would be different how non-core modules / code works 19:15
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> built-ins should also use your version"⏏ I'm doubtful about this ever working,
expecting any of:
infix
infix stopper
lizmat "the original design said the built-ins should also use your version" I'm doubtful about this ever working, as it would be different how non-core modules / code works
Nemokosch what does that mean? 19:16
I mean, it makes sense in theory. If something is available everywhere and you override it, the perceived benefit why you didn't just derive something for yourself from it, is that it will be for everything you call 19:19
it will be *available for everything you call 19:20
lizmat this is one such case: github.com/rakudo/rakudo/pull/4484 (or solution?)
Nemokosch and it also makes sense that it isn't gonna be terribly fast if the right function to call needs to be looked up in all of your dependencies 19:21
and cannot really be optimized for 19:22
lizmat: yes, this is exactly something like that
it just sounded silly to ask about polymod letting you to specify mod and div 19:23
lizmat but using CALLERS:: is basically also saying: throw all runtime optimizations out of the door :-(
Nemokosch I can imagine that 19:24
It's tough because I cannot say that the current behavior of div and mod is bad. It's not the only possible definition but it is clearly a legitimate definition 19:26
however, not the one that would be useful in my case
but then it seems that eventually all the logic needs to be copied with the preferred definition of div and mod, which is much more painful in theory than in the particular example 19:27
I mean, I can say that it is bad... because they don't coerce to int, unlike everything else 😝 but that's really not the problem here 19:28
japhb El_Che: Assuming lizmat was right, what was wrong with my audio? When I did the recording for the first-day talk, I had a lot of fan noise that I had to filter out, which made the talk a bit quiet compared to some of the others. Was that what you were talking about? Or was it when I was talking on the RSC Q&A? 22:57