🦋 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:03 yewscion joined 00:09 yewscion left 00:17 yewscion joined
[Coke] wayland: all fair game. 00:19
00:23 yewscion left 00:49 yewscion joined 00:55 yewscion left 01:11 coleman left 01:12 coleman joined 01:13 coleman left 01:14 coleman joined 01:19 notable6 left, notable6 joined 01:21 yewscion joined 01:26 yewscion left 01:43 jetchisel left 01:53 yewscion joined 01:57 hulk joined, kylese left 01:58 yewscion left 02:09 yewscion joined 02:13 stanrifkin joined 02:14 yewscion left 02:15 hulk left, kylese joined 02:35 yewscion joined 02:40 yewscion left
wayland76 Coke: how's the remake by finanalyst going, and what is it focusing on? 02:51
The one thing I did notice is that the transition documents focus heavily on Perl, and I think Perl should have it's own subsection among them. 02:53
Also, it might be useful to have transition documentation for more of the languages in the TIOBE top 20/50 (eg. PHP). Some it would be better to ignore for now (ie. Ignore Delphi until we have a RAD IDE), but one of the HARC guys might be able to put together a document about transitioning from, say, PHP and Laravel. 02:56
Voldenet I think what raku lacks the most to fight laravel is proper dependency injection 03:20
(and a lot of web stacks)
in laravel you can say `Route::get("/stuff", function (SomeDependency $dep) { })` and it will autowire dependencies 03:21
it's not really difficult to extract these from signatures, but it's something to work on probably 03:22
other thing I don't think I've seen is built-in csrf - this is usually done by middleware which checks whether post requests have specific field with some helper generating csrf field in forms 03:26
also, interacting with popular js frameworks may be useful (laravel doesn't directly do this, but some glue library exists for such use cases) 03:33
03:44 stanrifkin_ joined 03:45 kylese left 03:47 stanrifkin left, kylese joined
Xliff Voldenet: What do you mean by that? 04:13
Voldenew: get -> '/stuff'
D'oh
get -> 'stuff', inject => [Dep1, Dep2, Dep3] { } 04:14
That could be written, no?
Voldenet well, I'd say something like `get -> 'some'', 'route', :$param1, :Thing $thing { … }` with autodetecting what needs to be injected 04:16
or 04:17
`get -> 'some', 'route', :$param1, :Thing $thing is injected { … }`
Xliff That would be "..., Thing :$thing"
So...
Voldenet uh, right
Xliff That would be "..., Thing :$thing is injected"
OK. That makes sense. 04:18
Voldenet though I'd say that DI should fundamentally let you do `di.Bind(Thing, -> OtherThing $x { Thing.new($x) }, :lifetime(Singleton))`, `di.Bind(Thing)`, `di.Bind(ThingRole, ThingImpl)` and `di.Get(Thing)` 04:22
and then it introduces some concepts like lifetime, so it gets more and more complex
Xliff Right so .Bind does ...? 04:23
04:24 yewscion joined
Voldenet tells the container how to create given type 04:24
Xliff So basically: { require ::('Type'); ::('Type' 04:25
D'oh
So basically: { require ::('Type'); ::('Type').new }
Voldenet sort of, but DI needs to extract the dependencies required by class automatically 04:26
Xliff Right, but I would expect those as "use" statements in Thing.rakumod
And you're right... that would get messy. 04:27
Voldenet + sometimes you want to say "this class uses logger"
not "this class uses FileLogger"
and in some other place, you want to say what's logger, what config it has
Xliff To prevent in-request loading, would you have a problem with pre-loading the dependenies via a config file?
Voldenet: I get that. Baby steps! :) 04:28
Voldenet well, config file (the .raku which has all the "bind x to y") is one way to go about it 04:29
other is annotation/attribute driven "this is a sub that creates Thing" or "this is a class that implements Thing and it's a singleton" 04:31
one thing that is a service with its key, so you can say "this implements Smtp when requesting internal service", "this implements Smtp when requesting external service", and in sub you'd have `Smtp :$smtp is injected("internal")` 04:34
04:34 yewscion left
Voldenet this is not something that's widely implemented, but implementing them later may be a bit of pain 04:35
Xliff Well, I'm writing a app server, so feature ideas are welcome.... assuming I can wrap my head around the feature and have a decent use case.
Voldenet all (or most) of these things can be done without DI 04:37
but it forces you to do `my $s1 = Service.new; my $t = Thing.new(:service1($s1), :service2($s2)); get -> { $t.Blah() }` 04:39
the more features you add, the bigger the initialization would need to be… and you need to assign variables, track dependencies and instantiate everything on app start 04:40
so ultimately the goal was: as long as your application doesn't have circular dependencies, you can just define `class Thing { has Service $.s1 }` and then request `Thing` without ever calling Thing.new 04:42
ofc, the hole can be deep - DI defines decorators, also could let you say `Thing :@t is injected` that would give you all possible implementations of Thing 04:47
04:53 yewscion joined
Voldenet the only sure thing is that most modern web frameworks implement DI, but there's hardly any pointers on how to even name things 04:55
04:56 stanrifkin_ left 04:58 yewscion left
Voldenet > github.com/FCO/Injector 05:00
this implements a lot of things - I'm not sure about the need for `is injected` on attributes and variables, but it's a start 05:02
05:11 notable6 left, notable6 joined 05:13 nativecallable6 left 05:15 greppable6 left 05:22 jetchisel joined 05:24 yewscion joined, kjp left 05:25 committable6 left 05:26 kjp joined 05:28 kjp left 05:29 kjp joined, yewscion left 05:34 yewscion joined
SmokeMachine Voldenet: about csrf , it I’m not mistaken, cro’s Form does that natively. 05:35
Voldenet: and thank you for remembering Injector… I like that old piece of code… 05:36
05:40 kst`` joined
Voldenet cro's Form does, but i don't know how harc deals with it 05:43
wayland I'm just now learning about dependency injection. Would an example of where we need Dependency Injection be the DBIish classes? 05:44
05:44 yewscion left
SmokeMachine I’ve been planning on adding Injector support on Red… 05:46
Voldenet well - in java/C# world most frameworks support DI natively 05:48
because all you need to do is register proper dependencies
SmokeMachine Voldenet: and I’m also working on CEO’s Form support for Cromponents…
wayland CEO?
SmokeMachine Cro’s 05:49
Voldenet typo I guess
SmokeMachine Red, currently, needs a $*RED-DB with a connection… what I plan is to add a &*RED-DB is injected and the user will only need to bind connection… 05:51
Voldenet Yeah, dynamic variables are pain to use, especially if you'd need multiple databases 05:52
SmokeMachine Só, what meant is not add injector support on Red… but make use of injector on Red…
Voldenet Ah, so make any DI approach usable, I get it 05:53
Regarding dynamic variables, they're quite scary in practice, C# has something called AsyncLocal (which pretty much lets you define sort of dynamic variable) 05:56
I've used them for a bit, but then got into problems when I had to support multiple logical variables at the same time :\ 05:57
specifically, it was DI's scope, which is quite related to both topics 05:59
and all the logical problems went away after I passed the scope through a regular variable 06:00
japhb Everyone: I'm going back through my various Raku module repos looking for bitrot or other out-of-date stuff. 06:02
Currently I'm looking at Serializer-Perf (a collection of performance and fidelity tests for data serializer codecs). 06:03
Does anyone know of additional codecs that should be added to the list in the README at github.com/japhb/App-SerializerPerf ?
I suppose also if anyone knows one of the serializers have been considerably improved in the last couple years and thus should be reassessed in the results overview table ... 06:05
Voldenet perhaps YAML::Parser::LibYAML, it's a wrapper for libyaml 06:10
06:10 yewscion joined
Voldenet but I'm not sure how fair it is to use native code in serializers 06:10
japhb For this purpose, all's fair -- I'm trying to give people a decent way to tell what serializer they should choose for a particular purpose, and wrapping a native lib may actually be the right thing. 06:13
Though it does indicate that I'll probably need to add a column for "requires a native library"
Voldenet maybe there's some way to use protobuf too, I can imagine that some people using grpc at some point
s/that// 06:14
japhb It's been a really long time since I touched the protobuf code ... is it working well these days?
06:15 yewscion left
Voldenet protobuf itself is ok, in fact I've used criu not that long ago, it uses protobuf to serialize process into files 06:17
japhb Oh sorry, I meant the protobuf *Raku module* 06:19
Voldenet but I'm not sure how raku module works, I see there's something not ancient
if I read Protobuf's docs correctly, it only can parse protos, not deserialize/serialize things 06:20
japhb OK, so I'll look into adding YAML::Parser::LibYAML to the suite. 06:23
Anyone have any other serializers they'd like to see included in the tests?
06:24 Aedil joined
Xliff japhb!!! 06:32
Did you get my email?
Ah! You did! And a response! :) 06:33
japhb Xliff!!! :-D 06:40
wayland [Coke]: Another idea: If we look at the most starred/forked repos on GitHub, a number of them are tutorial-style documentation for eg. Python. github.com/EvanLi/Github-Ranking and github.com/EvanLi/Github-Ranking . Something of the kind could be useful for the doco endeavour. 06:41
06:42 yewscion joined
Xliff japhb: Terminal::QuickCharts is not available for zef? 06:44
japhb Gah, probably another repo I need to un-bitrot. On it, thanks. 06:45
wayland [Coke]: One more idea: github.com/codecrafters-io/build-your-own-x (one of the high-ranked repos) accepts links to "How to build your own X in language Y" items. 06:50
06:51 yewscion left
Xliff japhb: Does ::QuickCharts::ChartStyle support RGB-Ansi colors? 06:52
japhb Xliff: Anything that Terminal::ANSIColor supports, which should be everything, yes. :-) 06:53
Xliff Cool! Looking, then. 06:54
japhb Oh sorry, misread. ::ChartStyle doesn't do colors itself, it's for everything *but* the color. The charting routines accept the color info. 06:55
Sorry about that
So it turns out that I never actually did a zef release of this code, even though I'd set up the dist.ini for it. Ooooops. 06:56
Working to fix now.
OK, Terminal::QuickCharts is in zef now. Bah. 07:03
Xliff :) 07:04
japhb Xliff: Join #mugs if you want to discuss improving the Terminal::* suite (among other topics). 07:05
07:09 arkiuat left
japhb Time for sleep, will look for 'japhb' mentions here tomorrow. Or anything in #mugs because it's much lower traffic. :-) 07:10
07:11 yewscion joined
Xliff japhb: for hpad(), would you mind if I added a :$char = ' ' so that I can do something like '░' 07:14
librasteve good morning … from the HARC guy … Air::Form is about 90% done … it is a repackaging of cro Form and includes all the features in particular CSRF … 07:16
Xliff Do you mean Cro::WebApp::Form?
07:16 yewscion left
librasteve … yep 07:16
Xliff Interesting. I'll take a look at it later. Github? 07:17
librasteve github.com/librasteve/Air-Play/blo...rm.rakumod
it may be a bit broken right now as i realised it needs to fully interact with Red for the purest expression of CRUD … and then I realised I should embrace latest FCO Cromponent for various reasons yada yada 07:19
anyway good time to comment / weigh in and join the fun!! 07:20
07:21 arkiuat joined
on the wider topic of web frameworks, one big idea of HARC is that it is a synthesis of raku libraries that let you write a raku program to make a website … which is an extension of jnthns motif that it is a library not a framework 07:23
this means that there is no preset application loop - that’s the bit you write … but the tools are at your fingertips to whip up a laravel or a django - ie a CRUD application - so we can use any raku method for dependency management or injection and just combine that 07:25
use modules is the default way to integrate additional libraries 07:26
07:26 arkiuat left
Voldenet re DI: php used to not care about DI in the past and the apps worked, but using roles/interfaces instead of classes directly is just neat and makes specific components easier to test 07:33
07:34 yewscion joined
Voldenet it's not strictly required, just very useful tool that current stack could find useful 07:35
07:39 yewscion left 07:40 arkiuat joined 07:42 yewscion joined
SmokeMachine librasteve: are you going to use the latest Cromponent? Any feature you need in particular? 07:43
07:44 arkiuat left 07:48 yewscion left 08:14 arkiuat joined, yewscion joined 08:18 arkiuat left 08:19 yewscion left
librasteve SmokeMachine - yes … realised I need the EVAL route approach so in process of doing that. Will be pinging in a PR for you to review when I get it working. :-) 08:28
08:30 yewscion joined
one concern I have figured out yet is that CREATE is a reserved raku method (alternate to new that do not try to initialise attrs) and is used by Cro::WebApp::Form to avoid triggering is required trait when making an empty form for initial display … maybe you could change the CREATE method name i. Cromponent? (i’m mentioning here since this may well be an issue with pure Cromponent working with Cro::WebApp::Form also 08:32
08:34 arkiuat joined 08:37 yewscion left 08:38 arkiuat left 09:04 yewscion joined 09:05 arkiuat joined 09:09 yewscion left 09:10 arkiuat left 09:19 notable6 left, notable6 joined 09:20 yewscion joined 09:27 yewscion left 09:42 arkiuat joined, Aedil left 09:47 yewscion joined 09:52 yewscion left 10:02 arkiuat left
Voldenet: i just saw this on HN rednafi.com/go/di_frameworks_bleh/ lol 10:10
10:10 yewscion joined
Voldenet Yes, this whole DI topic might be just me being cargo culted into this 10:15
10:15 Sgeo left, yewscion left 10:21 yewscion joined
Voldenet and to be honest, constructing 300 lines of initialization code feels like pain, also manually crafting functions for lifetimes etc. 10:22
DI just automates the process, it's not magic 10:23
and it might not need automated, if the app only needs 6 singletons 10:25
10:25 yewscion left
Voldenet not need to be automated* 10:28
10:33 arkiuat joined, yewscion joined 10:38 arkiuat left 10:39 yewscion left 10:51 arkiuat joined 11:05 yewscion joined 11:10 yewscion left 11:12 bisectable6 left, coverable6 left, notable6 left, benchable6 left 11:13 quotable6 left, sourceable6 left 11:15 bloatable6 left 11:27 nativecallable6 joined 11:28 quotable6 joined, greppable6 joined, benchable6 joined, evalable6 joined 11:29 sourceable6 joined, releasable6 joined, linkable6 joined, coverable6 joined, committable6 joined, bloatable6 joined 11:30 shareable6 joined 11:31 unicodable6 joined, notable6 joined, tellable6 joined 11:34 apac joined 11:35 bisectable6 joined 11:36 yewscion joined 11:41 yewscion left 11:52 yewscion joined 11:54 arkiuat left 11:57 yewscion left 12:22 yewscion joined 12:23 arkiuat joined 12:26 yewscion left 12:27 arkiuat left 12:50 arkiuat joined 12:53 yewscion joined 12:57 Aedil joined 12:59 yewscion left
SmokeMachine Voldenet: did you try using Injector? Did that help? Is something there you would like to change? 13:14
tellable6 hey SmokeMachine, you have a message: gist.github.com/b84f68ad44a54027b7...7af72f102b
hey SmokeMachine, you have a message: gist.github.com/1999745879971fe9d8...d70ffc8516
SmokeMachine Librasteve: yes, I might change the name of that method… Any name suggestions? 13:15
13:23 yewscion joined 13:30 yewscion left 14:27 apac left
Xliff App::MI6 is no longer on zef? 14:50
antononcube Try "App::Mi6". 14:51
15:09 kjp left 15:10 kjp joined 15:27 yewscion joined 15:36 yewscion left 16:03 yewscion joined 16:07 yewscion left 16:16 stanrifkin joined 16:19 yewscion joined 16:24 yewscion left 16:26 yewscion joined
librasteve SmokeMachine: I would suggest ADD ... so LOAD, ADD, UPDATE, DELETE 16:30
let me know if you are OK with that and I will include in the PR
SmokeMachine librasteve: I think ADD is ok… 16:32
librasteve ok - thanks!
16:33 yewscion left 18:18 librasteve_ joined 18:29 wayland76 joined, wayland left 18:56 merp left 18:58 AlexDaniel joined 19:00 yewscion joined 19:05 yewscion left 19:16 Sgeo joined
antononcube .weekly : rakuforprediction.wordpress.com/20...lizations/ 19:17
.weekly rakuforprediction.wordpress.com/20...lizations/
weekly: rakuforprediction.wordpress.com/20...lizations/ 19:19
AlexDaniel hmmm 19:21
notable6: help
notable6 AlexDaniel, Like this: notable6: weekly rakudo is now 10x as fast # See wiki for more examples: github.com/Raku/whateverable/wiki/Notable
AlexDaniel why is discord bot called disbot1? 19:22
is it the new name?
github.com/Raku/whateverable/blob/...le.pm6#L28
19:29 yewscion joined 19:33 stanrifkin left 19:36 yewscion left 20:03 yewscion joined 20:08 yewscion left 20:26 yewscion joined
Xliff AlexDaniel!! 20:37
'sup?
AlexDaniel sup :) 20:38
Xliff Howarya?
AlexDaniel pretty good. Working, dancing, hacking. I would've preferred a slightly different balance of things (specifically work), but otherwise all good :) 20:39
Xliff Nice! Good to see you haven't forgotten us butterflies.
AlexDaniel of course not, I check the logs periodically 20:40
20:40 yewscion left
AlexDaniel do you know what's up with the discord bot? 20:40
is it a new permanent name? Should I commit a change for that?
Xliff I have no idea if the name is permanent or not. 20:41
I'm not the right person to ask, unfortunately.
irclogs.raku.org/raku/2025-05-20.h...20:31-0002 20:45
AlexDaniel first it was called raku-bridge, then it was called discord-raku-bot, and now it's disbot? 20:46
with 1 or not, that's not that importart
important*
OK I'll commit the change 20:47
Xliff Doh! I don't see disbot1 on logs.liz.nl... turns out it italicizes the name if they are from there.
AlexDaniel: If you can, I would assume the new name is "disbot" with a "disbot1" fallback. Might be better to use "disbot[ \d ]?"
disbot[ \d+ ]? # Maybe better... 20:49
AlexDaniel doesn't matter that much, hopefully the second fallback won't be needed :) 20:51
20:54 shareable6 left, linkable6 left, releasable6 left, committable6 left, nativecallable6 left, bloatable6 left, greppable6 left, bisectable6 left, benchable6 left, notable6 left, tellable6 left, sourceable6 left, unicodable6 left, quotable6 left, coverable6 left, evalable6 left
AlexDaniel wow… impressive… 20:56
20:57 linkable6 joined, nativecallable6 joined, quotable6 joined, bloatable6 joined, greppable6 joined 20:58 coverable6 joined, notable6 joined, committable6 joined, tellable6 joined, unicodable6 joined, evalable6 joined, shareable6 joined 20:59 bisectable6 joined, benchable6 joined, releasable6 joined 21:00 sourceable6 joined 21:01 apac joined
AlexDaniel antononcube: can you try again please? :) 21:04
antononcube Try what? 21:06
AlexDaniel the weekly: command 21:07
21:22 yewscion joined 21:23 AlexDaniel48 joined
AlexDaniel48 .seen antononcube 21:23
tellable6 AlexDaniel48, I saw antononcube 2025-05-25T21:06:06Z in #raku: <antononcube> Try what?
21:24 AlexDaniel left 21:28 yewscion left 21:31 yewscion joined 21:35 yewscion left 21:38 yewscion joined 21:43 yewscion left 21:57 AlexDaniel48 left 22:07 librasteve_ left 22:10 yewscion joined 22:15 yewscion left 22:21 apac left 22:32 yewscion joined
wayland76 [Coke]: One more for the website. It'd be nice if the IRC logs had the date floating at the top so we didn't have to scroll to see what date we're on. 22:32
22:37 yewscion left
wayland76 [Coke]: One more idea for the website. One of the strengths of PHP early on was that it had discussion taking place directly on the documentation website. I'm not necessarily suggesting we do the same, but if we had eg. some way of collating/linking the related StackOverflow questions (or relevant discussions on other sites) that might be nice. 22:43
ugexe stackoverflow should link to the docs, not the other way around 22:45
wayland76 I'm thinking the go would be: Automatic web scraper feeds database, (with URLs and tags). Human reviews tags and confirms. Database generates both Weekly News and a list of links for the doco pages. 22:46
ugexe: How about both directions? And I'm thinking that this mainly belongs in eg. the parts of the docs that have a list of all functions called "split", and links to each in their context. 22:47
22:48 yewscion joined
ugexe stackoverflow questions can be deleted, edited, etc. instead you can take stack overflow answers and put them into the docs (if it makes sense at all) and then just update the stackoverflow answer to point to those new docs 22:49
22:51 Aedil left 22:52 yewscion left
wayland76 ugexe: 3 reasons it'd still be handy to have the list of StackOverflow questions (even if it's "Click here to see a list of links to related StackOverflow questions). a) So that we can go "What might need to be incorporated into the docs?" b) I think sometimes it's handy to have more example code, but doesn't make sense to put it in the docs. And c) sometimes someone has something handy and brilliant, but isn't integrated into the community well enough 22:54
to bother putting it in the docs; they just want to post it somewhere. We should be enabling that to a certain extent.
ugexe anyone is free to take that post and put it into the docs 22:56
wayland76 ugexe: Yeah, but if it's not easy, they mostly won't. 23:05
23:09 wayland76 left
ugexe it is pretty easy 23:11
i also may not exactly like to find my stackoverflow answers linked in the documentation as some sort of authority or giving the impression i wrote it in the context of documentation 23:14
Voldenet SmokeMachine: nope, the primary problem is that it needs the whole code to use DI, which obviously skips too many abstraction layers 23:25
SmokeMachine: given `class X { has Int $.n; }; class Y { has Y $.y };`, I'd like to do `bind :to(X) :obj(X.new(n => 42)); bind Y, :singleton; get X;` 23:27
It might even be possible, I just don't know where would I start - docs only say about `is injected` use cases, so if you want to add some library class to DI, you're out of luck 23:30
overall when I tried to accomplish what I wanted, I ended up creating either explicit constructor `method new(Logger :$logger!) { self.bless(:$logger); }` 23:44
or factory method, e.g.: `$container.register(SessionStorage, -> Logger :$logger { SessionStorage.new(:$logger) });`
the biggest hurdle is that you can't simply ask for dependencies from "BUILD"/"new", so you'll end up creating attribute injection, which is considered bad in some languages 23:56
but the cause is that the dependencies are treated as optional