🦋 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 kjp left, kjp joined 00:13 lichtkind left 00:49 silug left 01:03 silug joined 01:15 hulk joined 01:16 kylese left 02:15 hulk left, kylese joined 03:12 stanrifkin_ joined 03:15 stanrifkin left 03:26 vasko left 03:30 vasko joined 03:45 kylese left 03:47 kylese joined 05:22 phogg left 05:37 phogg joined 05:57 Aedil joined 06:07 tejr left, ACfromTX left 06:09 tejr joined, japhb left, japhb joined 06:20 ACfromTX joined 06:54 Sgeo left 07:46 derpydoo joined 07:48 human-blip joined 08:00 wayland joined 08:05 derpydoo left 08:57 grondilu left 09:15 lichtkind joined 09:32 wayland left, wayland joined 09:33 wayland left 09:34 wayland joined 09:36 wayland left, wayland joined 09:39 wayland left, wayland joined 10:28 stanrifkin_ left 10:59 wayland left, wayland76 joined 11:06 stanrifkin joined
tbrowder hi, i am very interested in getting a good grip on handling rakudoc. @lizmat and others have made the raku core rakudoc handlers much easier to understand, but in my world i still see a need to be able to capture the output into a suitable tree format so one can easily walk back up the tree to see the full parent/child relationship. @finalyst and others have great ideas for expanding rakudoc use, but i haven’t yet seen a format allowing 11:34
easy reverse traversal. for proper typesetting on paper.
wayland76 Have you looked at all at the converters to HTML? I'm presuming you have, but thought I'd mention it. 11:46
lizmat tbrowder: with github.com/rakudo/rakudo/commit/6fd413c05f it became possible to use the .parent method inside a .grep / .map / .first on a RakuAST node 12:04
12:04 lichtkind left 12:09 lichtkind joined
tbrowder ok, thnx! using [Coke]'s walk-pod routine one can get a good start at the pod tree, so with .parent maybe i have all i need. off to der races... 12:29
wayland76: kinda, but my brief looks have seen it too hard to peel off the html handlers from the pod pieces. 12:31
12:53 tejr left 13:03 tejr joined 13:13 wayland joined, wayland76 left 13:16 wayland left, wayland joined 13:28 wayland left, wayland joined 13:29 wayland left, wayland76 joined 13:30 wayland76 left, wayland76 joined 13:31 wayland76 left, wayland76 joined 13:32 wayland76 left, wayland76 joined 13:33 wayland76 left, wayland76 joined 13:36 wayland76 left, wayland joined 13:38 wayland left, wayland joined 13:40 wayland left, wayland76 joined 13:42 wayland76 left 13:43 wayland76 joined 13:45 wayland76 left, wayland76 joined 13:46 wayland76 left, wayland76 joined 13:49 wayland76 left 13:50 wayland76 joined 13:52 wayland76 left, wayland76 joined 13:59 wayland76 left, wayland76 joined 14:07 wayland76 left 14:08 wayland76 joined 14:09 wayland76 left, wayland joined 14:10 wayland left 14:11 wayland joined 14:18 wayland left, wayland76 joined 14:32 Sgeo joined 14:56 wayland76 left, wayland76 joined 15:01 wayland76 left, wayland76 joined 15:12 wayland76 left, wayland joined 15:28 wayland left 15:29 wayland joined 15:35 wayland left, wayland joined 15:37 wayland left 15:38 wayland joined 15:40 wayland left, tejr_ joined, wayland joined 15:41 tejr left, tejr_ is now known as tejr 15:45 wayland left, wayland joined 15:46 wayland left 15:47 wayland joined 15:50 wayland left, wayland joined 15:53 wayland left
vasko librasteve: do you have an example of how Red fits in with the hArc stack - in particular with the automagic controllers and routes that get setup. Looking at `::Component` they go into a local `%holder`. 15:53
librasteve vasko: my bad, I have been in habit of developing on main on Air::Play gh repo… you should be fine if you either zef install Air, Air::Play (ie get the latest released versions together) or zef install the main branch directly from the respective gh repos together … i will try to branch and iterate off main going forward
15:53 wayland joined
otoh - i am happy that you are giving it a spin and i guess this is the first rung in moving up the production ready ladder 15:54
16:01 wayland left, wayland joined 16:07 peder left 16:09 wayland left 16:10 wayland joined, wayland left, wayland76 joined
SmokeMachine vasko: that’s not Air, but that’s using Red, Cro and Cromponents… may that help? dev.to/fco/building-raku-codeboard...-htmx-30k9 16:11
vasko: I suppose the code would look similar 16:13
16:15 wayland76 left, wayland76 joined 16:24 wayland76 left, wayland76 joined
vasko So basically override the methods like `method MYLOAD($serial) { self.^load: $serial }`, was thinking that also has to be automagic if you are using Red given that how deep the rabbit hole already is. 16:25
16:29 peder joined
SmokeMachine vasko: I was thinking if it would be a good thing to have that automatically… but it’s so easy to write it, I didn’t bother to make it automatic… but I’m stilling thinking about that… so in your opinion that should be automatic? The point of auto creating the Cro routes is because, on Cromponent’s case, it is already coupled to Cro… but that’s not the case with Red… many of the components may not be a model, as 16:32
some of them are not on that example… make sense?
16:37 wayland76 left, wayland76 joined 16:38 wayland76 left, wayland76 joined
vasko Aah ok it all makes sense now, reading the Cromponents where you have to explicitly set `add-cromponent-routes`. I was confused because the `add-routes` method automatically called for all components and the handlers are predefined, so I was looking for how you flip it into "real" mode. 16:45
Yeah the automatic routes definitely surprised me. (1) You probably want to opt into all of them for security reasons (2) As you say not all are stateful resources, some might be `GET /product?a=2&b=3` or some partial that serves some button with no side-effects. 16:47
antononcube @vasko I am not sure, but maybe looking into the code of "Marrow" would help. See raku.land/zef:ssotka/Marrow 16:58
17:04 human-blip left 17:06 human-blip joined
SmokeMachine vasko: on your GET example, you could use something like this: github.com/FCO/Cromponent/blob/952...akumod#L13 17:08
17:08 sjm_ joined
SmokeMachine vasko: you could define that url, or use something like that example and the url would be /todo/<todo-id>/toggle 17:11
17:14 peder left 17:20 wayland76 left 17:21 wayland76 joined 17:22 wayland76 left, wayland76 joined 17:33 wayland76 left, wayland76 joined
vasko SmokeMachine: That's interesting, so you create a resource that's actually just a method under the hood. I was thinking like a little higher e.g. imagine github.com/FCO/Cromponent/blob/952...rakumod#L1 if a TodoList. There isn't a need to POST/PUT todolists. Or say a `/todos/wc` 17:57
resource that you probably don't care about CRUD on that.
18:00 wayland76 left, wayland76 joined
vasko SmokeMachine also that `GET /toggle` is a *very* illegal in the context of REST purism :P. 18:04
You want `PUT /task/<id>/done` and `DELETE /task/<id>/done` if you want any chance of a restful afterlife. 18:09
18:10 peder joined 18:35 peder left 18:45 peder joined
librasteve vasko: fyi Air::Component has the same concepts as Cromponent - the biggest distinction is between writing HTML code as Air::Functional vs. Cro Templates 19:06
the source of both is pretty similar if you look - I have made automagic MYLOAD and so on (that you can override if you wish) and provided a couple of Air specific methods like .url 19:07
there are Todo examples for both so you can compare and contrast - I see the Todo as a good mental model / test for the full set of HTTP actions - iiuc you would rather have PUT on toggle since it changes state ... Air is a bit divorced from REST due to its HTMX leanings, but I am keen to do it right ... please can you elaborate on the trailing done - is that the url for the "after update redirect" ? 19:11
19:17 human-blip left 19:18 human-blip joined
ab5tract So I feel like I've done this before, but I want to be able to pass locations of %?RESOURCES .. because 90% of things you want to do with resources are designed around access via paths, not via raw buffers or however %?RESOURCES is designed to do it's thing 19:19
I guess if it comes to it I can dump to temporary files, but it just feels so weird to me
like do we expect distributions to suddenly shift contents around in the middle of a file access? or maybe there is some other edge case that makes accessing %?RESOURCE locations so wrong that we simply don't allow it (not a behavior that we traditionally tend towards, so why here?) 19:21
ugexe there are multiple reasons and they have been discussed many times so i won't reiterate too much. but 1) we wanted things to work on e.g. case insensitive file systems which requires implementation detail related stuff like renaming the files 2) a comp unit repository may not even be file based 19:53
regardless if you want to avoid the renaming thing you have to move the files to a different location anyway. so that workflow isn't exactly exotic or avoidable in general 19:54
any file shifting should be done at e.g. Build.rakumod time 20:04
%?RESOURCES and $?DISTRIBUTION would ideally have been github.com/Raku/old-design-docs/bl...streamable 20:14
librasteve github.com/librasteve/Air/issues/13 <== made an issue for vasko suggestions 20:39
ab5tract ugexe: thanks for that. It makes me wonder whether we might solve ourselves some headaches if we utilized a virtual file system approach 20:58
21:09 MasterDuke joined 21:45 MasterDuke left 22:10 Aedil left
wayland76 ab5tract: Just a heads-up that I'm slightly improving the doco around using $?DISTRIBUTION and %?RESOURCES. 22:26
Just trying to get the tests to pass :) 22:27
ab5tract nice :D
22:51 MasterDuke joined
wayland76 I expect it to be delayed in code review though. 22:53
22:57 wayland76 left 23:40 MasterDuke left