antononcube Google's Gemini gives (immediately) good results for "raku LLMs": 13:59
cdn.discordapp.com/attachments/768...4a0e0&
Not that great on "raku number theory" -- results are too generic. 14:01
librasteve i use ChatGPT a fair bit, but find that it often mixes perl / python code and hallucinates ... what is your preferred LLM for raku code support? 15:29
antononcube Both ChatGPT and Gemini work well with the prompt "CodeWriterX". 15:36
I have the corresponding LLM-persona specified / initialized in my Raku-chatbook initialization files. 15:37
That is equivalent to have the magic cell: #% chat raku prompt, model=gpt-4o, max-tokens=4096 @CodeWriterX|Raku 15:39
And then using that persona like so: #% chat raku Give an example of application of a list regexes for a given string and print out the corresponding results. 15:42
YMMV, of course. But it that prompt / persona produces very good results when it comes to translations from other languages, short examples of usage queries, or very long/complicated queries. 15:44
librasteve thanks! 16:02
msiism I'm going thorugh the Course of Raku and have noticed something about the solutions for execises provided in there. 18:21
It seems that, most of the time, these solutions show the most "pragmatic" way to solve a problem in Raku and I wonder whether that is the best idea. 18:22
Here's an example: course.raku.org/essentials/associa.../solution/
Personally, I would go for an if-else inside the loop because that is more "transparent" and universal. 18:24
I'd say that this would also be more appropriate for an introduction to the language. 18:26
The best would probably be to provide a "generic"/"stupid" but correct solution and then also show Raku's shortcut to that solution. 18:28
A few years of shell scripting have taught me that writing out an actual structure instead of using operator-based one-liners to keep things short is often better in the long run. 18:31
lizmat msiism: are you referring to the use of // ? 19:45
msiism Yes. 19:52
lizmat that is a *very* common idiom in Raku. as well as Perl 19:54
it basically is the same as || but for the left-hand side check on definedness, rather than truthiness 19:55
msiism Yeah, that's handy, for sure.
lizmat and as it's a course in Raku, not general programming techniques, it feels to me that it's pragmatic to show that syntax :-)
msiism Yeah, it should defintiely be shown. Maybe this is just a case of personal preference then. I'll have to look at other examples again. 19:56
lizmat perhaps it could use some explanation that foo // bar is basically short for: foo.defined ?? foo !! bar
msiism Yeah, that would be nice. 19:57
lizmat just as || is short for foo.Bool ?? foo !! bar
msiism I just realized that I tend to solve most of the exercises in less clever way than the author and then it keep that way. :) 20:00
s/it keep/keep it/ 20:01
lizmat that's ok :-) 20:28