🦋 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 evalable6 joined, reportable6 left 00:01 linkable6 joined 00:03 reportable6 joined 00:09 jpn left
_elcaro_ re: RAKU_REPL_OUTPUT_METHOD, it's not that recent. Release notes say it was added mid-2020. 00:12
but the use of a method is fairly limiting. It would be nice if we could specify a function, then pretty-printers could be made pluggable with the repl 00:13
nemokosch perhaps it needed some tinkering, I don't remember exactly
_elcaro_ As is stands... I have a custom repl.raku that formats output with a little pretty printer I wrote (with color!) 00:15
screenshot comparison: 0racle.info/dump/raku-pp.png 00:23
My formatter maintains the brevity of gist, but removes ambiguity around what is string, how many of them are in a list, etc. 00:24
00:40 razetime joined 01:20 jgaz left 01:25 jgaz joined 02:25 bloatable6 left, sourceable6 left, greppable6 left, shareable6 left, coverable6 left, quotable6 left, linkable6 left, notable6 left, unicodable6 left, benchable6 left, committable6 left, nativecallable6 left, statisfiable6 left, evalable6 left, tellable6 left, reportable6 left, releasable6 left, squashable6 left, evalable6 joined 02:26 releasable6 joined, coverable6 joined, shareable6 joined 02:27 sourceable6 joined, tellable6 joined, notable6 joined, committable6 joined, statisfiable6 joined, linkable6 joined, unicodable6 joined, bloatable6 joined 02:28 benchable6 joined, squashable6 joined, quotable6 joined, nativecallable6 joined, reportable6 joined, greppable6 joined 03:28 notable6 left, statisfiable6 left, evalable6 left, shareable6 left, nativecallable6 left, bloatable6 left, linkable6 left, unicodable6 left, greppable6 left, reportable6 left, committable6 left, coverable6 left, tellable6 left, squashable6 left, quotable6 left, benchable6 left, releasable6 left, sourceable6 left 03:29 bloatable6 joined, linkable6 joined, coverable6 joined, shareable6 joined 03:30 tellable6 joined, greppable6 joined, committable6 joined, notable6 joined, evalable6 joined, reportable6 joined, benchable6 joined, unicodable6 joined 03:31 statisfiable6 joined, squashable6 joined, quotable6 joined, nativecallable6 joined, sourceable6 joined, releasable6 joined 04:03 euandreh left 04:05 euandreh joined, razetime left 04:45 razetime joined 05:25 discord-raku-bot left 05:31 swaggboi left 05:54 swaggboi joined 05:57 human-blip left 06:00 reportable6 left, reportable6 joined 06:02 human-blip joined 06:13 nebuchadnezzar joined 06:50 jpn joined 07:05 siavash joined 07:06 jpn left 07:17 jpn joined 07:24 jpn left 07:37 jpn joined 07:49 jpn left 07:51 sena_kun joined 08:15 dakkar joined 08:16 teatime left, teatime joined, heartburn left 08:21 teatwo joined 08:23 teatime left 08:30 razetime left 08:36 Sgeo left 08:39 heartburn joined 08:56 razetime joined
SmokeMachine Hi there! I've been playing with rcron and things are starting to get big (I mean this signature: github.com/FCO/RakuCron/blob/main/...#L17-L78). I'm trying to find a way to split it into multiple places but in a way the used signature would be the same. One possible way I'm thinking would be having a file (or many) listing the parameters and create the function with EVAL and maybe use the same 09:54
file to generate documentation, but I don't really like that way. Does anyone have any suggestion?
09:56 evalable6 left, linkable6 left 09:59 linkable6 joined, evalable6 joined
lizmat SmokeMachine: when the number of named args becomes that big, I usually just check %_ and write the logic using the hash 10:17
siavash SmokeMachine: Maybe replace Sundays,... with `Day @day_names` and month names with `Month @month_names`, Day and Month can be enums. Also if some options are incompatible, maybe create separate multi methods for each of them 10:18
lizmat SmokeMachine: especially since you need to do a lot of post-processing anyway
SmokeMachine lizmat: but then I'll need to validate then my self, right? And I'm still holding to use the signature for helping on ide's autocomplete... 10:19
lizmat or, if it is a CLI, walk the @*ARGS "manually" :-)
it's what I did in App::Rak
yes, you would lose that 10:20
SmokeMachine it isn't... :(
lizmat anyways, in App::Rak there are 200+ options... so that's a bit extreme :-)
SmokeMachine just a small part have posprocessing...
siavash: but that way the user wouldn't be able to pass :Sun, for example... 10:22
like on: `rcron -e '.run-at: :5hours, :Mon, :Wed, :Fri, { say "running a job" }'` 10:24
another way I'm thinking now would be create many small subs and a new sub that would consume all those, and generate the `run-at` method with the signature of all those subs combined and it would call all of those subs, one by one to build the hash to be used on `App::RakuCron::Rule.new` but for building the signature it would also use EVAL... :( 10:29
lizmat that's an approach similar to the one I used in App::Rak 10:30
SmokeMachine and an .^add_method, I think...
lizmat basically, each option has a sub with the method name encoded in it
SmokeMachine so you do almost what I described just not creating the method with the unified signature? 10:31
lizmat indeed... problem in Rak is that some options need to load additional modules 10:32
and do other stuff I forget at the moment
but creating a signature turned out to be very slow and cumbersome, is what I remember atm 10:33
people tend to call "rak" a lot... speed for the rcron interface is less of an issue, I'd say :-)
SmokeMachine even for doing that only once on compile time (if that's possible)?
yes, I agree 10:34
SmokeMachine sometimes think if he's giving too much alternatives adding all those aliases on parameters... 10:36
*too many? 10:37
lizmat well, there's that. 10:47
with App::Rak I made it possible for people to generate their own argument names for a given functionality
SmokeMachine m: multi m(:$a) { %(:$a) }; multi m(:$b) { %(:c($b)) }; say %( |&m.candidates.map: { .( |%( %(:1a, :2b){ .signature.params.grep(*.named).map: *.name.substr: 1 }:p ) ) } ) # maybe something like this would work for the generated function... 10:57
camelia {a => 1, c => 2}
10:59 jpn joined
SmokeMachine m: multi m(:$a) { %(:$a) }; multi m(:d(:$b)) { %(:c($b)) }; say %( |&m.candidates.map: { .( |%( %(:1a, :2d){ .signature.params.grep(*.named).map: |*.named_names }:p ) ) } ) # better 11:02
camelia {a => 1, c => 2}
siavash SmokeMachine: Another thing you can do is capture all parameters and call those separate subs with the capture; and each sub takes all params as capture but only operates only on parameters related to it, an example: codeberg.org/CIAvash/Pod-Contents/...#L234-L239
SmokeMachine siavash: yes, good point. But I would still need to declare all the possible parameters there... :( 11:03
siavash no, the main sub would only need `|c` 11:04
SmokeMachine if I only do the |c, I'll loose the autocompletion for the parameters... 11:05
siavash Well, I don't use an IDE 😀 11:07
SmokeMachine I don't want that for me... but for the users... :)
one of the points on doing something configured by a programming language is to get help on auto-completion and highlight... 11:08
siavash Yeah, good point. If Raku's signatures were reuseabe, it would be great. 11:12
11:24 jpn left 11:55 siavash left 12:00 reportable6 left 12:02 reportable6 joined 12:13 jpn joined 12:15 razetime left 12:27 cm left 12:28 cm joined 12:42 sena_kun left, jpn left 12:49 jpn joined 12:52 razetime joined 13:05 jpn left 13:29 razetime left 13:41 donaldh joined 13:49 donaldh left 14:07 pierrot left 14:09 pierrot joined 14:45 Sgeo joined 15:15 razetime joined 15:44 NemokoschKiwi joined 16:00 razetime left 16:05 razetime joined 16:13 razetime left, razetime_ joined 16:17 abraxxa left 16:22 razetime_ left 16:25 razetime joined 16:39 razetime left 16:42 razetime joined 16:51 razetime left, razetime_ joined 17:00 dakkar left 17:19 jgaz left 17:29 razetime_ left 18:00 reportable6 left
tbrowder__ .tell ugexe i installed zef from local zef clone of yr master br and it reported “ver 0.11.5, 1 occurence of deprecatef code: Method path (from Cool) seen at: t/utils-system.t, line 43; Please use IO instead”. installed ok, then upgraded to ver 0.18.3 ok 18:02
tellable6 tbrowder__, I'll pass your message to ugexe
18:03 reportable6 joined 18:24 Geth left
ugexe tbrowder__: zef is on version 0.18.3 18:26
tellable6 hey ugexe, you have a message: gist.github.com/b5bbc2488b8b3ba367...2462141ca4
ugexe zef also uses the main branch (not master) 18:27
18:27 xinming left 18:30 Geth joined
gfldex tbrowder__: you are asking for advice, but are not providing much context. Do you want to run Rakudo in the classroom, at $work or do you intend to build a base on the moon? 18:48
please say it's the moonbase! :->
18:48 jpn joined
teatwo what's a nice minimal low-barrier pastebin these days pls 18:51
18:55 jpn left
gfldex If you got a github account already, gist.github.com/ works fine. There are CLI interfaces too. 19:02
19:05 jpn joined 19:10 xinming joined 19:41 jpn left
SmokeMachine now rcron can make stuff like pomodoro! you can start and stop rules and run the rule based on the time it's running. 20:10
raku -I. bin/rcron -e '
my $interval = .run-at: :5secs-running, :off, -> :$rule, :$time { $rule.stop; say "$time.hh-mm-ss(): interval has finished" }
.run-at: :25secs-running, -> :$rule, :$time { $rule.stop; say "$time.hh-mm-ss(): Time to relax"; $interval.start }
20:14 xinming left 20:16 tea3po joined 20:19 teatwo left 20:27 tea3po left, tea3po joined 20:28 tea3po left, tea3po joined 20:38 xinming joined 20:43 vrurg_ joined 20:45 vrurg left, vrurg_ is now known as vrurg 20:46 jpn joined 20:57 NemokoschKiwi left
tbrowder__ ugexe: yes, my clone of zef still had master branch, all was cured after i checked out "main" (pain) branch 21:01
gfldex: my probable use case would be classroom or shared host at a library or similar setting 21:02
gfldex tbrowder__: In that case I would use central Rakudo but per-user Zef. Keeping the Compiler central can reduce the bugs that hit the users and you can't stop them from using a local Zef repo anyway. Also, not all users will need to install all modules. Easier to clean up that way. 21:05
I found a poem that can be translated to Raku: allpoetry.com/The-Road-to-Wisdom 21:06
m: $*ERR and $*ERR and $*ERR but Less and Less and Less
camelia WARNINGS for <tmp>:
Useless use of constant integer Less in sink context (line 1)
gfldex m: say „The Road to Wisdom“; $*ERR and $*ERR and $*ERR but Less and Less and Less 21:07
camelia WARNINGS for <tmp>:
The Road to Wisdom
Useless use of constant integer Less in sink context (line 1)
21:17 jpn left
tbrowder__ gfldex: thanks for advice && nice poetry! 21:21
ugexe: i am having trouble with zef on one debian host. in my cloned zef repo i excute "raku -I. bin/zef install ." and i get in response <Invalid JSON: at 0: expected a json object, but got '""'> 21:43
21:43 xinming left 23:05 xinming joined
tbrowder__ .ask ugexe ^^^ any questions or suggestions? 23:18
tellable6 tbrowder__, I'll pass your message to ugexe
23:23 habere-et-disper joined 23:51 leah2 left 23:54 leah2 joined